diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/.vs/config/applicationhost.config b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/.vs/config/applicationhost.config new file mode 100644 index 000000000..fd0a2b6b7 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/.vs/config/applicationhost.config @@ -0,0 +1,1028 @@ + + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator.sln b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator.sln new file mode 100644 index 000000000..eb3cdcb69 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator.sln @@ -0,0 +1,30 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContentGenerator", "ContentGenerator\ContentGenerator.csproj", "{795AE0C3-6949-43A8-B041-C32CCB920298}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContentGeneratorWeb", "ContentGeneratorWeb\ContentGeneratorWeb.csproj", "{6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {795AE0C3-6949-43A8-B041-C32CCB920298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {795AE0C3-6949-43A8-B041-C32CCB920298}.Debug|Any CPU.Build.0 = Debug|Any CPU + {795AE0C3-6949-43A8-B041-C32CCB920298}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {795AE0C3-6949-43A8-B041-C32CCB920298}.Release|Any CPU.ActiveCfg = Release|Any CPU + {795AE0C3-6949-43A8-B041-C32CCB920298}.Release|Any CPU.Build.0 = Release|Any CPU + {795AE0C3-6949-43A8-B041-C32CCB920298}.Release|Any CPU.Deploy.0 = Release|Any CPU + {6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGenerator.csproj b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGenerator.csproj new file mode 100644 index 000000000..652fc34bf --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGenerator.csproj @@ -0,0 +1,69 @@ + + + + + Debug + AnyCPU + {795AE0C3-6949-43A8-B041-C32CCB920298} + Library + Properties + ContentGenerator + ContentGenerator + v4.5 + 15.0 + 512 + {C1CDDADD-2546-481F-9697-4EA41081F2FC};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + {4fc56ad6-f2bc-47ed-921c-768a6c44d786} + {f2971228-b3f7-47c6-9c23-a4e94bccf72f} + {1b1e5af9-62f5-47c4-9edf-403a72c24313} + {0f9c3ec7-dfde-4916-9887-03880cff2ad9} + {45916d3b-a56a-402f-b83b-33d039aab8bd} + OfficeApp + 12.0 + 12.2 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + {42736422-ce18-4deb-a078-9827098e0a68} + + + manifest-oemanifest + + + + + {6CF8FD56-91D1-4C8A-8578-05E2E02B95E6} + ContentGeneratorWeb + True + Web + SharePointWebProjectOutput + ContentGeneratorWeb + False + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGeneratorManifest/ContentGenerator.xml b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGeneratorManifest/ContentGenerator.xml new file mode 100644 index 000000000..cf6c7e4ff --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGeneratorManifest/ContentGenerator.xml @@ -0,0 +1,17 @@ + + + + a97e3b13-b1b5-4660-b17c-2048e9024e11 + 1.0.0.0 + [Provider name] + en-US + + + + + + + + + ReadWriteDocument + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGeneratorManifest/SharePointProjectItem.spdata b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGeneratorManifest/SharePointProjectItem.spdata new file mode 100644 index 000000000..25a8eef04 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGenerator/ContentGeneratorManifest/SharePointProjectItem.spdata @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/App.css b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/App.css new file mode 100644 index 000000000..a688f9c23 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/App.css @@ -0,0 +1,54 @@ +/* Common app styling */ + +#content-header { + background: #2a8dd4; + color: #fff; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 80px; /* Fixed header height */ + overflow: hidden; /* Disable scrollbars for header */ +} + +#content-main { + background: #fff; + position: fixed; + top: 80px; /* Same value as #content-header's height */ + left: 0; + right: 0; + bottom: 0; + overflow: auto; /* Enable scrollbars within main content section */ +} + +.padding { + padding: 15px; +} + +#notification-message { + background-color: #818285; + color: #fff; + position: absolute; + width: 100%; + min-height: 80px; + right: 0; + z-index: 100; + bottom: 0; + display: none; /* Hidden until invoked */ +} + + #notification-message #notification-message-header { + font-size: medium; + margin-bottom: 10px; + } + + #notification-message #notification-message-close { + background-image: url("../Images/Close.png"); + background-repeat: no-repeat; + width: 24px; + height: 24px; + position: absolute; + right: 5px; + top: 5px; + cursor: pointer; + } diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/App.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/App.js new file mode 100644 index 000000000..fe4ddae09 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/App.js @@ -0,0 +1,33 @@ +/* Common app functionality */ + +var app = (function () { + "use strict"; + + var app = {}; + + // Common initialization function (to be called from each page) + app.initialize = function () { + $('body').append( + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
'); + + $('#notification-message-close').click(function () { + $('#notification-message').hide(); + }); + + + // After initialization, expose a common notification function + app.showNotification = function (header, text) { + $('#notification-message-header').text(header); + $('#notification-message-body').text(text); + $('#notification-message').slideDown('fast'); + }; + }; + + return app; +})(); \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.css b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.css new file mode 100644 index 000000000..a7106ee09 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.css @@ -0,0 +1,38 @@ +body { + margin: 0; + } + + #topDiv { + background-color: white; + padding: 0; + } + + #topDiv h2 { + margin: 0; + font-size: 24pt; + color: white; + background-color: #0a00ff; + padding: 12px; + height: 24px; + } + + #topDiv .toolbar { + background-color: #fbeba0; + margin: 0; + padding: 2px; + } + + #topDiv .toolbar input { + margin: 4px; + } + +#topDiv .displayPanel { + margin: 0; + border: 1px solid black; + padding: 6px; + font-size: 12px; + font-family: "Garamond, Arial, sans-serif"; + background-color: white; + color: blue; + min-height: 320px; +} \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.html b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.html new file mode 100644 index 000000000..d4a8d4209 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Get a Quote

+ +
+ + +
+ +
+
+
+ +
+ + + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.js new file mode 100644 index 000000000..47f22689f --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/AddIn/Home/Home.js @@ -0,0 +1,37 @@ +(function () { + "use strict"; + + Office.initialize = function (reason) { + $(document).ready(function () { + app.initialize(); + // adding event handlers for app command buttons + $("#cmdGetContent").click(cmdGetContent); + $("#cmdInsertContent").click(cmdInsertContent); + }); + }; + + function getQuote() { + + var quotes = [ + "I would rather have an Agave bottle in front of me than a frontal lobatomy.", + "Better to remain silent and be thought a fool than to speak and erase all doubt.", + "A two-year-old is kind of like having a blender, but you don't have a top for it.", + "Between two evils, I always pick the one I never tried before." + ]; + + var index = Math.floor(Math.random() * quotes.length); + return quotes[index]; + } + + function cmdGetContent() { + // display quote inside Agave + $("#contentArea").html(getQuote()); + } + + function cmdInsertContent() { + // insert current quote in Active Word document + var quote = $("#contentArea").html(); + Office.context.document.setSelectedDataAsync(quote, {}, function () { }); + } + +})(); \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Content/Office.css b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Content/Office.css new file mode 100644 index 000000000..4861f3ab8 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Content/Office.css @@ -0,0 +1,179 @@ +/*****************************************************************/ +/********************** Office CSS library ***********************/ +/********************** Version: 1.0.2.0 *************************/ +/*****************************************************************/ + +/****************************************************************** +Base +******************************************************************/ +body { + margin: 0; + padding: 0; + border: 0; + height: 100%; + max-height: 100%; +} + +/****************************************************************** +Typography +******************************************************************/ +body { + font-family: "Segoe WP", "Segoe UI", "Arial", sans-serif; + font-size: 12px; + color: #262626; +} + +h1 { + font-family: "Segoe WP Light", "Segoe UI", "Arial", sans-serif; + font-size: 22px; + line-height: 26px; + font-weight: 500; +} + +h2, h3, h4, h5, h6, th { + font-family: "Segoe WP Semibold", "Segoe UI", "Arial", sans-serif; +} + +h2 { + font-size: 18px; + line-height: 22px; + font-weight: 600; +} + +h3, h4, h5, h6 { + font-size: 13px; + line-height: 16px; +} + +h3 { + font-weight: 600; +} + +h4, h5, h6 { + font-weight: normal; +} + +form, input, select, button, textarea { + font-family: "Segoe WP", "Segoe UI", "Arial", sans-serif; + font-size: 12px; + line-height: 16px; +} + +/****************************************************************** +General +******************************************************************/ +a { + color: #336699; + text-decoration: none; +} + + a:focus, a:hover, a:active { + text-decoration: underline; + } + +ul { + margin-left: 1.4em; + padding: 0; +} + +hr { + border: none; + height: 1px; + color: #ebebeb; + background-color: #ebebeb; + clear: both; +} + +img { + border: none; +} + +blockquote { + margin-left: 1.4em; +} + +/****************************************************************** +Forms +******************************************************************/ +form { + clear: both; +} + +label { + margin-right: 3px; +} + +input, textarea, select, button { + margin: 0 0 5px 0; + padding: 3px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + + input[type="checkbox"], input[type="radio"] { + margin-right: 4px; + } + + input[type="checkbox"], input[type="radio"], + input[type="file"], input[type="image"] { + padding: 0; + } + + button, textarea, select, + input:not([type]), + input[type="button"], + input[type="color"], + input[type="date"], + input[type="datetime"], + input[type="datetime-local"], + input[type="email"], + input[type="month"], + input[type="number"], + input[type="password"], + input[type="reset"], + input[type="search"], + input[type="submit"], + input[type="tel"], + input[type="text"], + input[type="time"], + input[type="url"], + input[type="week"] { + border: 1px solid #cccccc; + background-color: white; + } + + button, input[type="button"], + input[type="submit"], input[type="reset"] { + padding-left: 10px; + padding-right: 10px; + text-align: center; + } + + button:hover:enabled, + input[type="button"]:hover:enabled, + input[type="submit"]:hover:enabled, + input[type="reset"]:hover:enabled { + border-color: #7eB4ea; + background-color: #e5f1fc; + } + + button:active:enabled, + input[type="button"]:active:enabled, + input[type="submit"]:active:enabled, + input[type="reset"]:active:enabled { + border-color: #569de5; + background-color: #cee5fc; + } + +/****************************************************************** +Scrollbars +******************************************************************/ +body { + scrollbar-base-color: white; + scrollbar-arrow-color: #ababab; + scrollbar-highlight-color: #ababab; + scrollbar-darkshadow-color: white; + scrollbar-track-color: white; + scrollbar-face-color: white; +} diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Content/OfficeThemes.css b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Content/OfficeThemes.css new file mode 100644 index 000000000..70a634e1d --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Content/OfficeThemes.css @@ -0,0 +1,68 @@ +/* The following classes describe the common theme information for office documents */ + + + +/* Basic Font and Background Colors for text */ +.office-docTheme-primary-fontColor { color:#000000; } +.office-docTheme-primary-bgColor { background-color:#ffffff; } +.office-docTheme-secondary-fontColor { color: #000000; } +.office-docTheme-secondary-bgColor { background-color: #ffffff; } + + +/* Accent color definitions for fonts */ +.office-contentAccent1-color { color:#5b9bd5; } +.office-contentAccent2-color { color:#ed7d31; } +.office-contentAccent3-color { color:#a5a5a5; } +.office-contentAccent4-color { color:#ffc000; } +.office-contentAccent5-color { color:#4472c4; } +.office-contentAccent6-color { color:#70ad47; } + +/* Accent color for backgrounds */ +.office-contentAccent1-bgColor { background-color:#5b9bd5; } +.office-contentAccent2-bgColor { background-color:#ed7d31; } +.office-contentAccent3-bgColor { background-color:#a5a5a5; } +.office-contentAccent4-bgColor { background-color:#ffc000; } +.office-contentAccent5-bgColor { background-color:#4472c4; } +.office-contentAccent6-bgColor { background-color:#70ad47; } + +/* Accent color for borders */ +.office-contentAccent1-borderColor { border-color:#5b9bd5; } +.office-contentAccent2-borderColor { border-color:#ed7d31; } +.office-contentAccent3-borderColor { border-color:#a5a5a5; } +.office-contentAccent4-borderColor { border-color:#ffc000; } +.office-contentAccent5-borderColor { border-color:#4472c4; } +.office-contentAccent6-borderColor { border-color:#70ad47; } + +/* links */ +.office-a {color: #0563c1; } +.office-a:visited { color: #954f72; } + +/* Body Fonts */ +.office-bodyFont-eastAsian { } /* East Asian name of the Font */ +.office-bodyFont-latin { font-family:"Calibri"; } /* Latin name of the Font */ +.office-bodyFont-script { } /* Script name of the Font */ +.office-bodyFont-localized { font-family:"Calibri"; } /* Localized name of the Font. contains the default font name according to the culture currently used in Office */ + +/* Headers Font */ +.office-headerFont-eastAsian { } +.office-headerFont-latin { font-family:"Calibri Light"; } +.office-headerFont-script { } +.office-headerFont-localized { font-family:"Calibri Light"; } + + + +/* The following classes define the Office themes. This classes make sense for the taskpane apps */ + +/* Basic Font and Background Colors for PPT */ +.office-officeTheme-primary-fontColor { color:#b83b1d; } +.office-officeTheme-primary-bgColor { background-color:#dedede; } +.office-officeTheme-secondary-fontColor { color:#262626; } +.office-officeTheme-secondary-bgColor { background-color:#ffffff; } + +/* Basic Font and Background Colors for Outlook Web Access */ +/* remove comments and delete other apps officeTheme classes to get OWA defaults +.office-officeTheme-primary-fontColor { color:#ea4400; } +.office-officeTheme-primary-bgColor { background-color:#ffffff; } +.office-officeTheme-secondary-fontColor { color:#ffffff; } +.office-officeTheme-secondary-bgColor { background-color:#ea4400; } +*/ \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/ContentGeneratorWeb.csproj b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/ContentGeneratorWeb.csproj new file mode 100644 index 000000000..f04e8b401 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/ContentGeneratorWeb.csproj @@ -0,0 +1,368 @@ + + + + + + + Debug + AnyCPU + + + 2.0 + {6CF8FD56-91D1-4C8A-8578-05E2E02B95E6} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + ContentGeneratorWeb + ContentGeneratorWeb + v4.5 + true + 44300 + + + + + + + 15.0 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + True + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 55976 + / + http://localhost:55976/ + False + False + + + False + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Images/Close.png b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Images/Close.png new file mode 100644 index 000000000..b282769c7 Binary files /dev/null and b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Images/Close.png differ diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Properties/AssemblyInfo.cs b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0d1dce1fd --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ContentGeneratorWeb")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ContentGeneratorWeb")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6cf8fd56-91d1-4c8a-8578-05e2e02b95e6")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/access-web-16.00.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/access-web-16.00.debug.js new file mode 100644 index 000000000..ac81ce65e --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/access-web-16.00.debug.js @@ -0,0 +1,6414 @@ +/* Access web application specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var OfficeExt; +(function (OfficeExt) { + var MicrosoftAjaxFactory = (function () { + function MicrosoftAjaxFactory() { + } + MicrosoftAjaxFactory.prototype.isMsAjaxLoaded = function () { + if (typeof (Sys) !== 'undefined' && typeof (Type) !== 'undefined' && Sys.StringBuilder && typeof (Sys.StringBuilder) === "function" && Type.registerNamespace && typeof (Type.registerNamespace) === "function" && Type.registerClass && typeof (Type.registerClass) === "function" && typeof (Function._validateParams) === "function") { + return true; + } else { + return false; + } + }; + MicrosoftAjaxFactory.prototype.loadMsAjaxFull = function (callback) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OSF.OUtil.loadScript(msAjaxCDNPath, callback); + }; + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", { + get: function () { + if (this._msAjaxError == null && this.isMsAjaxLoaded()) { + this._msAjaxError = Error; + } + return this._msAjaxError; + }, + set: function (errorClass) { + this._msAjaxError = errorClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", { + get: function () { + if (this._msAjaxSerializer == null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer = Sys.Serialization.JavaScriptSerializer; + } + return this._msAjaxSerializer; + }, + set: function (serializerClass) { + this._msAjaxSerializer = serializerClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", { + get: function () { + if (this._msAjaxString == null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer = String; + } + return this._msAjaxString; + }, + set: function (stringClass) { + this._msAjaxString = stringClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", { + get: function () { + if (this._msAjaxDebug == null && this.isMsAjaxLoaded()) { + this._msAjaxDebug = Sys.Debug; + } + return this._msAjaxDebug; + }, + set: function (debugClass) { + this._msAjaxDebug = debugClass; + }, + enumerable: true, + configurable: true + }); + return MicrosoftAjaxFactory; + })(); + OfficeExt.MicrosoftAjaxFactory = MicrosoftAjaxFactory; +})(OfficeExt || (OfficeExt = {})); +var OsfMsAjaxFactory = new OfficeExt.MicrosoftAjaxFactory(); +var OSF = OSF || {}; +var OfficeExt; +(function (OfficeExt) { + var SafeStorage = (function () { + function SafeStorage(_internalStorage) { + this._internalStorage = _internalStorage; + } + SafeStorage.prototype.getItem = function (key) { + try { + return this._internalStorage && this._internalStorage.getItem(key); + } catch (e) { + return null; + } + }; + SafeStorage.prototype.setItem = function (key, data) { + try { + this._internalStorage && this._internalStorage.setItem(key, data); + } catch (e) { + } + }; + SafeStorage.prototype.clear = function () { + try { + this._internalStorage && this._internalStorage.clear(); + } catch (e) { + } + }; + SafeStorage.prototype.removeItem = function (key) { + try { + this._internalStorage && this._internalStorage.removeItem(key); + } catch (e) { + } + }; + SafeStorage.prototype.getKeysWithPrefix = function (keyPrefix) { + var keyList = []; + try { + var len = this._internalStorage && this._internalStorage.length || 0; + for (var i = 0; i < len; i++) { + var key = this._internalStorage.key(i); + if (key.indexOf(keyPrefix) === 0) { + keyList.push(key); + } + } + } catch (e) { + } + return keyList; + }; + return SafeStorage; + })(); + OfficeExt.SafeStorage = SafeStorage; +})(OfficeExt || (OfficeExt = {})); +OSF.OUtil = (function () { + var _uniqueId = -1; + var _xdmInfoKey = '&_xdm_Info='; + var _serializerVersionKey = '&_serializer_version='; + var _xdmSessionKeyPrefix = '_xdm_'; + var _serializerVersionKeyPrefix = '_serializer_version='; + var _fragmentSeparator = '#'; + var _loadedScripts = {}; + var _defaultScriptLoadingTimeout = 30000; + var _safeSessionStorage = null; + var _safeLocalStorage = null; + + var _rndentropy = new Date().getTime(); + function _random() { + var nextrand = 0x7fffffff * (Math.random()); + nextrand ^= _rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10))); + + return nextrand.toString(16); + } + ; + function _getSessionStorage() { + if (!_safeSessionStorage) { + try { + var sessionStorage = window.sessionStorage; + } catch (ex) { + sessionStorage = null; + } + _safeSessionStorage = new OfficeExt.SafeStorage(sessionStorage); + } + return _safeSessionStorage; + } + ; + return { + set_entropy: function OSF_OUtil$set_entropy(entropy) { + if (typeof entropy == "string") { + for (var i = 0; i < entropy.length; i += 4) { + var temp = 0; + for (var j = 0; j < 4 && i + j < entropy.length; j++) { + temp = (temp << 8) + entropy.charCodeAt(i + j); + } + _rndentropy ^= temp; + } + } else if (typeof entropy == "number") { + _rndentropy ^= entropy; + } else { + _rndentropy ^= 0x7fffffff * Math.random(); + } + _rndentropy &= 0x7fffffff; + }, + extend: function OSF_OUtil$extend(child, parent) { + var F = function () { + }; + F.prototype = parent.prototype; + child.prototype = new F(); + child.prototype.constructor = child; + child.uber = parent.prototype; + if (parent.prototype.constructor === Object.prototype.constructor) { + parent.prototype.constructor = parent; + } + }, + setNamespace: function OSF_OUtil$setNamespace(name, parent) { + if (parent && name && !parent[name]) { + parent[name] = {}; + } + }, + unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) { + if (parent && name && parent[name]) { + delete parent[name]; + } + }, + loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) { + if (url && callback) { + var doc = window.document; + var _loadedScriptEntry = _loadedScripts[url]; + if (!_loadedScriptEntry) { + var script = doc.createElement("script"); + script.type = "text/javascript"; + _loadedScriptEntry = { loaded: false, pendingCallbacks: [callback], timer: null }; + _loadedScripts[url] = _loadedScriptEntry; + var onLoadCallback = function OSF_OUtil_loadScript$onLoadCallback() { + if (_loadedScriptEntry.timer != null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + _loadedScriptEntry.loaded = true; + var pendingCallbackCount = _loadedScriptEntry.pendingCallbacks.length; + for (var i = 0; i < pendingCallbackCount; i++) { + var currentCallback = _loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + var onLoadError = function OSF_OUtil_loadScript$onLoadError() { + delete _loadedScripts[url]; + if (_loadedScriptEntry.timer != null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + var pendingCallbackCount = _loadedScriptEntry.pendingCallbacks.length; + for (var i = 0; i < pendingCallbackCount; i++) { + var currentCallback = _loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + if (script.readyState) { + script.onreadystatechange = function () { + if (script.readyState == "loaded" || script.readyState == "complete") { + script.onreadystatechange = null; + onLoadCallback(); + } + }; + } else { + script.onload = onLoadCallback; + } + script.onerror = onLoadError; + + timeoutInMs = timeoutInMs || _defaultScriptLoadingTimeout; + _loadedScriptEntry.timer = setTimeout(onLoadError, timeoutInMs); + script.src = url; + doc.getElementsByTagName("head")[0].appendChild(script); + } else if (_loadedScriptEntry.loaded) { + callback(); + } else { + _loadedScriptEntry.pendingCallbacks.push(callback); + } + } + }, + loadCSS: function OSF_OUtil$loadCSS(url) { + if (url) { + var doc = window.document; + var link = doc.createElement("link"); + link.type = "text/css"; + link.rel = "stylesheet"; + link.href = url; + doc.getElementsByTagName("head")[0].appendChild(link); + } + }, + parseEnum: function OSF_OUtil$parseEnum(str, enumObject) { + var parsed = enumObject[str.trim()]; + if (typeof (parsed) == 'undefined') { + OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:" + str); + throw OsfMsAjaxFactory.msAjaxError.argument("str"); + } + return parsed; + }, + delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() { + var obj = { calc: arguments[0] }; + return function () { + if (obj.calc) { + obj.val = obj.calc.apply(this, arguments); + delete obj.calc; + } + return obj.val; + }; + }, + getUniqueId: function OSF_OUtil$getUniqueId() { + _uniqueId = _uniqueId + 1; + return _uniqueId.toString(); + }, + formatString: function OSF_OUtil$formatString() { + var args = arguments; + var source = args[0]; + return source.replace(/{(\d+)}/gm, function (match, number) { + var index = parseInt(number, 10) + 1; + return args[index] === undefined ? '{' + number + '}' : args[index]; + }); + }, + generateConversationId: function OSF_OUtil$generateConversationId() { + return [_random(), _random(), (new Date()).getTime().toString()].join('_'); + }, + getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame) { + var frameName = _xdmSessionKeyPrefix + cacheKey + this.generateConversationId(); + frame.setAttribute("name", frameName); + return this.generateConversationId(); + }, + addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) { + return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue); + }, + addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) { + return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion); + }, + addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue) { + url = url.trim() || ''; + var urlParts = url.split(_fragmentSeparator); + var urlWithoutFragment = urlParts.shift(); + var fragment = urlParts.join(_fragmentSeparator); + return [urlWithoutFragment, _fragmentSeparator, fragment, keyName, infoValue].join(''); + }, + parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) { + return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) { + return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, skipSessionStorage, fragment); + }, + parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) { + return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) { + return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, skipSessionStorage, fragment)); + }, + parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment) { + var fragmentParts = fragment.split(infoKey); + var xdmInfoValue = fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Common", Microsoft.Office); +OSF.SerializerVersion = { + MsAjax: 0, + Browser: 1 +}; + +(function (window) { + "use strict"; + var stringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', 'g'), trueFalseNullRegEx = new RegExp('\\b(true|false|null)\\b', 'g'), numbersRegEx = new RegExp('-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?', 'g'), badBracketsRegEx = new RegExp('[^{:,\\[\\s](?=\\s*\\[)'), badRemainderRegEx = new RegExp('[^\\s\\[\\]{}:,]'), jsonErrorMsg = "Cannot deserialize. The data does not correspond to valid JSON."; + function addHandler(element, eventName, handler) { + if (element.addEventListener) { + element.addEventListener(eventName, handler, false); + } else if (element.attachEvent) { + element.attachEvent("on" + eventName, handler); + } + } + function getAjaxSerializer() { + if (OsfMsAjaxFactory.msAjaxSerializer) { + return OsfMsAjaxFactory.msAjaxSerializer; + } + return null; + } + function deserialize(data, secure, oldDeserialize) { + var transformed; + if (!secure) { + return oldDeserialize(data); + } + if (window.JSON && window.JSON.parse) { + return window.JSON.parse(data); + } + + transformed = data.replace(stringRegEx, "[]"); + + transformed = transformed.replace(trueFalseNullRegEx, "[]"); + + transformed = transformed.replace(numbersRegEx, "[]"); + + if (badBracketsRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + if (badRemainderRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + try { + eval("(" + data + ")"); + } catch (e) { + throw jsonErrorMsg; + } + } + function patchDeserializer() { + var serializer = getAjaxSerializer(), oldDeserialize; + if (serializer === null || typeof (serializer.deserialize) !== "function") { + return false; + } + if (serializer.__patchVersion >= 1) { + return true; + } + + oldDeserialize = serializer.deserialize; + + serializer.deserialize = function (data, secure) { + return deserialize(data, true, oldDeserialize); + }; + serializer.__patchVersion = 1; + return true; + } + if (!patchDeserializer()) { + addHandler(window, "load", function () { + patchDeserializer(); + }); + } +}(window)); + +Microsoft.Office.Common.InvokeType = { + "async": 0, + "sync": 1, + "asyncRegisterEvent": 2, + "asyncUnregisterEvent": 3, + "syncRegisterEvent": 4, + "syncUnregisterEvent": 5 +}; + +Microsoft.Office.Common.InvokeResultCode = { + "noError": 0, + "errorInRequest": -1, + "errorHandlingRequest": -2, + "errorInResponse": -3, + "errorHandlingResponse": -4, + "errorHandlingRequestAccessDenied": -5, + "errorHandlingMethodCallTimedout": -6 +}; + +Microsoft.Office.Common.MessageType = { + "request": 0, + "response": 1 +}; + +Microsoft.Office.Common.ActionType = { + "invoke": 0, + "registerEvent": 1, + "unregisterEvent": 2 }; + +Microsoft.Office.Common.ResponseType = { + "forCalling": 0, + "forEventing": 1 +}; + +Microsoft.Office.Common.MethodObject = function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) { + this._method = method; + + this._invokeType = invokeType; + + this._blockingOthers = blockingOthers; +}; +Microsoft.Office.Common.MethodObject.prototype = { + getMethod: function Microsoft_Office_Common_MethodObject$getMethod() { + return this._method; + }, + getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() { + return this._invokeType; + }, + getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() { + return this._blockingOthers; + } +}; + +Microsoft.Office.Common.EventMethodObject = function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) { + this._registerMethodObject = registerMethodObject; + + this._unregisterMethodObject = unregisterMethodObject; +}; +Microsoft.Office.Common.EventMethodObject.prototype = { + getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() { + return this._registerMethodObject; + }, + getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() { + return this._unregisterMethodObject; + } +}; + +Microsoft.Office.Common.ServiceEndPoint = function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) { + var e = Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + + this._methodObjectList = {}; + + this._eventHandlerProxyList = {}; + + this._Id = serviceEndPointId; + + this._conversations = {}; + + this._policyManager = null; + + this._appDomains = {}; +}; +Microsoft.Office.Common.ServiceEndPoint.prototype = { + registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) { + var e = Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false }, + { name: "method", type: Function, mayBeNull: false }, + { name: "invokeType", type: Number, mayBeNull: false }, + { name: "blockingOthers", type: Boolean, mayBeNull: false } + ]); + if (e) + throw e; + if (invokeType !== Microsoft.Office.Common.InvokeType.async && invokeType !== Microsoft.Office.Common.InvokeType.sync) { + throw OsfMsAjaxFactory.msAjaxError.argument("invokeType"); + } + var methodObject = new Microsoft.Office.Common.MethodObject(method, invokeType, blockingOthers); + this._methodObjectList[methodName] = methodObject; + }, + unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) { + var e = Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._methodObjectList[methodName]; + }, + registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject = new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, Microsoft.Office.Common.InvokeType.syncRegisterEvent, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, Microsoft.Office.Common.InvokeType.syncUnregisterEvent, false)); + this._methodObjectList[eventName] = methodObject; + }, + registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "registerMethodInvokeType", type: Number, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethodInvokeType", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject = new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, registerMethodInvokeType, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, unregisterMethodInvokeType, false)); + this._methodObjectList[eventName] = methodObject; + }, + unregisterEvent: function (eventName) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + this.unregisterMethod(eventName); + }, + registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId, conversationUrl, appDomains, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "conversationUrl", type: String, mayBeNull: false, optional: true }, + { name: "appDomains", type: Object, mayBeNull: true, optional: true }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + ; + if (appDomains) { + if (!(appDomains instanceof Array)) { + throw OsfMsAjaxFactory.msAjaxError.argument("appDomains"); + } + this._appDomains[conversationId] = appDomains; + } + this._conversations[conversationId] = { url: conversationUrl, serializerVersion: serializerVersion }; + }, + unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._conversations[conversationId]; + }, + setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) { + var e = Function._validateParams(arguments, [ + { name: "policyManager", type: Object, mayBeNull: false } + ]); + if (e) + throw e; + + if (!policyManager.checkPermission) { + throw OsfMsAjaxFactory.msAjaxError.argument("policyManager"); + } + this._policyManager = policyManager; + }, + getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() { + return this._policyManager; + } +}; + +Microsoft.Office.Common.ClientEndPoint = function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "targetWindow", mayBeNull: false }, + { name: "targetUrl", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + if (!targetWindow.postMessage) { + throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow"); + } + + this._conversationId = conversationId; + + this._targetWindow = targetWindow; + + this._targetUrl = targetUrl; + + this._callingIndex = 0; + + this._callbackList = {}; + + this._eventHandlerList = {}; + if (serializerVersion != null) { + this._serializerVersion = serializerVersion; + } else { + this._serializerVersion = OSF.SerializerVersion.MsAjax; + } +}; +Microsoft.Office.Common.ClientEndPoint.prototype = { + invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) { + var e = Function._validateParams(arguments, [ + { name: "targetMethodName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "param", mayBeNull: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + var callbackEntry = { "callback": callback, "createdOn": now.getTime() }; + + if (param && typeof param === "object" && typeof param.__timeout__ === "number") { + callbackEntry.timeout = param.__timeout__; + delete param.__timeout__; + } + this._callbackList[correlationId] = callbackEntry; + try { + var callRequest = new Microsoft.Office.Common.Request(targetMethodName, Microsoft.Office.Common.ActionType.invoke, this._conversationId, correlationId, param); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !== null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } finally { + delete this._callbackList[correlationId]; + } + } + }, + registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) { + var e = Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "eventHandler", type: Function, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + this._callbackList[correlationId] = { "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest = new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.registerEvent, this._conversationId, correlationId, data); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + + this._eventHandlerList[targetEventName] = eventHandler; + } catch (ex) { + try { + if (callback !== null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } + }, + unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) { + var e = Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + this._callbackList[correlationId] = { "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest = new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.unregisterEvent, this._conversationId, correlationId, data); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !== null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } finally { + delete this._eventHandlerList[targetEventName]; + } + } +}; + +Microsoft.Office.Common.XdmCommunicationManager = (function () { + var _invokerQueue = []; + + var _lastMessageProcessTime = null; + + var _messageProcessingTimer = null; + + var _processInterval = 10; + + var _blockingFlag = false; + + var _methodTimeoutTimer = null; + + var _methodTimeoutProcessInterval = 2000; + + var _methodTimeoutDefault = 65000; + var _methodTimeout = _methodTimeoutDefault; + var _serviceEndPoints = {}; + var _clientEndPoints = {}; + var _initialized = false; + + function _lookupServiceEndPoint(conversationId) { + for (var id in _serviceEndPoints) { + if (_serviceEndPoints[id]._conversations[conversationId]) { + return _serviceEndPoints[id]; + } + } + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + ; + + function _lookupClientEndPoint(conversationId) { + var clientEndPoint = _clientEndPoints[conversationId]; + if (!clientEndPoint) { + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + return clientEndPoint; + } + ; + + function _lookupMethodObject(serviceEndPoint, messageObject) { + var methodOrEventMethodObject = serviceEndPoint._methodObjectList[messageObject._actionName]; + if (!methodOrEventMethodObject) { + OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:" + messageObject._actionName); + throw OsfMsAjaxFactory.msAjaxError.argument("messageObject"); + } + var methodObject = null; + if (messageObject._actionType === Microsoft.Office.Common.ActionType.invoke) { + methodObject = methodOrEventMethodObject; + } else if (messageObject._actionType === Microsoft.Office.Common.ActionType.registerEvent) { + methodObject = methodOrEventMethodObject.getRegisterMethodObject(); + } else { + methodObject = methodOrEventMethodObject.getUnregisterMethodObject(); + } + return methodObject; + } + ; + + function _enqueInvoker(invoker) { + _invokerQueue.push(invoker); + } + ; + + function _dequeInvoker() { + if (_messageProcessingTimer !== null) { + if (!_blockingFlag) { + if (_invokerQueue.length > 0) { + var invoker = _invokerQueue.shift(); + _executeCommand(invoker); + } else { + clearInterval(_messageProcessingTimer); + _messageProcessingTimer = null; + } + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + function _executeCommand(invoker) { + _blockingFlag = invoker.getInvokeBlockingFlag(); + + invoker.invoke(); + _lastMessageProcessTime = (new Date()).getTime(); + } + ; + + function _checkMethodTimeout() { + if (_methodTimeoutTimer) { + var clientEndPoint; + var methodCallsNotTimedout = 0; + var now = new Date(); + var timeoutValue; + for (var conversationId in _clientEndPoints) { + clientEndPoint = _clientEndPoints[conversationId]; + for (var correlationId in clientEndPoint._callbackList) { + var callbackEntry = clientEndPoint._callbackList[correlationId]; + + timeoutValue = callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout; + if (timeoutValue >= 0 && Math.abs(now.getTime() - callbackEntry.createdOn) >= timeoutValue) { + try { + if (callbackEntry.callback) { + callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout, null); + } + } finally { + delete clientEndPoint._callbackList[correlationId]; + } + } else { + methodCallsNotTimedout++; + } + ; + } + } + if (methodCallsNotTimedout === 0) { + clearInterval(_methodTimeoutTimer); + _methodTimeoutTimer = null; + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + + function _postCallbackHandler() { + _blockingFlag = false; + } + ; + + function _registerListener(listener) { + if (window.addEventListener) { + window.addEventListener("message", listener, false); + } else if ((navigator.userAgent.indexOf("MSIE") > -1) && window.attachEvent) { + window.attachEvent("onmessage", listener); + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."); + throw OsfMsAjaxFactory.msAjaxError.argument("Browser"); + } + } + ; + + function _checkOrigin(url, origin) { + var res = false; + + if (url === true) { + return true; + } + if (!url || !origin || !url.length || !origin.length) { + return res; + } + var url_parser, org_parser; + url_parser = document.createElement('a'); + org_parser = document.createElement('a'); + url_parser.href = url; + org_parser.href = origin; + res = _urlCompare(url_parser, org_parser); + delete url_parser, org_parser; + return res; + } + + function _checkOriginWithAppDomains(allowed_domains, origin) { + var res = false; + if (!origin || !origin.length || !(allowed_domains) || !(allowed_domains instanceof Array) || !allowed_domains.length) { + return res; + } + var org_parser = document.createElement('a'); + var app_domain_parser = document.createElement('a'); + org_parser.href = origin; + for (var i = 0; i < allowed_domains.length && !res; i++) { + if (allowed_domains[i].indexOf("://") !== -1) { + app_domain_parser.href = allowed_domains[i]; + res = _urlCompare(org_parser, app_domain_parser); + } + } + delete org_parser, app_domain_parser; + return res; + } + + function _urlCompare(url_parser1, url_parser2) { + return ((url_parser1.hostname == url_parser2.hostname) && (url_parser1.protocol == url_parser2.protocol) && (url_parser1.port == url_parser2.port)); + } + + function _receive(e) { + if (e.data != '') { + var messageObject; + var serializerVersion = OSF.SerializerVersion.MsAjax; + var serializedMessage = e.data; + + try { + messageObject = Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, OSF.SerializerVersion.Browser); + serializerVersion = messageObject._serializerVersion != null ? messageObject._serializerVersion : serializerVersion; + } catch (ex) { + } + if (serializerVersion != OSF.SerializerVersion.Browser) { + try { + messageObject = Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, serializerVersion); + } catch (ex) { + return; + } + } + if (typeof (messageObject._messageType) == 'undefined') { + return; + } + + if (messageObject._messageType === Microsoft.Office.Common.MessageType.request) { + var requesterUrl = (e.origin == null || e.origin == "null") ? messageObject._origin : e.origin; + try { + var serviceEndPoint = _lookupServiceEndPoint(messageObject._conversationId); + ; + var conversation = serviceEndPoint._conversations[messageObject._conversationId]; + serializerVersion = conversation.serializerVersion != null ? conversation.serializerVersion : serializerVersion; + ; + if (!_checkOrigin(conversation.url, e.origin) && !_checkOriginWithAppDomains(serviceEndPoint._appDomains[messageObject._conversationId], e.origin)) { + throw "Failed origin check"; + } + var policyManager = serviceEndPoint.getPolicyManager(); + if (policyManager && !policyManager.checkPermission(messageObject._conversationId, messageObject._actionName, messageObject._data)) { + throw "Access Denied"; + } + var methodObject = _lookupMethodObject(serviceEndPoint, messageObject); + + var invokeCompleteCallback = new Microsoft.Office.Common.InvokeCompleteCallback(e.source, requesterUrl, messageObject._actionName, messageObject._conversationId, messageObject._correlationId, _postCallbackHandler, serializerVersion); + + var invoker = new Microsoft.Office.Common.Invoker(methodObject, messageObject._data, invokeCompleteCallback, serviceEndPoint._eventHandlerProxyList, messageObject._conversationId, messageObject._actionName, serializerVersion); + var shouldEnque = true; + + if (_messageProcessingTimer == null) { + if ((_lastMessageProcessTime == null || (new Date()).getTime() - _lastMessageProcessTime > _processInterval) && !_blockingFlag) { + _executeCommand(invoker); + shouldEnque = false; + } else { + _messageProcessingTimer = setInterval(_dequeInvoker, _processInterval); + } + } + if (shouldEnque) { + _enqueInvoker(invoker); + } + } catch (ex) { + var errorCode = Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest; + if (ex == "Access Denied") { + errorCode = Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied; + } + var callResponse = new Microsoft.Office.Common.Response(messageObject._actionName, messageObject._conversationId, messageObject._correlationId, errorCode, Microsoft.Office.Common.ResponseType.forCalling, ex); + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(callResponse, serializerVersion); + if (e.source && e.source.postMessage) { + e.source.postMessage(envelopedResult, requesterUrl); + } + } + } else if (messageObject._messageType === Microsoft.Office.Common.MessageType.response) { + var clientEndPoint = _lookupClientEndPoint(messageObject._conversationId); + clientEndPoint._serializerVersion = serializerVersion; + ; + if (!_checkOrigin(clientEndPoint._targetUrl, e.origin)) { + throw "Failed orgin check"; + } + if (messageObject._responseType === Microsoft.Office.Common.ResponseType.forCalling) { + var callbackEntry = clientEndPoint._callbackList[messageObject._correlationId]; + if (callbackEntry) { + try { + if (callbackEntry.callback) + callbackEntry.callback(messageObject._errorCode, messageObject._data); + } finally { + delete clientEndPoint._callbackList[messageObject._correlationId]; + } + } + } else { + var eventhandler = clientEndPoint._eventHandlerList[messageObject._actionName]; + if (eventhandler !== undefined && eventhandler !== null) { + eventhandler(messageObject._data); + } + } + } else { + return; + } + } + } + ; + + function _initialize() { + if (!_initialized) { + _registerListener(_receive); + _initialized = true; + } + } + ; + + return { + connect: function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl, serializerVersion) { + var clientEndPoint = _clientEndPoints[conversationId]; + if (!clientEndPoint) { + _initialize(); + clientEndPoint = new Microsoft.Office.Common.ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion); + _clientEndPoints[conversationId] = clientEndPoint; + } + return clientEndPoint; + }, + getClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _clientEndPoints[conversationId]; + }, + createServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) { + _initialize(); + var serviceEndPoint = new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId); + _serviceEndPoints[serviceEndPointId] = serviceEndPoint; + return serviceEndPoint; + }, + getServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) { + var e = Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _serviceEndPoints[serviceEndPointId]; + }, + deleteClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete _clientEndPoints[conversationId]; + }, + _setMethodTimeout: function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) { + var e = Function._validateParams(arguments, [ + { name: "methodTimeout", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + _methodTimeout = (methodTimeout <= 0) ? _methodTimeoutDefault : methodTimeout; + }, + _startMethodTimeoutTimer: function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() { + if (!_methodTimeoutTimer) { + _methodTimeoutTimer = setInterval(_checkMethodTimeout, _methodTimeoutProcessInterval); + } + } + }; +})(); + +Microsoft.Office.Common.Message = function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) { + var e = Function._validateParams(arguments, [ + { name: "messageType", type: Number, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._messageType = messageType; + + this._actionName = actionName; + + this._conversationId = conversationId; + + this._correlationId = correlationId; + + this._origin = window.location.href; + + if (typeof data == "undefined") { + this._data = null; + } else { + this._data = data; + } +}; +Microsoft.Office.Common.Message.prototype = { + getActionName: function Microsoft_Office_Common_Message$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_Message$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() { + return this._correlationId; + }, + getOrigin: function Microsoft_Office_Common_Message$getOrigin() { + return this._origin; + }, + getData: function Microsoft_Office_Common_Message$getData() { + return this._data; + }, + getMessageType: function Microsoft_Office_Common_Message$getMessageType() { + return this._messageType; + } +}; + +Microsoft.Office.Common.Request = function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) { + Microsoft.Office.Common.Request.uber.constructor.call(this, Microsoft.Office.Common.MessageType.request, actionName, conversationId, correlationId, data); + this._actionType = actionType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Request, Microsoft.Office.Common.Message); +Microsoft.Office.Common.Request.prototype.getActionType = function Microsoft_Office_Common_Request$getActionType() { + return this._actionType; +}; + +Microsoft.Office.Common.Response = function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) { + Microsoft.Office.Common.Response.uber.constructor.call(this, Microsoft.Office.Common.MessageType.response, actionName, conversationId, correlationId, data); + this._errorCode = errorCode; + this._responseType = responseType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Response, Microsoft.Office.Common.Message); + +Microsoft.Office.Common.Response.prototype.getErrorCode = function Microsoft_Office_Common_Response$getErrorCode() { + return this._errorCode; +}; + +Microsoft.Office.Common.Response.prototype.getResponseType = function Microsoft_Office_Common_Response$getResponseType() { + return this._responseType; +}; + +Microsoft.Office.Common.MessagePackager = { + envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject, serializerVersion) { + if (serializerVersion == OSF.SerializerVersion.Browser && (typeof (JSON) !== "undefined")) { + if (typeof (messageObject) === "object") { + messageObject._serializerVersion = serializerVersion; + } + return JSON.stringify(messageObject); + } else { + if (typeof (messageObject) === "object") { + messageObject._serializerVersion = OSF.SerializerVersion.MsAjax; + } + return OsfMsAjaxFactory.msAjaxSerializer.serialize(messageObject); + } + }, + unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject, serializerVersion) { + if (serializerVersion == OSF.SerializerVersion.Browser && (typeof (JSON) !== "undefined")) { + return JSON.parse(messageObject); + } else { + return OsfMsAjaxFactory.msAjaxSerializer.deserialize(messageObject, true); + } + } +}; + +Microsoft.Office.Common.ResponseSender = function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "requesterWindow", mayBeNull: false }, + { name: "requesterUrl", type: String, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "responsetype", type: Number, maybeNull: false }, + { name: "serializerVersion", type: Number, maybeNull: true, optional: true } + ]); + if (e) + throw e; + + this._requesterWindow = requesterWindow; + + this._requesterUrl = requesterUrl; + + this._actionName = actionName; + + this._conversationId = conversationId; + + this._correlationId = correlationId; + + this._invokeResultCode = Microsoft.Office.Common.InvokeResultCode.noError; + + this._responseType = responseType; + var me = this; + + this._send = function (result) { + try { + var response = new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + ; + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:" + ex.message); + } + }; +}; +Microsoft.Office.Common.ResponseSender.prototype = { + getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() { + return this._requesterWindow; + }, + getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() { + return this._requesterUrl; + }, + getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() { + return this._correlationId; + }, + getSend: function Microsoft_Office_Common_ResponseSender$getSend() { + return this._send; + }, + setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) { + this._invokeResultCode = resultCode; + } +}; + +Microsoft.Office.Common.InvokeCompleteCallback = function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler, serializerVersion) { + Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this, requesterWindow, requesterUrl, actionName, conversationId, correlationId, Microsoft.Office.Common.ResponseType.forCalling, serializerVersion); + + this._postCallbackHandler = postCallbackHandler; + var me = this; + + this._send = function (result) { + try { + var response = new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + + me._postCallbackHandler(); + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:" + ex.message); + } + }; +}; +OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback, Microsoft.Office.Common.ResponseSender); + +Microsoft.Office.Common.Invoker = function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "methodObject", mayBeNull: false }, + { name: "paramValue", mayBeNull: true }, + { name: "invokeCompleteCallback", mayBeNull: false }, + { name: "eventHandlerProxyList", mayBeNull: true }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "eventName", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._methodObject = methodObject; + + this._param = paramValue; + + this._invokeCompleteCallback = invokeCompleteCallback; + + this._eventHandlerProxyList = eventHandlerProxyList; + + this._conversationId = conversationId; + + this._eventName = eventName; + this._serializerVersion = serializerVersion; +}; +Microsoft.Office.Common.Invoker.prototype = { + invoke: function Microsoft_Office_Common_Invoker$invoke() { + try { + var result; + switch (this._methodObject.getInvokeType()) { + case Microsoft.Office.Common.InvokeType.async: + this._methodObject.getMethod()(this._param, this._invokeCompleteCallback.getSend()); + break; + case Microsoft.Office.Common.InvokeType.sync: + result = this._methodObject.getMethod()(this._param); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncRegisterEvent: + var eventHandlerProxy = this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + result = this._methodObject.getMethod()(eventHandlerProxy.getSend(), this._param); + + this._eventHandlerProxyList[this._conversationId + this._eventName] = eventHandlerProxy.getSend(); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncUnregisterEvent: + var eventHandler = this._eventHandlerProxyList[this._conversationId + this._eventName]; + + result = this._methodObject.getMethod()(eventHandler, this._param); + + delete this._eventHandlerProxyList[this._conversationId + this._eventName]; + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.asyncRegisterEvent: + var eventHandlerProxyAsync = this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(), this._invokeCompleteCallback.getSend(), this._param); + + this._eventHandlerProxyList[this._callerId + this._eventName] = eventHandlerProxyAsync.getSend(); + + break; + case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: + var eventHandlerAsync = this._eventHandlerProxyList[this._callerId + this._eventName]; + + this._methodObject.getMethod()(eventHandlerAsync, this._invokeCompleteCallback.getSend(), this._param); + + delete this._eventHandlerProxyList[this._callerId + this._eventName]; + + break; + default: + break; + } + } catch (ex) { + this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse); + this._invokeCompleteCallback.getSend()(ex); + } + }, + getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() { + return this._methodObject.getBlockingFlag(); + }, + _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) { + return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(), invokeCompleteObject.getRequesterUrl(), invokeCompleteObject.getActionName(), invokeCompleteObject.getConversationId(), invokeCompleteObject.getCorrelationId(), Microsoft.Office.Common.ResponseType.forEventing, this._serializerVersion); + } +}; + +OSF.OUtil.setNamespace("WAC", OSF.DDA); + +OSF.DDA.WAC.UniqueArguments = { + Data: "Data", + Properties: "Properties", + BindingRequest: "DdaBindingsMethod", + BindingResponse: "Bindings", + SingleBindingResponse: "singleBindingResponse", + GetData: "DdaGetBindingData", + AddRowsColumns: "DdaAddRowsColumns", + SetData: "DdaSetBindingData", + ClearFormats: "DdaClearBindingFormats", + SetFormats: "DdaSetBindingFormats", + SettingsRequest: "DdaSettingsMethod", + BindingEventSource: "ddaBinding", + ArrayData: "ArrayData" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.Delegate.SpecialProcessor = function OSF_DDA_WAC_Delegate_SpecialProcessor() { + var complexTypes = [ + OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + OSF.DDA.WAC.UniqueArguments.BindingRequest, + OSF.DDA.WAC.UniqueArguments.BindingResponse, + OSF.DDA.WAC.UniqueArguments.GetData, + OSF.DDA.WAC.UniqueArguments.AddRowsColumns, + OSF.DDA.WAC.UniqueArguments.SetData, + OSF.DDA.WAC.UniqueArguments.ClearFormats, + OSF.DDA.WAC.UniqueArguments.SetFormats, + OSF.DDA.WAC.UniqueArguments.SettingsRequest, + OSF.DDA.WAC.UniqueArguments.BindingEventSource + ]; + var dynamicTypes = {}; + OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); +}; + +OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.WAC.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor(), []); +OSF.OUtil.setNamespace("WAC", OSF.DDA); +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.getDelegateMethods = function OSF_DDA_WAC_getDelegateMethods() { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.WAC.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.WAC.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.WAC.Delegate.unregisterEventAsync; + return delegateMethods; +}; +OSF.DDA.WAC.Delegate.version = 1; +OSF.DDA.WAC.Delegate.executeAsync = function OSF_DDA_WAC_Delegate$executeAsync(args) { + if (!args.hostCallArgs) { + args.hostCallArgs = {}; + } + args.hostCallArgs["DdaMethod"] = { + "ControlId": OSF._OfficeAppFactory.getId(), + "Version": OSF.DDA.WAC.Delegate.version, + "DispatchId": args.dispId + }; + + args.hostCallArgs["__timeout__"] = -1; + + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.getClientEndPoint().invoke("executeMethod", function OSF_DDA_WAC_Delegate$OMFacade$OnResponse(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var error; + if (xdmStatus == Microsoft.Office.Common.InvokeResultCode.noError) { + OSF.DDA.WAC.Delegate.version = payload["Version"]; + error = payload["Error"]; + } else { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + error = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + error = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(error, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, null, Math.abs((new Date()).getTime() - startTime), error); + } + }, args.hostCallArgs); +}; +OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent = function OSF_DDA_WAC_Delegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_WAC_Delegate$OnAfterRegisterEvent(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var status; + if (xdmStatus != Microsoft.Office.Common.InvokeResultCode.noError) { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } else { + if (payload) { + if (payload["Error"]) { + status = payload["Error"]; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.WAC.Delegate.registerEventAsync = function OSF_DDA_WAC_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), function OSF_DDA_WACOMFacade$OnEvent(payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.DDA.WAC.Delegate.unregisterEventAsync = function OSF_DDA_WAC_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.OUtil.setNamespace("WebApp", OSF); + +OSF.WebApp.AddHostInfoAndXdmInfo = function OSF_WebApp$AddHostInfoAndXdmInfo(url) { + if (OSF._OfficeAppFactory.getWindowLocationSearch && OSF._OfficeAppFactory.getWindowLocationHash) { + return url + OSF._OfficeAppFactory.getWindowLocationSearch() + OSF._OfficeAppFactory.getWindowLocationHash(); + } else { + return url; + } +}; + +OSF.WebApp._UpdateLinksForHostAndXdmInfo = function OSF_WebApp$_UpdateLinksForHostAndXdmInfo() { + var links = document.querySelectorAll("a[data-officejs-navigate]"); + for (var i = 0; i < links.length; i++) { + if (OSF.WebApp._isGoodUrl(links[i].href)) { + links[i].href = OSF.WebApp.AddHostInfoAndXdmInfo(links[i].href); + } + } + + var forms = document.querySelectorAll("form[data-officejs-navigate]"); + for (var i = 0; i < forms.length; i++) { + var form = forms[i]; + if (OSF.WebApp._isGoodUrl(form.action)) { + form.action = OSF.WebApp.AddHostInfoAndXdmInfo(form.action); + } + } +}; + +OSF.WebApp._isGoodUrl = function OSF_WebApp$_isGoodUrl(url) { + if (typeof url == 'undefined') + return false; + url = url.trim(); + var colonIndex = url.indexOf(':'); + var protocol = colonIndex > 0 ? url.substr(0, colonIndex) : null; + + var goodUrl = protocol !== null ? protocol.toLowerCase() === "http" || protocol.toLowerCase() === "https" : true; + + goodUrl = goodUrl && url != "#" && url != "/" && url != "" && url != OSF._OfficeAppFactory.getWebAppState().webAppUrl; + return goodUrl; +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) { + var settings; + var serializedSettings = appContext.get_settings(); + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = typeof (JSON) !== "undefined" ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = typeof (JSON) !== "undefined" ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; + }; + + var windowOpen = function OSF_InitializationHelper$windowOpen(windowObj) { + var proxy = window.open; + windowObj.open = function (strUrl, strWindowName, strWindowFeatures) { + var windowObject = null; + try { + windowObject = proxy(strUrl, strWindowName, strWindowFeatures); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen." + ex); + } + } + if (!windowObject) { + var params = { + "strUrl": strUrl, + "strWindowName": strWindowName, + "strWindowFeatures": strWindowFeatures + }; + OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost", null, params); + } + return windowObject; + }; + }; + windowOpen(window); +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var getInvocationCallbackWebApp = function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) { + var settings; + if (appContext._appName === OSF.AppName.ExcelWebApp) { + var serializedSettings = appContext._settings; + settings = {}; + for (var index in serializedSettings) { + var setting = serializedSettings[index]; + settings[setting[0]] = setting[1]; + } + } else { + settings = appContext._settings; + } + if (errorCode === 0 && appContext._id != undefined && appContext._appName != undefined && appContext._appVersion != undefined && appContext._appUILocale != undefined && appContext._dataLocale != undefined && appContext._docUrl != undefined && appContext._clientMode != undefined && appContext._settings != undefined && appContext._reason != undefined) { + var appInstanceId = appContext._id; + + var touchEnabled = false; + + var commerceAllowed = true; + var minorVersion = 0; + if (appContext._minorVersion != undefined) { + minorVersion = appContext._minorVersion; + } + var requirementMatrix = undefined; + if (appContext._requirementMatrix != undefined) { + requirementMatrix = appContext._requirementMatrix; + } + var returnedContext = new OSF.OfficeAppContext(appContext._id, appContext._appName, appContext._appVersion, appContext._appUILocale, appContext._dataLocale, appContext._docUrl, appContext._clientMode, settings, appContext._reason, appContext._osfControlType, appContext._eToken, appContext._correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + } else { + var errorMsg = "Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is " + errorCode + ", exception: " + appContext; + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException(errorMsg); + } + throw errorMsg; + } + }; + try { + this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync", getInvocationCallbackWebApp, this._webAppState.id); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:[" + ex + "]"); + } + throw ex; + } +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { + try { + var me = this; + var xdmInfoValue = OSF.OUtil.parseXdmInfoWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + if (xdmInfoValue) { + var xdmItems = OSF.OUtil.getInfoItems(xdmInfoValue); + if (xdmItems != undefined && xdmItems.length >= 3) { + me._webAppState.conversationID = xdmItems[0]; + me._webAppState.id = xdmItems[1]; + me._webAppState.webAppUrl = xdmItems[2]; + } + } + me._webAppState.serializerVersion = OSF.OUtil.parseSerializerVersionWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + me._webAppState.clientEndPoint = Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID, me._webAppState.wnd, me._webAppState.webAppUrl, me._webAppState.serializerVersion); + me._webAppState.serviceEndPoint = Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id); + var notificationConversationId = me._webAppState.conversationID + OSF.SharedConstants.NotificationConversationIdSuffix; + me._webAppState.serviceEndPoint.registerConversation(notificationConversationId, me._webAppState.webAppUrl); + var focusFirstItem = function OSF_OfficeAppFactory_initialize$focusFirstItem() { + if (!me._webAppState.focused) { + me._webAppState.focused = true; + var list = document.querySelectorAll('input,a,button'); + for (var i = 0; i < list.length; i++) { + var node = list[i]; + if (node instanceof HTMLElement) { + var element = node; + element.focus(); + break; + } + } + } + }; + var notifyAgave = function OSF__OfficeAppFactory_initialize$notifyAgave(actionId) { + switch (actionId) { + case OSF.AgaveHostAction.Select: + me._webAppState.focused = true; + break; + case OSF.AgaveHostAction.UnSelect: + me._webAppState.focused = false; + break; + case OSF.AgaveHostAction.CtrlF6In: + focusFirstItem(); + default: + OsfMsAjaxFactory.msAjaxDebug.trace("actionId " + actionId + " notifyAgave is wrong."); + break; + } + }; + me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave", notifyAgave, Microsoft.Office.Common.InvokeType.async, false); + OSF.OUtil.addEventListener(window, "focus", function () { + if (!me._webAppState.focused) { + me._webAppState.focused = true; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.Select]); + }); + OSF.OUtil.addEventListener(window, "blur", function () { + if (me._webAppState.focused) { + me._webAppState.focused = false; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.UnSelect]); + }); + + OSF.OUtil.addEventListener(window, "keydown", function (e) { + if (e.keyCode == 117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + var actionId = OSF.AgaveHostAction.CtrlF6Exit; + if (e.shiftKey) { + actionId = OSF.AgaveHostAction.CtrlF6ExitShift; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, actionId]); + } + }); + + OSF.OUtil.addEventListener(window, "keypress", function (e) { + if (e.keyCode == 117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + } + }); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:[" + ex + "]"); + } + throw ex; + } +}; +OSF.getClientEndPoint = function OSF$getClientEndPoint() { + var initializationHelper = OSF._OfficeAppFactory.getInitializationHelper(); + return initializationHelper._webAppState.clientEndPoint; +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); +OSF.DDA.WAC.SettingsTranslator = (function () { + var keyIndex = 0; + var valueIndex = 1; + return { + read: function OSF_DDA_WAC_SettingsTranslator$read(payload) { + if (payload.Settings) { + var serializedSettings = {}; + var settingsPayload = payload.Settings; + for (var index in settingsPayload) { + var setting = settingsPayload[index]; + serializedSettings[setting[keyIndex]] = setting[valueIndex]; + } + return serializedSettings; + } else if (typeof window["OSFPPTWAC"] != "undefined") { + return payload; + } else { + var serializedSettings = {}; + return serializedSettings; + } + }, + write: function OSF_DDA_WAC_SettingsTranslator$write(serializedSettings) { + var settingsPayload = []; + for (var key in serializedSettings) { + var setting = []; + setting[keyIndex] = key; + setting[valueIndex] = serializedSettings[key]; + settingsPayload.push(setting); + } + return settingsPayload; + } + }; +})(); +OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings, { + toHost: OSF.DDA.WAC.SettingsTranslator.write, + fromHost: OSF.DDA.WAC.SettingsTranslator.read +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SettingsRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: "OverwriteIfStale" }, + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ], + invertible: true +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SettingsRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); + +Microsoft.Office.WebExtension.BindingType = { + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties = { + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise = function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id = bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t = typeof onError; + if (t != "undefined" && t != "function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback = onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype = { + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me = this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status == Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade = function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches = []; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding = function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding = function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et = Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches = docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id] = new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch = bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId = function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_" + OSF.OUtil.getUniqueId() + "_" + new Date().getTime(); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding = function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id = bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows = bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols = bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders = bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding = new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding = new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp = function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject = OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject = OSF.DDA.TableBinding; + } + binding = new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding = new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id = callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties = { + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding = function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.GetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: "ValueFormat" }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: "FilterType" }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" }, + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" } + ] +}); +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.BindingRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: "ItemName" }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: "BindingType" }, + { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: "PromptText" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.SampleData, value: "SampleData" }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: "FailOnCollision" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 2 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 3 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 1 } + ], + invertible: true +}); +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: "Name" }, + { name: OSF.DDA.BindingProperties.Type, value: "BindingType" }, + { name: OSF.DDA.BindingProperties.RowCount, value: "RowCount" }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: "ColCount" }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: "HasHeaders" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddRowsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddColumnsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.Subset, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" }, + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.PromptText, + value: { + "types": ["string"], + "calculate": function () { + return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.SampleData, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: function (bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs = function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + BindingSelectionChanged: "bindingSelectionChanged", + BindingDataChanged: "bindingDataChanged" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" }); +OSF.DDA.BindingSelectionChangedEventArgs = function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged + }, + "binding": { + value: bindingInstance + } + }); + for (var prop in subset) { + OSF.OUtil.defineEnumerableProperty(this, prop, { + value: subset[prop] + }); + } +}; +OSF.DDA.BindingDataChangedEventArgs = function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingDataChanged + }, + "binding": { + value: bindingInstance + } + }); +}; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.BindingSelectionChangedEvent); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: OSF.DDA.PropertyDescriptors.Subset } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" }); + +Microsoft.Office.WebExtension.Table = { + ThisRow: "thisRow" +}; + +OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(Microsoft.Office.WebExtension.Parameters.Data, (function () { + var tableRows = "Rows"; + var tableHeaders = "Headers"; + return { + toHost: function OSF_DDA_ACC_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data != "string" && data[OSF.DDA.TableDataProperties.TableRows] !== undefined) { + var tableData = {}; + tableData[tableRows] = data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders] = data[OSF.DDA.TableDataProperties.TableHeaders]; + data = tableData; + } else if (OSF.DDA.DataCoercion.determineCoercionType(data) == Microsoft.Office.WebExtension.CoercionType.Text) { + data = [[data]]; + } + return data; + }, + fromHost: function OSF_DDA_ACC_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs[tableRows] != undefined) { + ret = {}; + ret[OSF.DDA.TableDataProperties.TableRows] = hostArgs[tableRows]; + ret[OSF.DDA.TableDataProperties.TableHeaders] = hostArgs[tableHeaders]; + } else { + ret = hostArgs; + } + return ret; + } + }; +})()); + +OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(Microsoft.Office.WebExtension.Parameters.SampleData, OSF.DDA.WAC.Delegate.ParameterMap.getDynamicType(Microsoft.Office.WebExtension.Parameters.Data)); +OSF.DDA.AccessDocument = function Microsoft_Office_WebExtension_AccessDocument(officeAppContext, settings) { + var bf = new OSF.DDA.BindingFacade(this); + OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]); + OSF.DDA.AccessDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bf) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bf; + } + }); + } + if (this.mode == OSF.ClientMode.ReadOnly) { + this.url = document.URL; + } + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.AccessDocument, OSF.DDA.Document); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.AccessDocument(appContext, this._initializeSettings(appContext, true)); + appReady(); +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + OSF.WebApp._UpdateLinksForHostAndXdmInfo(); + var license = new OSF.DDA.License(appContext.get_eToken()); + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license)); + var reason = appContext.get_reason(); + var getDelegateMethods = OSF.DDA.WAC.getDelegateMethods; + var parameterMap = OSF.DDA.WAC.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); + Microsoft.Office.WebExtension.initialize(reason); +}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/access-web-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/access-web-16.00.js new file mode 100644 index 000000000..dfefc028e --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/access-web-16.00.js @@ -0,0 +1,11 @@ +/* Access web application specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b=1)return true;b=a.deserialize;a.deserialize=function(a){return i(a,true,b)};a.__patchVersion=1;return true}!c()&&k(a,"load",function(){c()})})(window);Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5};Microsoft.Office.Common.InvokeResultCode={noError:0,errorInRequest:-1,errorHandlingRequest:-2,errorInResponse:-3,errorHandlingResponse:-4,errorHandlingRequestAccessDenied:-5,errorHandlingMethodCallTimedout:-6};Microsoft.Office.Common.MessageType={request:0,response:1};Microsoft.Office.Common.ActionType={invoke:0,registerEvent:1,unregisterEvent:2};Microsoft.Office.Common.ResponseType={forCalling:0,forEventing:1};Microsoft.Office.Common.MethodObject=function(c,b,a){this._method=c;this._invokeType=b;this._blockingOthers=a};Microsoft.Office.Common.MethodObject.prototype={getMethod:function(){return this._method},getInvokeType:function(){return this._invokeType},getBlockingFlag:function(){return this._blockingOthers}};Microsoft.Office.Common.EventMethodObject=function(b,a){this._registerMethodObject=b;this._unregisterMethodObject=a};Microsoft.Office.Common.EventMethodObject.prototype={getRegisterMethodObject:function(){return this._registerMethodObject},getUnregisterMethodObject:function(){return this._unregisterMethodObject}};Microsoft.Office.Common.ServiceEndPoint=function(c){var a=this,b=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:false}]);if(b)throw b;a._methodObjectList={};a._eventHandlerProxyList={};a._Id=c;a._conversations={};a._policyManager=null;a._appDomains={}};Microsoft.Office.Common.ServiceEndPoint.prototype={registerMethod:function(g,h,b,e){var c="invokeType",a=false,d=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:a},{name:"method",type:Function,mayBeNull:a},{name:c,type:Number,mayBeNull:a},{name:"blockingOthers",type:Boolean,mayBeNull:a}]);if(d)throw d;if(b!==Microsoft.Office.Common.InvokeType.async&&b!==Microsoft.Office.Common.InvokeType.sync)throw OsfMsAjaxFactory.msAjaxError.argument(c);var f=new Microsoft.Office.Common.MethodObject(h,b,e);this._methodObjectList[g]=f},unregisterMethod:function(b){var a=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:false}]);if(a)throw a;delete this._methodObjectList[b]},registerEvent:function(f,d,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a}]);if(b)throw b;var e=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(d,Microsoft.Office.Common.InvokeType.syncRegisterEvent,a),new Microsoft.Office.Common.MethodObject(c,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,a));this._methodObjectList[f]=e},registerEventEx:function(h,f,d,e,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"registerMethodInvokeType",type:Number,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a},{name:"unregisterMethodInvokeType",type:Number,mayBeNull:a}]);if(b)throw b;var g=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(f,d,a),new Microsoft.Office.Common.MethodObject(e,c,a));this._methodObjectList[h]=g},unregisterEvent:function(b){var a=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:false}]);if(a)throw a;this.unregisterMethod(b)},registerConversation:function(c,g,b,f){var d="appDomains",a=true,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false},{name:"conversationUrl",type:String,mayBeNull:false,optional:a},{name:d,type:Object,mayBeNull:a,optional:a},{name:"serializerVersion",type:Number,mayBeNull:a,optional:a}]);if(e)throw e;if(b){if(!(b instanceof Array))throw OsfMsAjaxFactory.msAjaxError.argument(d);this._appDomains[c]=b}this._conversations[c]={url:g,serializerVersion:f}},unregisterConversation:function(b){var a=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false}]);if(a)throw a;delete this._conversations[b]},setPolicyManager:function(a){var b="policyManager",c=Function._validateParams(arguments,[{name:b,type:Object,mayBeNull:false}]);if(c)throw c;if(!a.checkPermission)throw OsfMsAjaxFactory.msAjaxError.argument(b);this._policyManager=a},getPolicyManager:function(){return this._policyManager}};Microsoft.Office.Common.ClientEndPoint=function(f,c,g,b){var d="targetWindow",a=this,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false},{name:d,mayBeNull:false},{name:"targetUrl",type:String,mayBeNull:false},{name:"serializerVersion",type:Number,mayBeNull:true,optional:true}]);if(e)throw e;if(!c.postMessage)throw OsfMsAjaxFactory.msAjaxError.argument(d);a._conversationId=f;a._targetWindow=c;a._targetUrl=g;a._callingIndex=0;a._callbackList={};a._eventHandlerList={};if(b!=null)a._serializerVersion=b;else a._serializerVersion=OSF.SerializerVersion.MsAjax};Microsoft.Office.Common.ClientEndPoint.prototype={invoke:function(h,d,b){var a=this,g=Function._validateParams(arguments,[{name:"targetMethodName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"param",mayBeNull:true}]);if(g)throw g;var c=a._callingIndex++,k=new Date,e={callback:d,createdOn:k.getTime()};if(b&&typeof b==="object"&&typeof b.__timeout__==="number"){e.timeout=b.__timeout__;delete b.__timeout__}a._callbackList[c]=e;try{var i=new Microsoft.Office.Common.Request(h,Microsoft.Office.Common.ActionType.invoke,a._conversationId,c,b),j=Microsoft.Office.Common.MessagePackager.envelope(i,a._serializerVersion);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(f){try{d!==null&&d(Microsoft.Office.Common.InvokeResultCode.errorInRequest,f)}finally{delete a._callbackList[c]}}},registerForEvent:function(d,g,c,i){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"eventHandler",type:Function,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,k=new Date;a._callbackList[b]={callback:c,createdOn:k.getTime()};try{var h=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.registerEvent,a._conversationId,b,i),j=Microsoft.Office.Common.MessagePackager.envelope(h,a._serializerVersion);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();a._eventHandlerList[d]=g}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}},unregisterForEvent:function(d,c,h){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,j=new Date;a._callbackList[b]={callback:c,createdOn:j.getTime()};try{var g=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.unregisterEvent,a._conversationId,b,h),i=Microsoft.Office.Common.MessagePackager.envelope(g,a._serializerVersion);a._targetWindow.postMessage(i,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}finally{delete a._eventHandlerList[d]}}};Microsoft.Office.Common.XdmCommunicationManager=function(){var d=true,k="channel is not ready.",c="conversationId",j="Unknown conversation Id.",b=false,a=null,m=[],l=a,f=a,o=10,i=b,g=a,v=2e3,n=65000,q=n,h={},e={},s=b;function x(b){for(var a in h)if(h[a]._conversations[b])return h[a];OsfMsAjaxFactory.msAjaxDebug.trace(j);throw OsfMsAjaxFactory.msAjaxError.argument(c)}function y(b){var a=e[b];if(!a){OsfMsAjaxFactory.msAjaxDebug.trace(j);throw OsfMsAjaxFactory.msAjaxError.argument(c)}return a}function B(e,c){var b=e._methodObjectList[c._actionName];if(!b){OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+c._actionName);throw OsfMsAjaxFactory.msAjaxError.argument("messageObject")}var d=a;if(c._actionType===Microsoft.Office.Common.ActionType.invoke)d=b;else if(c._actionType===Microsoft.Office.Common.ActionType.registerEvent)d=b.getRegisterMethodObject();else d=b.getUnregisterMethodObject();return d}function E(a){m.push(a)}function D(){if(f!==a){if(!i)if(m.length>0){var b=m.shift();p(b)}else{clearInterval(f);f=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(k)}function p(a){i=a.getInvokeBlockingFlag();a.invoke();l=(new Date).getTime()}function A(){if(g){var c,f=0,j=new Date,d;for(var i in e){c=e[i];for(var h in c._callbackList){var b=c._callbackList[h];d=b.timeout?b.timeout:q;if(d>=0&&Math.abs(j.getTime()-b.createdOn)>=d)try{b.callback&&b.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,a)}finally{delete c._callbackList[h]}else f++}}if(f===0){clearInterval(g);g=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(k)}function z(){i=b}function C(a){if(window.addEventListener)window.addEventListener("message",a,b);else if(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent)window.attachEvent("onmessage",a);else{OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API.");throw OsfMsAjaxFactory.msAjaxError.argument("Browser")}}function r(e,f){var g=b;if(e===d)return d;if(!e||!f||!e.length||!f.length)return g;var c,a;c=document.createElement("a");a=document.createElement("a");c.href=e;a.href=f;g=u(c,a);delete c,a;return g}function w(a,g){var c=b;if(!g||!g.length||!a||!(a instanceof Array)||!a.length)return c;var f=document.createElement("a"),e=document.createElement("a");f.href=g;for(var d=0;do)&&!i){p(F);A=b}else f=setInterval(D,o);A&&E(F)}catch(k){var C=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;if(k==m)C=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied;var I=new Microsoft.Office.Common.Response(c._actionName,c._conversationId,c._correlationId,C,Microsoft.Office.Common.ResponseType.forCalling,k),H=Microsoft.Office.Common.MessagePackager.envelope(I,g);e.source&&e.source.postMessage&&e.source.postMessage(H,v)}}else if(c._messageType===Microsoft.Office.Common.MessageType.response){var j=y(c._conversationId);j._serializerVersion=g;if(!r(j._targetUrl,e.origin))throw"Failed orgin check";if(c._responseType===Microsoft.Office.Common.ResponseType.forCalling){var n=j._callbackList[c._correlationId];if(n)try{n.callback&&n.callback(c._errorCode,c._data)}finally{delete j._callbackList[c._correlationId]}}else{var s=j._eventHandlerList[c._actionName];s!==undefined&&s!==a&&s(c._data)}}else return}}function t(){if(!s){C(F);s=d}}return {connect:function(b,d,f,c){var a=e[b];if(!a){t();a=new Microsoft.Office.Common.ClientEndPoint(b,d,f,c);e[b]=a}return a},getClientEndPoint:function(d){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;return e[d]},createServiceEndPoint:function(a){t();var b=new Microsoft.Office.Common.ServiceEndPoint(a);h[a]=b;return b},getServiceEndPoint:function(c){var a=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:b}]);if(a)throw a;return h[c]},deleteClientEndPoint:function(d){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;delete e[d]},_setMethodTimeout:function(a){var c=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:b}]);if(c)throw c;q=a<=0?n:a},_startMethodTimeoutTimer:function(){if(!g)g=setInterval(A,v)}}}();Microsoft.Office.Common.Message=function(g,h,e,f,c){var b=false,a=this,d=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:b},{name:"actionName",type:String,mayBeNull:b},{name:"conversationId",type:String,mayBeNull:b},{name:"correlationId",mayBeNull:b},{name:"data",mayBeNull:true,optional:true}]);if(d)throw d;a._messageType=g;a._actionName=h;a._conversationId=e;a._correlationId=f;a._origin=window.location.href;if(typeof c=="undefined")a._data=null;else a._data=c};Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}};Microsoft.Office.Common.Request=function(c,d,a,b,e){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,c,a,b,e);this._actionType=d};OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message);Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType};Microsoft.Office.Common.Response=function(d,a,b,e,c,f){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,d,a,b,f);this._errorCode=e;this._responseType=c};OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message);Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode};Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType};Microsoft.Office.Common.MessagePackager={envelope:function(a,b){if(b==OSF.SerializerVersion.Browser&&typeof JSON!=="undefined"){if(typeof a==="object")a._serializerVersion=b;return JSON.stringify(a)}else{if(typeof a==="object")a._serializerVersion=OSF.SerializerVersion.MsAjax;return OsfMsAjaxFactory.msAjaxSerializer.serialize(a)}},unenvelope:function(a,b){if(b==OSF.SerializerVersion.Browser&&typeof JSON!=="undefined")return JSON.parse(a);else return OsfMsAjaxFactory.msAjaxSerializer.deserialize(a,true)}};Microsoft.Office.Common.ResponseSender=function(f,i,k,g,h,j,e){var c=false,a=this,d=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:c},{name:"requesterUrl",type:String,mayBeNull:c},{name:"actionName",type:String,mayBeNull:c},{name:"conversationId",type:String,mayBeNull:c},{name:"correlationId",mayBeNull:c},{name:"responsetype",type:Number,maybeNull:c},{name:"serializerVersion",type:Number,maybeNull:true,optional:true}]);if(d)throw d;a._requesterWindow=f;a._requesterUrl=i;a._actionName=k;a._conversationId=g;a._correlationId=h;a._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;a._responseType=j;var b=a;a._send=function(f){try{var d=new Microsoft.Office.Common.Response(b._actionName,b._conversationId,b._correlationId,b._invokeResultCode,b._responseType,f),c=Microsoft.Office.Common.MessagePackager.envelope(d,e);b._requesterWindow.postMessage(c,b._requesterUrl)}catch(a){OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+a.message)}}};Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(a){this._invokeResultCode=a}};Microsoft.Office.Common.InvokeCompleteCallback=function(e,h,i,f,g,d,c){var b=this;Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(b,e,h,i,f,g,Microsoft.Office.Common.ResponseType.forCalling,c);b._postCallbackHandler=d;var a=b;b._send=function(f){try{var e=new Microsoft.Office.Common.Response(a._actionName,a._conversationId,a._correlationId,a._invokeResultCode,a._responseType,f),d=Microsoft.Office.Common.MessagePackager.envelope(e,c);a._requesterWindow.postMessage(d,a._requesterUrl);a._postCallbackHandler()}catch(b){OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+b.message)}}};OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender);Microsoft.Office.Common.Invoker=function(i,j,e,f,h,k,g){var c=true,b=false,a=this,d=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:b},{name:"paramValue",mayBeNull:c},{name:"invokeCompleteCallback",mayBeNull:b},{name:"eventHandlerProxyList",mayBeNull:c},{name:"conversationId",type:String,mayBeNull:b},{name:"eventName",type:String,mayBeNull:b},{name:"serializerVersion",type:Number,mayBeNull:c,optional:c}]);if(d)throw d;a._methodObject=i;a._param=j;a._invokeCompleteCallback=e;a._eventHandlerProxyList=f;a._conversationId=h;a._eventName=k;a._serializerVersion=g};Microsoft.Office.Common.Invoker.prototype={invoke:function(){var a=this;try{var b;switch(a._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:a._methodObject.getMethod()(a._param,a._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:b=a._methodObject.getMethod()(a._param);a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent:var d=a._createEventHandlerProxyObject(a._invokeCompleteCallback);b=a._methodObject.getMethod()(d.getSend(),a._param);a._eventHandlerProxyList[a._conversationId+a._eventName]=d.getSend();a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:var g=a._eventHandlerProxyList[a._conversationId+a._eventName];b=a._methodObject.getMethod()(g,a._param);delete a._eventHandlerProxyList[a._conversationId+a._eventName];a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:var c=a._createEventHandlerProxyObject(a._invokeCompleteCallback);a._methodObject.getMethod()(c.getSend(),a._invokeCompleteCallback.getSend(),a._param);a._eventHandlerProxyList[a._callerId+a._eventName]=c.getSend();break;case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:var f=a._eventHandlerProxyList[a._callerId+a._eventName];a._methodObject.getMethod()(f,a._invokeCompleteCallback.getSend(),a._param);delete a._eventHandlerProxyList[a._callerId+a._eventName]}}catch(e){a._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);a._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(a){return new Microsoft.Office.Common.ResponseSender(a.getRequesterWindow(),a.getRequesterUrl(),a.getActionName(),a.getConversationId(),a.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing,this._serializerVersion)}};OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"};OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var a=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource],b={};OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,a,b)};OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]);OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.getDelegateMethods=function(){var a={};a[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync;a[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync;a[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync;return a};OSF.DDA.WAC.Delegate.version=1;OSF.DDA.WAC.Delegate.executeAsync=function(a){if(!a.hostCallArgs)a.hostCallArgs={};a.hostCallArgs["DdaMethod"]={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:a.dispId};a.hostCallArgs["__timeout__"]=-1;a.onCalling&&a.onCalling();var b=(new Date).getTime();OSF.getClientEndPoint().invoke("executeMethod",function(e,d){a.onReceiving&&a.onReceiving();var c;if(e==Microsoft.Office.Common.InvokeResultCode.noError){OSF.DDA.WAC.Delegate.version=d["Version"];c=d["Error"]}else switch(e){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:c=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:c=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}a.onComplete&&a.onComplete(c,d);OSF.AppTelemetry&&OSF.AppTelemetry.onMethodDone(a.dispId,null,Math.abs((new Date).getTime()-b),c)},a.hostCallArgs)};OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(c,a){var b=(new Date).getTime();return function(f,e){a.onReceiving&&a.onReceiving();var d;if(f!=Microsoft.Office.Common.InvokeResultCode.noError)switch(f){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:d=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:d=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else if(e)if(e["Error"])d=e["Error"];else d=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;else d=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;a.onComplete&&a.onComplete(d);OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(c,a.dispId,Math.abs((new Date).getTime()-b),d)}};OSF.DDA.WAC.Delegate.registerEventAsync=function(a){a.onCalling&&a.onCalling();OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(a.targetId,a.eventType),function(b){a.onEvent&&a.onEvent(b);OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(a.dispId)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true,a),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:a.dispId,targetId:a.targetId})};OSF.DDA.WAC.Delegate.unregisterEventAsync=function(a){a.onCalling&&a.onCalling();OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(a.targetId,a.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false,a),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:a.dispId,targetId:a.targetId})};OSF.OUtil.setNamespace("WebApp",OSF);OSF.WebApp.AddHostInfoAndXdmInfo=function(a){if(OSF._OfficeAppFactory.getWindowLocationSearch&&OSF._OfficeAppFactory.getWindowLocationHash)return a+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash();else return a};OSF.WebApp._UpdateLinksForHostAndXdmInfo=function(){for(var b=document.querySelectorAll("a[data-officejs-navigate]"),a=0;a0?a.substr(0,d):null,c=b!==null?b.toLowerCase()==="http"||b.toLowerCase()==="https":true;c=c&&a!="#"&&a!="/"&&a!=""&&a!=OSF._OfficeAppFactory.getWebAppState().webAppUrl;return c};OSF.InitializationHelper=function(e,b,g,f,c){var a=this;a._hostInfo=e;a._webAppState=b;a._context=g;a._settings=f;a._hostFacade=c;a._initializeSettings=function(h,g){var c="undefined",e,b=h.get_settings(),d=OSF.OUtil.getSessionStorage();if(d){var a=d.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());if(a)b=typeof JSON!==c?JSON.parse(a):OsfMsAjaxFactory.msAjaxSerializer.deserialize(a,true);else{a=typeof JSON!==c?JSON.stringify(b):OsfMsAjaxFactory.msAjaxSerializer.serialize(b);d.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),a)}}var f=OSF.DDA.SettingsManager.deserializeSettings(b);if(g)e=new OSF.DDA.RefreshableSettings(f);else e=new OSF.DDA.Settings(f);return e};var d=function(a){var b=window.open;a.open=function(e,d,c){var a=null;try{a=b(e,d,c)}catch(f){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+f)}if(!a){var g={strUrl:e,strWindowName:d,strWindowFeatures:c};OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,g)}return a}};d(window)};OSF.InitializationHelper.prototype.getAppContext=function(d,c){var b=function(h,a){var b;if(a._appName===OSF.AppName.ExcelWebApp){var d=a._settings;b={};for(var n in d){var j=d[n];b[j[0]]=j[1]}}else b=a._settings;if(h===0&&a._id!=undefined&&a._appName!=undefined&&a._appVersion!=undefined&&a._appUILocale!=undefined&&a._dataLocale!=undefined&&a._docUrl!=undefined&&a._clientMode!=undefined&&a._settings!=undefined&&a._reason!=undefined){var l=a._id,m=false,k=true,g=0;if(a._minorVersion!=undefined)g=a._minorVersion;var e=undefined;if(a._requirementMatrix!=undefined)e=a._requirementMatrix;var f=new OSF.OfficeAppContext(a._id,a._appName,a._appVersion,a._appUILocale,a._dataLocale,a._docUrl,a._clientMode,b,a._reason,a._osfControlType,a._eToken,a._correlationId,l,m,k,g,e);OSF.AppTelemetry&&OSF.AppTelemetry.initialize(f);c(f)}else{var i="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+h+", exception: "+a;OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(i);throw i}};try{this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",b,this._webAppState.id)}catch(a){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+a+"]");throw a}};OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){var c="ContextActivationManager_notifyHost",b=false;try{var a=this,f=OSF.OUtil.parseXdmInfoWithGivenFragment(b,OSF._OfficeAppFactory.getWindowLocationHash());if(f){var d=OSF.OUtil.getInfoItems(f);if(d!=undefined&&d.length>=3){a._webAppState.conversationID=d[0];a._webAppState.id=d[1];a._webAppState.webAppUrl=d[2]}}a._webAppState.serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(b,OSF._OfficeAppFactory.getWindowLocationHash());a._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(a._webAppState.conversationID,a._webAppState.wnd,a._webAppState.webAppUrl,a._webAppState.serializerVersion);a._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(a._webAppState.id);var g=a._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;a._webAppState.serviceEndPoint.registerConversation(g,a._webAppState.webAppUrl);var h=function(){if(!a._webAppState.focused){a._webAppState.focused=true;for(var c=document.querySelectorAll("input,a,button"),b=0;b40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(a){this._eventHandlers={};for(var c in a){var b=a[c];this._eventHandlers[b]=[]}};OSF.EventDispatch.prototype={getSupportedEvents:function(){var a=[];for(var b in this._eventHandlers)a.push(b);return a},supportsEvent:function(c){var a=false;for(var b in this._eventHandlers)if(c==b){a=true;break}return a},hasEventHandler:function(b,c){var a=this._eventHandlers[b];if(a&&a.length>0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.WAC.SettingsTranslator=function(){var b=0,a=1;return {read:function(d){if(d.Settings){var c={},e=d.Settings;for(var g in e){var f=e[g];c[f[b]]=f[a]}return c}else if(typeof window["OSFPPTWAC"]!="undefined")return d;else{var c={};return c}},write:function(d){var e=[];for(var f in d){var c=[];c[b]=f;c[a]=d[f];e.push(c)}return e}}}();OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings,{toHost:OSF.DDA.WAC.SettingsTranslator.write,fromHost:OSF.DDA.WAC.SettingsTranslator.read});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SettingsRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:"OverwriteIfStale"},{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}],invertible:true});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SettingsRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType};OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.BindingPromise=function(b,a){this._id=b;OSF.OUtil.defineEnumerableProperty(this,"onFail",{"get":function(){return a},"set":function(c){var b=typeof c;if(b!="undefined"&&b!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,b);a=c}})};OSF.DDA.BindingPromise.prototype={_fetch:function(b){var a=this;if(a.binding)b&&b(a.binding);else if(!a._binding){var c=a;Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(a._id,function(a){if(a.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded){OSF.OUtil.defineEnumerableProperty(c,"binding",{value:a.value});b&&b(c.binding)}else c.onFail&&c.onFail(a)})}return a},getDataAsync:function(){var a=arguments;this._fetch(function(b){b.getDataAsync.apply(b,a)});return this},setDataAsync:function(){var a=arguments;this._fetch(function(b){b.setDataAsync.apply(b,a)});return this},addHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.addHandlerAsync.apply(b,a)});return this},removeHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.removeHandlerAsync.apply(b,a)});return this}};OSF.DDA.BindingFacade=function(b){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:b});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddFromSelectionAsync,a.AddFromNamedItemAsync,a.GetAllAsync,a.GetByIdAsync,a.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{document:{value:a},id:{value:b}})};OSF.DDA.Binding=function(a,c){OSF.OUtil.defineEnumerableProperties(this,{document:{value:c},id:{value:a}});var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDataAsync,d.SetDataAsync]);var e=Microsoft.Office.WebExtension.EventType,b=c.bindings._eventDispatches;if(!b[a])b[a]=new OSF.EventDispatch([e.BindingSelectionChanged,e.BindingDataChanged]);var f=b[a];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.generateBindingId=function(){return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureBinding=function(a,c){var d=a[OSF.DDA.BindingProperties.Id],g=a[OSF.DDA.BindingProperties.RowCount],f=a[OSF.DDA.BindingProperties.ColumnCount],h=a[OSF.DDA.BindingProperties.HasHeaders],b;switch(a[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:b=new OSF.DDA.TextBinding(d,c);break;case Microsoft.Office.WebExtension.BindingType.Matrix:b=new OSF.DDA.MatrixBinding(d,c,g,f);break;case Microsoft.Office.WebExtension.BindingType.Table:var i=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument},e;if(i()&&OSF.DDA.ExcelTableBinding)e=OSF.DDA.ExcelTableBinding;else e=OSF.DDA.TableBinding;b=new e(d,c,g,f,h);break;default:b=new OSF.DDA.UnknownBinding(d,c)}return b};OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"});(function(){var d="number",c="object",b="string",a=null;function e(a){return OSF.DDA.OMFactory.manufactureBinding(a,Microsoft.Office.WebExtension.context.document)}function f(a){return a.id}function g(c,e,d){var b=c[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&b&&(b[OSF.DDA.TableDataProperties.TableRows]!=undefined||b[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))b=OSF.DDA.OMFactory.manufactureTableData(b);b=OSF.DDA.DataCoercion.coerceData(b,d[Microsoft.Office.WebExtension.Parameters.CoercionType]);return b==undefined?a:b}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return true}}],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.BindingList],e)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(d,b,a){var c=a[Microsoft.Office.WebExtension.Parameters.Id];delete b._eventDispatches[c]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(b,a){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(a.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&a[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&a[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn];delete a[Microsoft.Office.WebExtension.Parameters.RowCount];delete a[Microsoft.Office.WebExtension.Parameters.ColumnCount]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]||a[Microsoft.Office.WebExtension.Parameters.RowCount]||a[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}],onSucceeded:g});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[b,c,d,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}]})})();OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{TableDataProperties:"TableDataProperties"});OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.DDA.TableBinding=function(f,e,d,c,b){OSF.DDA.TableBinding.uber.constructor.call(this,f,e);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:d?d:0},columnCount:{value:c?c:0},hasHeaders:{value:b?b:false}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddRowsAsync,a.AddColumnsAsync,a.DeleteAllDataValuesAsync])};OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddRowsAsync:"addRowsAsync",AddColumnsAsync:"addColumnsAsync",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync"});(function(){function a(a){return a.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]})})();OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.GetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:"ValueFormat"},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:"FilterType"},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"}]});OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.BindingRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:"ItemName"},{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:"BindingType"},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:"PromptText"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:"SampleData"},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:"FailOnCollision"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:2},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:3},{name:Microsoft.Office.WebExtension.BindingType.Table,value:1}],invertible:true});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:"Name"},{name:OSF.DDA.BindingProperties.Type,value:"BindingType"},{name:OSF.DDA.BindingProperties.RowCount,value:"RowCount"},{name:OSF.DDA.BindingProperties.ColumnCount,value:"ColCount"},{name:OSF.DDA.BindingProperties.HasHeaders,value:"HasHeaders"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]});OSF.DDA.AsyncMethodNames.addNames({AddFromPromptAsync:"addFromPromptAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromPromptAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:{types:["string"],calculate:function(){return Strings.OfficeOM.L_AddBindingFromPromptDefaultText}}},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:function(a){return OSF.DDA.OMFactory.manufactureBinding(a,Microsoft.Office.WebExtension.context.document)}});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"});OSF.DDA.DocumentSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:a}})};OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{BindingSelectionChangedEvent:"BindingSelectionChangedEvent"});OSF.DDA.BindingSelectionChangedEventArgs=function(c,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:c}});for(var b in a)OSF.OUtil.defineEnumerableProperty(this,b,{value:a[b]})};OSF.DDA.BindingDataChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:a}})};OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.BindingSelectionChangedEvent);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.WAC.UniqueArguments.BindingEventSource},{name:OSF.DDA.PropertyDescriptors.Subset,value:OSF.DDA.PropertyDescriptors.Subset}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.WAC.UniqueArguments.BindingEventSource}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType,{OnlyVisible:"onlyVisible"});Microsoft.Office.WebExtension.Table={ThisRow:"thisRow"};OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(Microsoft.Office.WebExtension.Parameters.Data,function(){var a="Rows",b="Headers";return {toHost:function(c){if(typeof c!="string"&&c[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d={};d[a]=c[OSF.DDA.TableDataProperties.TableRows];d[b]=c[OSF.DDA.TableDataProperties.TableHeaders];c=d}else if(OSF.DDA.DataCoercion.determineCoercionType(c)==Microsoft.Office.WebExtension.CoercionType.Text)c=[[c]];return c},fromHost:function(d){var c;if(d[a]!=undefined){c={};c[OSF.DDA.TableDataProperties.TableRows]=d[a];c[OSF.DDA.TableDataProperties.TableHeaders]=d[b]}else c=d;return c}}}());OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(Microsoft.Office.WebExtension.Parameters.SampleData,OSF.DDA.WAC.Delegate.ParameterMap.getDynamicType(Microsoft.Office.WebExtension.Parameters.Data));OSF.DDA.AccessDocument=function(c,d){var a=this,b=new OSF.DDA.BindingFacade(a);OSF.DDA.DispIdHost.addAsyncMethods(b,[OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);OSF.DDA.AccessDocument.uber.constructor.call(a,c,d);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});if(a.mode==OSF.ClientMode.ReadOnly)a.url=document.URL;OSF.OUtil.finalizeProperties(a)};OSF.OUtil.extend(OSF.DDA.AccessDocument,OSF.DDA.Document);OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(a,b){OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);a.doc=new OSF.DDA.AccessDocument(a,this._initializeSettings(a,true));b()};OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function(a){OSF.WebApp._UpdateLinksForHostAndXdmInfo();var d=new OSF.DDA.License(a.get_eToken());OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(a,a.doc,d));var e=a.get_reason(),b=OSF.DDA.WAC.getDelegateMethods,c=OSF.DDA.WAC.Delegate.ParameterMap;OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(b,c));Microsoft.Office.WebExtension.initialize(e)} \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/office_strings.debug.js new file mode 100644 index 000000000..3a8f5383c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "نوع الربط المحدد غير متوافق مع العنصر المسمى الموفر."; +Strings.OfficeOM.L_EventHandlerNotExist = "لم يتم العثور على معالج الأحداث المحدد لهذا الربط."; +Strings.OfficeOM.L_UnknownBindingType = "نوع الربط غير معتمد."; +Strings.OfficeOM.L_InvalidNode = "العقدة غير صالحة"; +Strings.OfficeOM.L_NotImplemented = "لم يتم تنفيذ الدالة {0}."; +Strings.OfficeOM.L_NoCapability = "لا تملك الأذونات الكافية لهذا الإجراء."; +Strings.OfficeOM.L_SettingsCannotSave = "تعذر حفظ الإعدادات."; +Strings.OfficeOM.L_DataWriteReminder = "تذكير بكتابة البيانات"; +Strings.OfficeOM.L_InvalidBinding = "الربط غير صالح"; +Strings.OfficeOM.L_InvalidSetColumns = "الأعمدة المحددة غير صالحة."; +Strings.OfficeOM.L_BindingCreationError = "خطأ في إنشاء الربط"; +Strings.OfficeOM.L_FormatValueOutOfRange = "إن القيمة خارج النطاق المسموح به."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "التحديد الحالي غير متوافق مع نوع الاندماج المحدد."; +Strings.OfficeOM.L_InvalidBindingError = "خطأ الربط غير صالح"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "قيم startRow أو startColumn المحددة غير صحيحة."; +Strings.OfficeOM.L_InvalidSetRows = "الصفوف المحددة غير صالحة."; +Strings.OfficeOM.L_NetworkProblem = "مشكلة في الشبكة"; +Strings.OfficeOM.L_CannotWriteToSelection = "لا يمكن الكتابة إلى التحديد الحالي."; +Strings.OfficeOM.L_MissingParameter = "معلمة مفقودة"; +Strings.OfficeOM.L_IndexOutOfRange = "الفهرس خارج النطاق."; +Strings.OfficeOM.L_SettingsStaleError = "خطأ في الإعدادات القديمة"; +Strings.OfficeOM.L_CannotNavigateTo = "إن الكائن موجود في موقع حيث التنقل غير معتمد."; +Strings.OfficeOM.L_ReadSettingsError = "خطأ في إعدادات القراءة"; +Strings.OfficeOM.L_InvalidGetColumns = "الأعمدة المحددة غير صالحة."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "نوع الاندماج المحدد غير معتمد."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "التطبيق {0} غير موجود. لم يتم استدعاء Microsoft.Office.WebExtension.initialize (السبب)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "فشلت عملية التعيين لأن كائن البيانات الذي تم توفيره سيكتب فوق البيانات أو سينقلها."; +Strings.OfficeOM.L_RowIndexOutOfRange = "إن قيمة فهرس الصف خارج النطاق المسموح به. استخدم قيمة (0 أو أعلى) تكون أصغر من عدد الصفوف."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "إن الصف المحدد فارغ."; +Strings.OfficeOM.L_ColIndexOutOfRange = "إن قيمة فهرس العمود خارج النطاق المسموح به. استخدم قيمة (0 أو أعلى) تكون أصغر من عدد الأعمدة."; +Strings.OfficeOM.L_UnsupportedEnumeration = "قائمة تعداد غير معتمدة"; +Strings.OfficeOM.L_InvalidParameters = "للدالة {0} معلمات غير صالحة."; +Strings.OfficeOM.L_SetDataParametersConflict = "تعارض المعلمات المحددة."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "استدعاء closeAsync على الملف الحالي قبل استرداد آخر."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "نوع كائن البيانات المحدد غير متوافق مع التحديد الحالي."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "قائمة التعداد غير معتمدة في تطبيق المضيف الحالي."; +Strings.OfficeOM.L_InvalidCoercion = "نوع الاندماج غير صالح"; +Strings.OfficeOM.L_NotSupportedEventType = "نوع الحدث المحدد {0} غير معتمد."; +Strings.OfficeOM.L_UnsupportedDataObject = "نوع كائن البيانات الذي تم توفيره غير معتمد."; +Strings.OfficeOM.L_GetDataIsTooLarge = "مجموعة البيانات المطلوبة كبيرة جداً."; +Strings.OfficeOM.L_AppNameNotExist = "لا يوجد اسم تطبيق لـ {0}."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "الرجاء إجراء تحديد."; +Strings.OfficeOM.L_MultipleNamedItemFound = "تم العثور على عدة كائنات بالاسم نفسه."; +Strings.OfficeOM.L_InvalidCellsValue = "تحتوي معلمة واحدة أو أكثر من معلمات الخلايا على قيم غير مسموح بها. تحقق من القيم مرة أخرى ثم أعد المحاولة."; +Strings.OfficeOM.L_DataNotMatchBindingType = "كائن البيانات المحدد غير متوافق مع نوع الربط."; +Strings.OfficeOM.L_InvalidFormatValue = "تحتوي معلمة واحدة أو أكثر من معلمات التنسيق على قيم غير مسموح بها. تحقق من القيم مرة أخرى ثم أعد المحاولة."; +Strings.OfficeOM.L_NotSupportedBindingType = "نوع الربط المحدد {0} غير معتمد."; +Strings.OfficeOM.L_InitializeNotReady = "لم يتم تحميل Office.js بشكل كامل بعد. يرجى إعادة المحاولة لاحقاً للتأكد من إضافة رمز التهيئة في وظيفة Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "تذكير بالتنسيق"; +Strings.OfficeOM.L_ShuttingDown = "فشلت العملية لأن البيانات غير حديثة على الخادم."; +Strings.OfficeOM.L_OperationNotSupported = "العملية غير معتمدة."; +Strings.OfficeOM.L_DocumentReadOnly = "العملية المطلوبة غير مسموح بها في وضع المستند الحالي."; +Strings.OfficeOM.L_NamedItemNotFound = "العنصر المسمى غير موجود."; +Strings.OfficeOM.L_InvalidApiCallInContext = "استدعاء API غير صالح في السياق الحالي."; +Strings.OfficeOM.L_InvalidGetRows = "الصفوف المحددة غير صالحة."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "ملاحظة: يُقترح أن تكون مجموعات التنسيق المعينة بواسطة استدعاء API الخاص بالتنسيق أقل من 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "انتظر حتى اكتمال المكالمة السابقة."; +Strings.OfficeOM.L_SetDataIsTooLarge = "كائن البيانات المحدد طويل جداً."; +Strings.OfficeOM.L_DataWriteError = "خطأ في كتابة البيانات"; +Strings.OfficeOM.L_InvalidBindingOperation = "عملية الربط غير صالحة"; +Strings.OfficeOM.L_APICallFailed = "فشل استدعاء API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "إن المعرف المحدد غير موجود."; +Strings.OfficeOM.L_FunctionCallFailed = "فشل استدعاء الدالة {0}، رمز الخطأ: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "لا يتطابق كائن البيانات الذي تم توفيره مع حجم التحديد الحالي."; +Strings.OfficeOM.L_SaveSettingsError = "خطأ في إعدادات الحفظ"; +Strings.OfficeOM.L_RequestTokenUnavailable = "تم إحباط API هذه لإبطاء تكرار المكالمة."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "قيم startRow أو startColumn المحددة غير صحيحة."; +Strings.OfficeOM.L_InvalidFormat = "خطأ تنسيق غير صالح"; +Strings.OfficeOM.L_BindingNotExist = "الربط المحدد غير موجود."; +Strings.OfficeOM.L_SettingNameNotExist = "اسم الإعداد المحدد غير موجود."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "فشل في إضافة معالج الحدث."; +Strings.OfficeOM.L_BrowserAPINotSupported = "لا يعتمد هذا المستعرض API المطلوبة."; +Strings.OfficeOM.L_InvalidAPICall = "استدعاء API غير صالح"; +Strings.OfficeOM.L_EventRegistrationError = "خطأ في تسجيل الأحداث"; +Strings.OfficeOM.L_ElementMissing = "تعذر علينا تنسيق خلية الجدول لأن بعض قيم المعلمات مفقودة. تحقق من المعلمات مرة أخرى ثم أعد المحاولة."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = 'لا يمكن استخدام معلمات الإحداثيات مع "جدول" بنوع الاندماج عندما يحتوي الجدول على خلايا مدمجة.'; +Strings.OfficeOM.L_NavOutOfBound = "فشلت العملية لأن الفهرس خارج النطاق."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "لا يمكن تعيين رد الاستدعاء في كل من قائمة الوسائط وفي الكائن الاختياري."; +Strings.OfficeOM.L_CustomXmlError = "خطأ في XML المخصص."; +Strings.OfficeOM.L_SettingsAreStale = "تعذر حفظ الإعدادات نظراً لأنها غير حديثة."; +Strings.OfficeOM.L_TooManyOptionalFunction = "دالات اختيارية متعددة في قائمة المعلمات"; +Strings.OfficeOM.L_MissingRequiredArguments = "فقدان بعض الوسيطات المطلوبة"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = 'لا يمكن استخدام معلمات الإحداثيات مع "جدول" بنوع الاندماج عندما يحتوي الجدول على خلايا مدمجة.'; +Strings.OfficeOM.L_HostError = "خطأ المضيف"; +Strings.OfficeOM.L_OutOfRange = "خارج النطاق"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "لا يمكن إنشاء ربط مع التحديد الحالي ونوع الربط المحدد."; +Strings.OfficeOM.L_TooManyOptionalObjects = "كائنات اختيارية متعددة في قائمة المعلمات"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "يجب أن يكون المحتوى المحدد بتنسيق الجدول. قم بتنسيق البيانات كجدول وحاول مرة أخرى."; +Strings.OfficeOM.L_APINotSupported = "API غير معتمدة"; +Strings.OfficeOM.L_SliceSizeNotSupported = "حجم الشريحة المحدد غير معتمد."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "فشلت عملية إزالة معالج الحدث."; +Strings.OfficeOM.L_BindingToMultipleSelection = "لا يتم اعتماد التحديدات المتقطعة."; +Strings.OfficeOM.L_DataReadError = "خطأ في قراءة البيانات"; +Strings.OfficeOM.L_InternalErrorDescription = "حدث خطأ داخلي."; +Strings.OfficeOM.L_InvalidDataFormat = "تنسيق كائن البيانات المحدد غير صحيح."; +Strings.OfficeOM.L_RequestTimeout = "استغرقت المكالمة وقتاً طويلاً وبالتالي يتعذر تنفيذها."; +Strings.OfficeOM.L_DataStale = "البيانات غير حديثة"; +Strings.OfficeOM.L_GetSelectionNotSupported = "التحديد الحالي غير معتمد."; +Strings.OfficeOM.L_MemoryLimit = "تجاوز حد الذاكرة"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "ملاحظة: يُقترح أن يكون عدد الخلايا الموجود في جدول أقل من 20000 خلية."; +Strings.OfficeOM.L_InvalidTableOptionValue = "تحتوي معلمة واحدة أو أكثر من معلمات tableOptions على قيم غير مسموح بها. تحقق من القيم مرة أخرى ثم أعد المحاولة."; +Strings.OfficeOM.L_PermissionDenied = "تم رفض الإذن"; +Strings.OfficeOM.L_InvalidDataObject = "كائن البيانات غير صالح"; +Strings.OfficeOM.L_UserNotSignedIn = "لم يسجل أي مستخدم دخوله إلى Office."; +Strings.OfficeOM.L_SelectionCannotBound = "يتعذر الربط بالتحديد الحالي."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "الأعمدة المحددة غير صالحة."; +Strings.OfficeOM.L_BadSelectorString = "لم يتم تنسيق السلسة التي تم تمريرها إلى المحدد بشكل سليم أو أنها غير معتمدة."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "قيم rowCount أو columnCount المحددة غير صحيحة."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "نوع OsfControl غير معتمد."; +Strings.OfficeOM.L_InvalidValue = "قيمة غير صالحة"; +Strings.OfficeOM.L_DataNotMatchSelection = "كائن البيانات الذي تم توفيره غير متوافق مع شكل التحديد الحالي أو أبعاده."; +Strings.OfficeOM.L_InternalError = "خطأ داخلي"; +Strings.OfficeOM.L_NotSupported = "الدالة {0} غير معتمدة."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "لم يتم العثور على العقدة المحددة."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "نوع الاندماج المحدد غير متوافق مع هذا النوع من الربط."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "حالت مشكلة في الشبكة دون استرداد الملف."; +Strings.OfficeOM.L_TooManyArguments = "العديد من الوسيطات"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "العملية غير معتمدة على هذا النوع من الربط."; +Strings.OfficeOM.L_InValidOptionalArgument = "وسيطة اختيارية غير صالحة"; +Strings.OfficeOM.L_FileTypeNotSupported = "نوع الملف المحدد غير معتمد."; +Strings.OfficeOM.L_GetDataParametersConflict = "تعارض المعلمات المحددة."; +Strings.OfficeOM.L_CallbackNotAFunction = "يجب أن يكون رد الاستدعاء من دالة النوع، وكان من النوع {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/office_strings.js new file mode 100644 index 000000000..69673ac4d --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="نوع الربط المحدد غير متوافق مع العنصر المسمى الموفر.";Strings.OfficeOM.L_EventHandlerNotExist="لم يتم العثور على معالج الأحداث المحدد لهذا الربط.";Strings.OfficeOM.L_UnknownBindingType="نوع الربط غير معتمد.";Strings.OfficeOM.L_InvalidNode="العقدة غير صالحة";Strings.OfficeOM.L_NotImplemented="لم يتم تنفيذ الدالة {0}.";Strings.OfficeOM.L_NoCapability="لا تملك الأذونات الكافية لهذا الإجراء.";Strings.OfficeOM.L_SettingsCannotSave="تعذر حفظ الإعدادات.";Strings.OfficeOM.L_DataWriteReminder="تذكير بكتابة البيانات";Strings.OfficeOM.L_InvalidBinding="الربط غير صالح";Strings.OfficeOM.L_InvalidSetColumns="الأعمدة المحددة غير صالحة.";Strings.OfficeOM.L_BindingCreationError="خطأ في إنشاء الربط";Strings.OfficeOM.L_FormatValueOutOfRange="إن القيمة خارج النطاق المسموح به.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="التحديد الحالي غير متوافق مع نوع الاندماج المحدد.";Strings.OfficeOM.L_InvalidBindingError="خطأ الربط غير صالح";Strings.OfficeOM.L_InvalidGetStartRowColumn="قيم startRow أو startColumn المحددة غير صحيحة.";Strings.OfficeOM.L_InvalidSetRows="الصفوف المحددة غير صالحة.";Strings.OfficeOM.L_NetworkProblem="مشكلة في الشبكة";Strings.OfficeOM.L_CannotWriteToSelection="لا يمكن الكتابة إلى التحديد الحالي.";Strings.OfficeOM.L_MissingParameter="معلمة مفقودة";Strings.OfficeOM.L_IndexOutOfRange="الفهرس خارج النطاق.";Strings.OfficeOM.L_SettingsStaleError="خطأ في الإعدادات القديمة";Strings.OfficeOM.L_CannotNavigateTo="إن الكائن موجود في موقع حيث التنقل غير معتمد.";Strings.OfficeOM.L_ReadSettingsError="خطأ في إعدادات القراءة";Strings.OfficeOM.L_InvalidGetColumns="الأعمدة المحددة غير صالحة.";Strings.OfficeOM.L_CoercionTypeNotSupported="نوع الاندماج المحدد غير معتمد.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="التطبيق {0} غير موجود. لم يتم استدعاء Microsoft.Office.WebExtension.initialize (السبب).";Strings.OfficeOM.L_OverwriteWorksheetData="فشلت عملية التعيين لأن كائن البيانات الذي تم توفيره سيكتب فوق البيانات أو سينقلها.";Strings.OfficeOM.L_RowIndexOutOfRange="إن قيمة فهرس الصف خارج النطاق المسموح به. استخدم قيمة (0 أو أعلى) تكون أصغر من عدد الصفوف.";Strings.OfficeOM.L_InvalidReadForBlankRow="إن الصف المحدد فارغ.";Strings.OfficeOM.L_ColIndexOutOfRange="إن قيمة فهرس العمود خارج النطاق المسموح به. استخدم قيمة (0 أو أعلى) تكون أصغر من عدد الأعمدة.";Strings.OfficeOM.L_UnsupportedEnumeration="قائمة تعداد غير معتمدة";Strings.OfficeOM.L_InvalidParameters="للدالة {0} معلمات غير صالحة.";Strings.OfficeOM.L_SetDataParametersConflict="تعارض المعلمات المحددة.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="استدعاء closeAsync على الملف الحالي قبل استرداد آخر.";Strings.OfficeOM.L_DataNotMatchCoercionType="نوع كائن البيانات المحدد غير متوافق مع التحديد الحالي.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="قائمة التعداد غير معتمدة في تطبيق المضيف الحالي.";Strings.OfficeOM.L_InvalidCoercion="نوع الاندماج غير صالح";Strings.OfficeOM.L_NotSupportedEventType="نوع الحدث المحدد {0} غير معتمد.";Strings.OfficeOM.L_UnsupportedDataObject="نوع كائن البيانات الذي تم توفيره غير معتمد.";Strings.OfficeOM.L_GetDataIsTooLarge="مجموعة البيانات المطلوبة كبيرة جداً.";Strings.OfficeOM.L_AppNameNotExist="لا يوجد اسم تطبيق لـ {0}.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="الرجاء إجراء تحديد.";Strings.OfficeOM.L_MultipleNamedItemFound="تم العثور على عدة كائنات بالاسم نفسه.";Strings.OfficeOM.L_InvalidCellsValue="تحتوي معلمة واحدة أو أكثر من معلمات الخلايا على قيم غير مسموح بها. تحقق من القيم مرة أخرى ثم أعد المحاولة.";Strings.OfficeOM.L_DataNotMatchBindingType="كائن البيانات المحدد غير متوافق مع نوع الربط.";Strings.OfficeOM.L_InvalidFormatValue="تحتوي معلمة واحدة أو أكثر من معلمات التنسيق على قيم غير مسموح بها. تحقق من القيم مرة أخرى ثم أعد المحاولة.";Strings.OfficeOM.L_NotSupportedBindingType="نوع الربط المحدد {0} غير معتمد.";Strings.OfficeOM.L_InitializeNotReady="لم يتم تحميل Office.js بشكل كامل بعد. يرجى إعادة المحاولة لاحقاً للتأكد من إضافة رمز التهيئة في وظيفة Office.initialize.";Strings.OfficeOM.L_FormattingReminder="تذكير بالتنسيق";Strings.OfficeOM.L_ShuttingDown="فشلت العملية لأن البيانات غير حديثة على الخادم.";Strings.OfficeOM.L_OperationNotSupported="العملية غير معتمدة.";Strings.OfficeOM.L_DocumentReadOnly="العملية المطلوبة غير مسموح بها في وضع المستند الحالي.";Strings.OfficeOM.L_NamedItemNotFound="العنصر المسمى غير موجود.";Strings.OfficeOM.L_InvalidApiCallInContext="استدعاء API غير صالح في السياق الحالي.";Strings.OfficeOM.L_InvalidGetRows="الصفوف المحددة غير صالحة.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="ملاحظة: يُقترح أن تكون مجموعات التنسيق المعينة بواسطة استدعاء API الخاص بالتنسيق أقل من 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="انتظر حتى اكتمال المكالمة السابقة.";Strings.OfficeOM.L_SetDataIsTooLarge="كائن البيانات المحدد طويل جداً.";Strings.OfficeOM.L_DataWriteError="خطأ في كتابة البيانات";Strings.OfficeOM.L_InvalidBindingOperation="عملية الربط غير صالحة";Strings.OfficeOM.L_APICallFailed="فشل استدعاء API";Strings.OfficeOM.L_SpecifiedIdNotExist="إن المعرف المحدد غير موجود.";Strings.OfficeOM.L_FunctionCallFailed="فشل استدعاء الدالة {0}، رمز الخطأ: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="لا يتطابق كائن البيانات الذي تم توفيره مع حجم التحديد الحالي.";Strings.OfficeOM.L_SaveSettingsError="خطأ في إعدادات الحفظ";Strings.OfficeOM.L_RequestTokenUnavailable="تم إحباط API هذه لإبطاء تكرار المكالمة.";Strings.OfficeOM.L_InvalidSetStartRowColumn="قيم startRow أو startColumn المحددة غير صحيحة.";Strings.OfficeOM.L_InvalidFormat="خطأ تنسيق غير صالح";Strings.OfficeOM.L_BindingNotExist="الربط المحدد غير موجود.";Strings.OfficeOM.L_SettingNameNotExist="اسم الإعداد المحدد غير موجود.";Strings.OfficeOM.L_EventHandlerAdditionFailed="فشل في إضافة معالج الحدث.";Strings.OfficeOM.L_BrowserAPINotSupported="لا يعتمد هذا المستعرض API المطلوبة.";Strings.OfficeOM.L_InvalidAPICall="استدعاء API غير صالح";Strings.OfficeOM.L_EventRegistrationError="خطأ في تسجيل الأحداث";Strings.OfficeOM.L_ElementMissing="تعذر علينا تنسيق خلية الجدول لأن بعض قيم المعلمات مفقودة. تحقق من المعلمات مرة أخرى ثم أعد المحاولة.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported='لا يمكن استخدام معلمات الإحداثيات مع "جدول" بنوع الاندماج عندما يحتوي الجدول على خلايا مدمجة.';Strings.OfficeOM.L_NavOutOfBound="فشلت العملية لأن الفهرس خارج النطاق.";Strings.OfficeOM.L_RedundantCallbackSpecification="لا يمكن تعيين رد الاستدعاء في كل من قائمة الوسائط وفي الكائن الاختياري.";Strings.OfficeOM.L_CustomXmlError="خطأ في XML المخصص.";Strings.OfficeOM.L_SettingsAreStale="تعذر حفظ الإعدادات نظراً لأنها غير حديثة.";Strings.OfficeOM.L_TooManyOptionalFunction="دالات اختيارية متعددة في قائمة المعلمات";Strings.OfficeOM.L_MissingRequiredArguments="فقدان بعض الوسيطات المطلوبة";Strings.OfficeOM.L_NonUniformPartialGetNotSupported='لا يمكن استخدام معلمات الإحداثيات مع "جدول" بنوع الاندماج عندما يحتوي الجدول على خلايا مدمجة.';Strings.OfficeOM.L_HostError="خطأ المضيف";Strings.OfficeOM.L_OutOfRange="خارج النطاق";Strings.OfficeOM.L_InvalidSelectionForBindingType="لا يمكن إنشاء ربط مع التحديد الحالي ونوع الربط المحدد.";Strings.OfficeOM.L_TooManyOptionalObjects="كائنات اختيارية متعددة في قائمة المعلمات";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="يجب أن يكون المحتوى المحدد بتنسيق الجدول. قم بتنسيق البيانات كجدول وحاول مرة أخرى.";Strings.OfficeOM.L_APINotSupported="API غير معتمدة";Strings.OfficeOM.L_SliceSizeNotSupported="حجم الشريحة المحدد غير معتمد.";Strings.OfficeOM.L_EventHandlerRemovalFailed="فشلت عملية إزالة معالج الحدث.";Strings.OfficeOM.L_BindingToMultipleSelection="لا يتم اعتماد التحديدات المتقطعة.";Strings.OfficeOM.L_DataReadError="خطأ في قراءة البيانات";Strings.OfficeOM.L_InternalErrorDescription="حدث خطأ داخلي.";Strings.OfficeOM.L_InvalidDataFormat="تنسيق كائن البيانات المحدد غير صحيح.";Strings.OfficeOM.L_RequestTimeout="استغرقت المكالمة وقتاً طويلاً وبالتالي يتعذر تنفيذها.";Strings.OfficeOM.L_DataStale="البيانات غير حديثة";Strings.OfficeOM.L_GetSelectionNotSupported="التحديد الحالي غير معتمد.";Strings.OfficeOM.L_MemoryLimit="تجاوز حد الذاكرة";Strings.OfficeOM.L_CellDataAmountBeyondLimits="ملاحظة: يُقترح أن يكون عدد الخلايا الموجود في جدول أقل من 20000 خلية.";Strings.OfficeOM.L_InvalidTableOptionValue="تحتوي معلمة واحدة أو أكثر من معلمات tableOptions على قيم غير مسموح بها. تحقق من القيم مرة أخرى ثم أعد المحاولة.";Strings.OfficeOM.L_PermissionDenied="تم رفض الإذن";Strings.OfficeOM.L_InvalidDataObject="كائن البيانات غير صالح";Strings.OfficeOM.L_UserNotSignedIn="لم يسجل أي مستخدم دخوله إلى Office.";Strings.OfficeOM.L_SelectionCannotBound="يتعذر الربط بالتحديد الحالي.";Strings.OfficeOM.L_InvalidColumnsForBinding="الأعمدة المحددة غير صالحة.";Strings.OfficeOM.L_BadSelectorString="لم يتم تنسيق السلسة التي تم تمريرها إلى المحدد بشكل سليم أو أنها غير معتمدة.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="قيم rowCount أو columnCount المحددة غير صحيحة.";Strings.OfficeOM.L_OsfControlTypeNotSupported="نوع OsfControl غير معتمد.";Strings.OfficeOM.L_InvalidValue="قيمة غير صالحة";Strings.OfficeOM.L_DataNotMatchSelection="كائن البيانات الذي تم توفيره غير متوافق مع شكل التحديد الحالي أو أبعاده.";Strings.OfficeOM.L_InternalError="خطأ داخلي";Strings.OfficeOM.L_NotSupported="الدالة {0} غير معتمدة.";Strings.OfficeOM.L_CustomXmlNodeNotFound="لم يتم العثور على العقدة المحددة.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="نوع الاندماج المحدد غير متوافق مع هذا النوع من الربط.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="حالت مشكلة في الشبكة دون استرداد الملف.";Strings.OfficeOM.L_TooManyArguments="العديد من الوسيطات";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="العملية غير معتمدة على هذا النوع من الربط.";Strings.OfficeOM.L_InValidOptionalArgument="وسيطة اختيارية غير صالحة";Strings.OfficeOM.L_FileTypeNotSupported="نوع الملف المحدد غير معتمد.";Strings.OfficeOM.L_GetDataParametersConflict="تعارض المعلمات المحددة.";Strings.OfficeOM.L_CallbackNotAFunction="يجب أن يكون رد الاستدعاء من دالة النوع، وكان من النوع {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/outlook_strings.debug.js new file mode 100644 index 000000000..2f454525a --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "لا يمكن حذف المرفق لأنه يتعذر العثور عليه مع فهرس المرفق."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "يتجاوز الطلب حد الحجم الذي يبلغ 1 ميغابايت. يرجى تعديل طلب EWS الخاص بك."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = 'الإذن غير المقيّد مطلوب لاستدعاء الأسلوب: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "خطأ في المرفقات"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "يقع تاريخ الانتهاء قبل تاريخ البدء."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "إن اسماً واحداً أو أكثر من أسماء العرض التي قدمتها طويل(ة) جداً."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "لا يمكن أن يتجاوز إجمالي عدد المستلمين في الحقل {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "فشلت عملية التحقق من سلامة مستند HTML."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "خطأ في كتابة البيانات"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "الإذن غير المقيّد مطلوب للوصول إلى الأعضاء المحميين لـ JavaScript API من Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "تتعذر إضافة المرفقات لأن الرسالة تحتوي بالفعل على العدد الأقصى من المرفقات"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = 'خطأ بروتوكول داخلي: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "أزال المستخدم المرفق قبل اكتمال التحميل."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "تعذر العثور على إزاحة للطابع الزمني."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "تتعذر إضافة المرفق لأنه كبير جداً."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "لا يمكن أن يكون وقت النهاية قبل وقت البدء."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "لا تتطابق المعلمات المتوفرة مع التنسيق المتوقع."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "تتعذر إضافة المرفق إلى العنصر."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "لم يتم توفير مستلمين صالحين."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "كان معرف المرفق غير صالح."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "تتعذر إضافة المرفقات أثناء استرداد الرد الكامل إعادة التوجيه من الخادم."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "إن عنواناً واحد أو أكثر من عناوين البريد الإلكتروني التي قدمتها طويل(ة) جداً."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "كان مسار المرفق غير صالح."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "لا يمكن حذف المرفق من العنصر."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "حدث خطأ في التنسيق الداخلي."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "لا يتم حل الإدخال إلى تاريخ صالح."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "قام المستخدم بتغيير موضع المؤشر أثناء إدراج البيانات." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/outlook_strings.js new file mode 100644 index 000000000..20eada67f --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ar-sa/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="لا يمكن حذف المرفق لأنه يتعذر العثور عليه مع فهرس المرفق.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="يتجاوز الطلب حد الحجم الذي يبلغ 1 ميغابايت. يرجى تعديل طلب EWS الخاص بك.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text='الإذن غير المقيّد مطلوب لاستدعاء الأسلوب: "{0}".';_u.ExtensibilityStrings.l_AttachmentErrorName_Text="خطأ في المرفقات";_u.ExtensibilityStrings.l_InvalidEventDates_Text="يقع تاريخ الانتهاء قبل تاريخ البدء.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="إن اسماً واحداً أو أكثر من أسماء العرض التي قدمتها طويل(ة) جداً.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="لا يمكن أن يتجاوز إجمالي عدد المستلمين في الحقل {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="فشلت عملية التحقق من سلامة مستند HTML.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="خطأ في كتابة البيانات";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="الإذن غير المقيّد مطلوب للوصول إلى الأعضاء المحميين لـ JavaScript API من Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="تتعذر إضافة المرفقات لأن الرسالة تحتوي بالفعل على العدد الأقصى من المرفقات";_u.ExtensibilityStrings.l_InternalProtocolError_Text='خطأ بروتوكول داخلي: "{0}".';_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="أزال المستخدم المرفق قبل اكتمال التحميل.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="تعذر العثور على إزاحة للطابع الزمني.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="تتعذر إضافة المرفق لأنه كبير جداً.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="لا يمكن أن يكون وقت النهاية قبل وقت البدء.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="لا تتطابق المعلمات المتوفرة مع التنسيق المتوقع.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="تتعذر إضافة المرفق إلى العنصر.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="لم يتم توفير مستلمين صالحين.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="كان معرف المرفق غير صالح.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="تتعذر إضافة المرفقات أثناء استرداد الرد الكامل إعادة التوجيه من الخادم.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="إن عنواناً واحد أو أكثر من عناوين البريد الإلكتروني التي قدمتها طويل(ة) جداً.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="كان مسار المرفق غير صالح.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="لا يمكن حذف المرفق من العنصر.";_u.ExtensibilityStrings.l_InternalFormatError_Text="حدث خطأ في التنسيق الداخلي.";_u.ExtensibilityStrings.l_InvalidDate_Text="لا يتم حل الإدخال إلى تاريخ صالح.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="قام المستخدم بتغيير موضع المؤشر أثناء إدراج البيانات." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/office_strings.debug.js new file mode 100644 index 000000000..410a7acfe --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Зададеният тип обвързване не е съвместим с подадения именуван елемент."; +Strings.OfficeOM.L_EventHandlerNotExist = "Зададеният манипулатор на събитие не е намерен за това обвързване."; +Strings.OfficeOM.L_UnknownBindingType = "Типът на обвързването не се поддържа."; +Strings.OfficeOM.L_InvalidNode = "Невалиден възел"; +Strings.OfficeOM.L_NotImplemented = "Функцията {0} не е реализирана."; +Strings.OfficeOM.L_NoCapability = "Нямате достатъчно разрешения за това действие."; +Strings.OfficeOM.L_SettingsCannotSave = "Настройките не можаха да бъдат записани."; +Strings.OfficeOM.L_DataWriteReminder = "Напомняне за запис на данни"; +Strings.OfficeOM.L_InvalidBinding = "Невалидно обвързване"; +Strings.OfficeOM.L_InvalidSetColumns = "Посочените колони са невалидни."; +Strings.OfficeOM.L_BindingCreationError = "Грешка при създаване на обвързване"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Стойността е извън позволения диапазон."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Текущата селекция не е съвместима със зададения тип преобразуване."; +Strings.OfficeOM.L_InvalidBindingError = "Грешка от невалидно обвързване"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Зададените стойности за startRow или startColumn са невалидни."; +Strings.OfficeOM.L_InvalidSetRows = "Посочените редове са невалидни."; +Strings.OfficeOM.L_NetworkProblem = "Мрежов проблем"; +Strings.OfficeOM.L_CannotWriteToSelection = "Не може да се запише в текущата селекция."; +Strings.OfficeOM.L_MissingParameter = "Липсващ параметър"; +Strings.OfficeOM.L_IndexOutOfRange = "Индексът е извън обхват."; +Strings.OfficeOM.L_SettingsStaleError = "Грешка от неактуални настройки"; +Strings.OfficeOM.L_CannotNavigateTo = "Обектът се намира на място, където не се поддържа навигация."; +Strings.OfficeOM.L_ReadSettingsError = "Грешка в настройките за четене"; +Strings.OfficeOM.L_InvalidGetColumns = "Посочените колони са невалидни."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Зададеният тип преобразуване не се поддържа."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Приложението {0} не съществува. Не е извикано Microsoft.Office.WebExtension.Initialize(причина)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Операцията за настройка е неуспешна, защото подаденият обект с данни ще се запише върху данните или ще ги отмести."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Стойността на индекса на реда е извън допустимия диапазон. Използвайте стойност (0 или по-висока), която е по-малка от броя на редовете."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Указаният ред е празен."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Стойността на индекса на колоната е извън допустимия диапазон. Използвайте стойност (0 или по-висока), която е по-малка от броя на колоните."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Неподдържано номериране"; +Strings.OfficeOM.L_InvalidParameters = "Функцията {0} има невалиден параметри."; +Strings.OfficeOM.L_SetDataParametersConflict = "Посочените параметри са в конфликт."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Извикайте closeAsync за текущия файл, преди да извлечете друг."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Типът на указания обект с данни не е съвместим с текущата селекция."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Това номериране не се поддържа в текущото приложение хост."; +Strings.OfficeOM.L_InvalidCoercion = "Невалидно преобразуване на тип"; +Strings.OfficeOM.L_NotSupportedEventType = "Указаният тип на събитие {0} не се поддържа."; +Strings.OfficeOM.L_UnsupportedDataObject = "Подаденият тип на обект с данни не се поддържа."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Заявеният набор данни е твърде голям."; +Strings.OfficeOM.L_AppNameNotExist = "AppName за {0} не съществува."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Направете избор."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Намерени са множество обекти с едно и също име."; +Strings.OfficeOM.L_InvalidCellsValue = "Един или повече от параметрите на клетките имат стойности, които не са позволени. Проверете стойностите и опитайте отново."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Указаният обект с данни не е съвместим с типа на обвързване."; +Strings.OfficeOM.L_InvalidFormatValue = "Един или повече от параметрите за форматиране имат стойности, които не са позволени. Проверете стойностите и опитайте отново."; +Strings.OfficeOM.L_NotSupportedBindingType = "Указаният тип на обвързване {0} не се поддържа."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js не е още напълно зареден. Опитайте отново по-късно или се уверете, че сте добавили кода за инициализация във функцията Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Напомняне за форматиране"; +Strings.OfficeOM.L_ShuttingDown = "Операцията беше неуспешна, защото данните в сървъра не са актуални."; +Strings.OfficeOM.L_OperationNotSupported = "Тази операция не се поддържа."; +Strings.OfficeOM.L_DocumentReadOnly = "Заявената операция не е разрешена в текущия документен режим."; +Strings.OfficeOM.L_NamedItemNotFound = "Наименуваният елемент не съществува."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Невалидно извикване на API в текущия контекст."; +Strings.OfficeOM.L_InvalidGetRows = "Посочените редове са невалидни."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Забележка: Наборите за форматиране, зададени от повикване на форматирането на API, се предполага да бъдат под 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Изчакайте, докато завърши предишното повикване."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Зададеният обект с данни е твърде голям."; +Strings.OfficeOM.L_DataWriteError = "Грешка при запис на данни"; +Strings.OfficeOM.L_InvalidBindingOperation = "Невалидна операция за обвързване"; +Strings.OfficeOM.L_APICallFailed = "Неуспешно извикване на API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Посоченият ИД не съществува."; +Strings.OfficeOM.L_FunctionCallFailed = "Извикването на функцията {0} е неуспешно, код на грешка: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Подаденият обект с данни не съответства на размера на текущата селекция."; +Strings.OfficeOM.L_SaveSettingsError = "Грешка в настройките за записване"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Този API е ограничен, за да се забави честотата на повикване."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Зададените стойности за startRow или startColumn са невалидни."; +Strings.OfficeOM.L_InvalidFormat = "Грешка, причинена от невалиден формат"; +Strings.OfficeOM.L_BindingNotExist = "Указаното обвързване не съществува."; +Strings.OfficeOM.L_SettingNameNotExist = "Указаното име на настройка не съществува."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Неуспешно добавяне на манипулатора на събитие."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Този браузър не поддържа искания API."; +Strings.OfficeOM.L_InvalidAPICall = "Невалидно извикване на API"; +Strings.OfficeOM.L_EventRegistrationError = "Грешка при регистриране на събитие"; +Strings.OfficeOM.L_ElementMissing = "Не можем да форматираме клетката на таблицата, тъй като някои стойности на параметри липсват. Проверете отново параметрите и опитайте отново."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = 'Параметрите за координати не могат да се използват с налагане на типа "Таблица", когато таблицата съдържа обединени клетки.'; +Strings.OfficeOM.L_NavOutOfBound = "Операцията е неуспешна, тъй като индексът е извън диапазона."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Обратното повикване не може да се задава и в списък с аргументи, и в незадължителен обект."; +Strings.OfficeOM.L_CustomXmlError = "Грешка в потребителския XML."; +Strings.OfficeOM.L_SettingsAreStale = "Настройките не можаха да се запишат, защото не са актуални."; +Strings.OfficeOM.L_TooManyOptionalFunction = "няколко опционални функции в списъка с параметри"; +Strings.OfficeOM.L_MissingRequiredArguments = "липсват някои задължителни аргументи"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = 'Параметрите за координати не могат да се използват с налагане на типа "Таблица", когато таблицата съдържа обединени клетки.'; +Strings.OfficeOM.L_HostError = "Грешка на хоста"; +Strings.OfficeOM.L_OutOfRange = "Извън допустимия диапазон"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Не може да се създаде обвързване с текущата селекция и указания тип обвързване."; +Strings.OfficeOM.L_TooManyOptionalObjects = "няколко опционални обекта в списъка с параметри"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Избраното съдържание трябва да е в табличен формат. Форматирайте данните като таблица и опитайте отново."; +Strings.OfficeOM.L_APINotSupported = "API не се поддържа"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Указаният размер на сегмент не се поддържа."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Неуспешно премахване на манипулатора на събитие."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Не се поддържат несъседни селекции."; +Strings.OfficeOM.L_DataReadError = "Грешка при четене на данни"; +Strings.OfficeOM.L_InternalErrorDescription = "Възникна вътрешна грешка."; +Strings.OfficeOM.L_InvalidDataFormat = "Форматът на указания обект с данни е невалиден."; +Strings.OfficeOM.L_RequestTimeout = "Повикването отне твърде много време, за да се изпълни."; +Strings.OfficeOM.L_DataStale = "Данните не са актуални"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Текущата селекция не се поддържа."; +Strings.OfficeOM.L_MemoryLimit = "Превишено е ограничението за паметта"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Забележка: Броят на клетките в таблица се предполага да бъде под 20 000 клетки."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Един или повече от параметрите на tableOptions имат стойности, които не са позволени. Проверете стойностите и опитайте отново."; +Strings.OfficeOM.L_PermissionDenied = "Разрешението е отказано"; +Strings.OfficeOM.L_InvalidDataObject = "Невалиден обект с данни"; +Strings.OfficeOM.L_UserNotSignedIn = "Нито един потребител не е влязъл в Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Не може да се обвърже с текущата селекция."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Посочените колони са невалидни."; +Strings.OfficeOM.L_BadSelectorString = "Низът, който е подаден в селектора, е неправилно форматиран или не се поддържа."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Зададените стойности за rowCount или columnCount са невалидни."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Типът OsfControl не се поддържа."; +Strings.OfficeOM.L_InvalidValue = "Невалидна стойност"; +Strings.OfficeOM.L_DataNotMatchSelection = "Предоставеният обект с данни не е съвместим с формата или размерностите на текущата селекция."; +Strings.OfficeOM.L_InternalError = "Вътрешна грешка"; +Strings.OfficeOM.L_NotSupported = "Функцията {0} не се поддържа."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Указаният възел не е намерен."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Зададеният тип преобразуване не е съвместим с този тип обвързване."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Проблем в мрежата попречи на извличането на файла."; +Strings.OfficeOM.L_TooManyArguments = "твърде много аргументи"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Операцията не се поддържа за този тип обвързване."; +Strings.OfficeOM.L_InValidOptionalArgument = "невалиден незадължителен аргумент"; +Strings.OfficeOM.L_FileTypeNotSupported = "Зададеният тип на файл не се поддържа."; +Strings.OfficeOM.L_GetDataParametersConflict = "Посочените параметри са в конфликт."; +Strings.OfficeOM.L_CallbackNotAFunction = "Обратното повикване трябва да е от тип функция, а беше от тип {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/office_strings.js new file mode 100644 index 000000000..3b062198f --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Зададеният тип обвързване не е съвместим с подадения именуван елемент.";Strings.OfficeOM.L_EventHandlerNotExist="Зададеният манипулатор на събитие не е намерен за това обвързване.";Strings.OfficeOM.L_UnknownBindingType="Типът на обвързването не се поддържа.";Strings.OfficeOM.L_InvalidNode="Невалиден възел";Strings.OfficeOM.L_NotImplemented="Функцията {0} не е реализирана.";Strings.OfficeOM.L_NoCapability="Нямате достатъчно разрешения за това действие.";Strings.OfficeOM.L_SettingsCannotSave="Настройките не можаха да бъдат записани.";Strings.OfficeOM.L_DataWriteReminder="Напомняне за запис на данни";Strings.OfficeOM.L_InvalidBinding="Невалидно обвързване";Strings.OfficeOM.L_InvalidSetColumns="Посочените колони са невалидни.";Strings.OfficeOM.L_BindingCreationError="Грешка при създаване на обвързване";Strings.OfficeOM.L_FormatValueOutOfRange="Стойността е извън позволения диапазон.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Текущата селекция не е съвместима със зададения тип преобразуване.";Strings.OfficeOM.L_InvalidBindingError="Грешка от невалидно обвързване";Strings.OfficeOM.L_InvalidGetStartRowColumn="Зададените стойности за startRow или startColumn са невалидни.";Strings.OfficeOM.L_InvalidSetRows="Посочените редове са невалидни.";Strings.OfficeOM.L_NetworkProblem="Мрежов проблем";Strings.OfficeOM.L_CannotWriteToSelection="Не може да се запише в текущата селекция.";Strings.OfficeOM.L_MissingParameter="Липсващ параметър";Strings.OfficeOM.L_IndexOutOfRange="Индексът е извън обхват.";Strings.OfficeOM.L_SettingsStaleError="Грешка от неактуални настройки";Strings.OfficeOM.L_CannotNavigateTo="Обектът се намира на място, където не се поддържа навигация.";Strings.OfficeOM.L_ReadSettingsError="Грешка в настройките за четене";Strings.OfficeOM.L_InvalidGetColumns="Посочените колони са невалидни.";Strings.OfficeOM.L_CoercionTypeNotSupported="Зададеният тип преобразуване не се поддържа.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Приложението {0} не съществува. Не е извикано Microsoft.Office.WebExtension.Initialize(причина).";Strings.OfficeOM.L_OverwriteWorksheetData="Операцията за настройка е неуспешна, защото подаденият обект с данни ще се запише върху данните или ще ги отмести.";Strings.OfficeOM.L_RowIndexOutOfRange="Стойността на индекса на реда е извън допустимия диапазон. Използвайте стойност (0 или по-висока), която е по-малка от броя на редовете.";Strings.OfficeOM.L_InvalidReadForBlankRow="Указаният ред е празен.";Strings.OfficeOM.L_ColIndexOutOfRange="Стойността на индекса на колоната е извън допустимия диапазон. Използвайте стойност (0 или по-висока), която е по-малка от броя на колоните.";Strings.OfficeOM.L_UnsupportedEnumeration="Неподдържано номериране";Strings.OfficeOM.L_InvalidParameters="Функцията {0} има невалиден параметри.";Strings.OfficeOM.L_SetDataParametersConflict="Посочените параметри са в конфликт.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Извикайте closeAsync за текущия файл, преди да извлечете друг.";Strings.OfficeOM.L_DataNotMatchCoercionType="Типът на указания обект с данни не е съвместим с текущата селекция.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Това номериране не се поддържа в текущото приложение хост.";Strings.OfficeOM.L_InvalidCoercion="Невалидно преобразуване на тип";Strings.OfficeOM.L_NotSupportedEventType="Указаният тип на събитие {0} не се поддържа.";Strings.OfficeOM.L_UnsupportedDataObject="Подаденият тип на обект с данни не се поддържа.";Strings.OfficeOM.L_GetDataIsTooLarge="Заявеният набор данни е твърде голям.";Strings.OfficeOM.L_AppNameNotExist="AppName за {0} не съществува.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Направете избор.";Strings.OfficeOM.L_MultipleNamedItemFound="Намерени са множество обекти с едно и също име.";Strings.OfficeOM.L_InvalidCellsValue="Един или повече от параметрите на клетките имат стойности, които не са позволени. Проверете стойностите и опитайте отново.";Strings.OfficeOM.L_DataNotMatchBindingType="Указаният обект с данни не е съвместим с типа на обвързване.";Strings.OfficeOM.L_InvalidFormatValue="Един или повече от параметрите за форматиране имат стойности, които не са позволени. Проверете стойностите и опитайте отново.";Strings.OfficeOM.L_NotSupportedBindingType="Указаният тип на обвързване {0} не се поддържа.";Strings.OfficeOM.L_InitializeNotReady="Office.js не е още напълно зареден. Опитайте отново по-късно или се уверете, че сте добавили кода за инициализация във функцията Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Напомняне за форматиране";Strings.OfficeOM.L_ShuttingDown="Операцията беше неуспешна, защото данните в сървъра не са актуални.";Strings.OfficeOM.L_OperationNotSupported="Тази операция не се поддържа.";Strings.OfficeOM.L_DocumentReadOnly="Заявената операция не е разрешена в текущия документен режим.";Strings.OfficeOM.L_NamedItemNotFound="Наименуваният елемент не съществува.";Strings.OfficeOM.L_InvalidApiCallInContext="Невалидно извикване на API в текущия контекст.";Strings.OfficeOM.L_InvalidGetRows="Посочените редове са невалидни.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Забележка: Наборите за форматиране, зададени от повикване на форматирането на API, се предполага да бъдат под 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Изчакайте, докато завърши предишното повикване.";Strings.OfficeOM.L_SetDataIsTooLarge="Зададеният обект с данни е твърде голям.";Strings.OfficeOM.L_DataWriteError="Грешка при запис на данни";Strings.OfficeOM.L_InvalidBindingOperation="Невалидна операция за обвързване";Strings.OfficeOM.L_APICallFailed="Неуспешно извикване на API";Strings.OfficeOM.L_SpecifiedIdNotExist="Посоченият ИД не съществува.";Strings.OfficeOM.L_FunctionCallFailed="Извикването на функцията {0} е неуспешно, код на грешка: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Подаденият обект с данни не съответства на размера на текущата селекция.";Strings.OfficeOM.L_SaveSettingsError="Грешка в настройките за записване";Strings.OfficeOM.L_RequestTokenUnavailable="Този API е ограничен, за да се забави честотата на повикване.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Зададените стойности за startRow или startColumn са невалидни.";Strings.OfficeOM.L_InvalidFormat="Грешка, причинена от невалиден формат";Strings.OfficeOM.L_BindingNotExist="Указаното обвързване не съществува.";Strings.OfficeOM.L_SettingNameNotExist="Указаното име на настройка не съществува.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Неуспешно добавяне на манипулатора на събитие.";Strings.OfficeOM.L_BrowserAPINotSupported="Този браузър не поддържа искания API.";Strings.OfficeOM.L_InvalidAPICall="Невалидно извикване на API";Strings.OfficeOM.L_EventRegistrationError="Грешка при регистриране на събитие";Strings.OfficeOM.L_ElementMissing="Не можем да форматираме клетката на таблицата, тъй като някои стойности на параметри липсват. Проверете отново параметрите и опитайте отново.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported='Параметрите за координати не могат да се използват с налагане на типа "Таблица", когато таблицата съдържа обединени клетки.';Strings.OfficeOM.L_NavOutOfBound="Операцията е неуспешна, тъй като индексът е извън диапазона.";Strings.OfficeOM.L_RedundantCallbackSpecification="Обратното повикване не може да се задава и в списък с аргументи, и в незадължителен обект.";Strings.OfficeOM.L_CustomXmlError="Грешка в потребителския XML.";Strings.OfficeOM.L_SettingsAreStale="Настройките не можаха да се запишат, защото не са актуални.";Strings.OfficeOM.L_TooManyOptionalFunction="няколко опционални функции в списъка с параметри";Strings.OfficeOM.L_MissingRequiredArguments="липсват някои задължителни аргументи";Strings.OfficeOM.L_NonUniformPartialGetNotSupported='Параметрите за координати не могат да се използват с налагане на типа "Таблица", когато таблицата съдържа обединени клетки.';Strings.OfficeOM.L_HostError="Грешка на хоста";Strings.OfficeOM.L_OutOfRange="Извън допустимия диапазон";Strings.OfficeOM.L_InvalidSelectionForBindingType="Не може да се създаде обвързване с текущата селекция и указания тип обвързване.";Strings.OfficeOM.L_TooManyOptionalObjects="няколко опционални обекта в списъка с параметри";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Избраното съдържание трябва да е в табличен формат. Форматирайте данните като таблица и опитайте отново.";Strings.OfficeOM.L_APINotSupported="API не се поддържа";Strings.OfficeOM.L_SliceSizeNotSupported="Указаният размер на сегмент не се поддържа.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Неуспешно премахване на манипулатора на събитие.";Strings.OfficeOM.L_BindingToMultipleSelection="Не се поддържат несъседни селекции.";Strings.OfficeOM.L_DataReadError="Грешка при четене на данни";Strings.OfficeOM.L_InternalErrorDescription="Възникна вътрешна грешка.";Strings.OfficeOM.L_InvalidDataFormat="Форматът на указания обект с данни е невалиден.";Strings.OfficeOM.L_RequestTimeout="Повикването отне твърде много време, за да се изпълни.";Strings.OfficeOM.L_DataStale="Данните не са актуални";Strings.OfficeOM.L_GetSelectionNotSupported="Текущата селекция не се поддържа.";Strings.OfficeOM.L_MemoryLimit="Превишено е ограничението за паметта";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Забележка: Броят на клетките в таблица се предполага да бъде под 20 000 клетки.";Strings.OfficeOM.L_InvalidTableOptionValue="Един или повече от параметрите на tableOptions имат стойности, които не са позволени. Проверете стойностите и опитайте отново.";Strings.OfficeOM.L_PermissionDenied="Разрешението е отказано";Strings.OfficeOM.L_InvalidDataObject="Невалиден обект с данни";Strings.OfficeOM.L_UserNotSignedIn="Нито един потребител не е влязъл в Office.";Strings.OfficeOM.L_SelectionCannotBound="Не може да се обвърже с текущата селекция.";Strings.OfficeOM.L_InvalidColumnsForBinding="Посочените колони са невалидни.";Strings.OfficeOM.L_BadSelectorString="Низът, който е подаден в селектора, е неправилно форматиран или не се поддържа.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Зададените стойности за rowCount или columnCount са невалидни.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Типът OsfControl не се поддържа.";Strings.OfficeOM.L_InvalidValue="Невалидна стойност";Strings.OfficeOM.L_DataNotMatchSelection="Предоставеният обект с данни не е съвместим с формата или размерностите на текущата селекция.";Strings.OfficeOM.L_InternalError="Вътрешна грешка";Strings.OfficeOM.L_NotSupported="Функцията {0} не се поддържа.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Указаният възел не е намерен.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Зададеният тип преобразуване не е съвместим с този тип обвързване.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Проблем в мрежата попречи на извличането на файла.";Strings.OfficeOM.L_TooManyArguments="твърде много аргументи";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Операцията не се поддържа за този тип обвързване.";Strings.OfficeOM.L_InValidOptionalArgument="невалиден незадължителен аргумент";Strings.OfficeOM.L_FileTypeNotSupported="Зададеният тип на файл не се поддържа.";Strings.OfficeOM.L_GetDataParametersConflict="Посочените параметри са в конфликт.";Strings.OfficeOM.L_CallbackNotAFunction="Обратното повикване трябва да е от тип функция, а беше от тип {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/outlook_strings.debug.js new file mode 100644 index 000000000..92107c3bf --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Прикаченият файл не може да бъде изтрит, защото не може да бъде открит прикачен файл с индекса на прикачения файл."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Искането надвишава ограничението за максимален размер от 1 МБ. Променете вашето EWS искане."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = 'Изисква се разрешение на администратор за извикване на метода: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Грешка с прикачени файлове"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Крайната дата е преди началната дата."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Едно или повече от предоставените показвани имена са твърде дълги."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Общият брой получатели в полето не може да надвишава {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Неуспешно редактиране на HTML."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Грешка при запис на данни"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Изисква се разрешение на администратор за достъп до защитени членове на JavaScript API за Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Прикачените файлове не могат да се добавят, тъй като съобщението вече има максималния брой прикачени файлове"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = 'Вътрешна грешка в протокола: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Потребителят премахна прикачения файл, преди да завърши качването."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Не можа да се намери изместване за това клеймо."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Прикаченият файл не може да бъде добавен, защото е прекалено голям."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Крайният час не може да бъде преди началния час."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Дадените параметри не отговарят на очаквания формат."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Прикаченият файл не може да бъде добавен към елемента."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Едно или повече от предоставените показвани имена са твърде дълги."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ИД на прикачения файл е невалиден."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Прикачените файлове не могат да се добавят, докато пълният отговор или препращане се извлича от сървъра."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Един или повече от предоставените имейли са твърде дълги."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Пътят на прикачения файл е невалиден."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Прикаченият файл не може да бъде изтрит от елемента."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Възникна вътрешна грешка при форматиране."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Въведеното не е валидна дата."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Потребителят промени позицията на курсора по време на вмъкването на данните." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/outlook_strings.js new file mode 100644 index 000000000..2deb2e151 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/bg-bg/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Прикаченият файл не може да бъде изтрит, защото не може да бъде открит прикачен файл с индекса на прикачения файл.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Искането надвишава ограничението за максимален размер от 1 МБ. Променете вашето EWS искане.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text='Изисква се разрешение на администратор за извикване на метода: "{0}".';_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Грешка с прикачени файлове";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Крайната дата е преди началната дата.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Едно или повече от предоставените показвани имена са твърде дълги.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Общият брой получатели в полето не може да надвишава {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Неуспешно редактиране на HTML.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Грешка при запис на данни";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Изисква се разрешение на администратор за достъп до защитени членове на JavaScript API за Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Прикачените файлове не могат да се добавят, тъй като съобщението вече има максималния брой прикачени файлове";_u.ExtensibilityStrings.l_InternalProtocolError_Text='Вътрешна грешка в протокола: "{0}".';_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Потребителят премахна прикачения файл, преди да завърши качването.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Не можа да се намери изместване за това клеймо.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Прикаченият файл не може да бъде добавен, защото е прекалено голям.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Крайният час не може да бъде преди началния час.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Дадените параметри не отговарят на очаквания формат.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Прикаченият файл не може да бъде добавен към елемента.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Едно или повече от предоставените показвани имена са твърде дълги.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ИД на прикачения файл е невалиден.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Прикачените файлове не могат да се добавят, докато пълният отговор или препращане се извлича от сървъра.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Един или повече от предоставените имейли са твърде дълги.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Пътят на прикачения файл е невалиден.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Прикаченият файл не може да бъде изтрит от елемента.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Възникна вътрешна грешка при форматиране.";_u.ExtensibilityStrings.l_InvalidDate_Text="Въведеното не е валидна дата.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Потребителят промени позицията на курсора по време на вмъкването на данните." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/office_strings.debug.js new file mode 100644 index 000000000..ef3a25752 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Zadaný typ vazby není kompatibilní se zadanou pojmenovanou položkou."; +Strings.OfficeOM.L_EventHandlerNotExist = "Zadaná obslužná rutina událostí se pro tuto vazbu nenašla."; +Strings.OfficeOM.L_UnknownBindingType = "Tento typ vazby není podporovaný."; +Strings.OfficeOM.L_InvalidNode = "Neplatný uzel"; +Strings.OfficeOM.L_NotImplemented = "Funkce {0} není implementovaná."; +Strings.OfficeOM.L_NoCapability = "K provedení této akce nemáte dostatečná oprávnění."; +Strings.OfficeOM.L_SettingsCannotSave = "Nastavení nejde uložit."; +Strings.OfficeOM.L_DataWriteReminder = "Připomenutí zápisu dat"; +Strings.OfficeOM.L_InvalidBinding = "Neplatná vazba"; +Strings.OfficeOM.L_InvalidSetColumns = "Zadané sloupce jsou neplatné."; +Strings.OfficeOM.L_BindingCreationError = "Chyba vytváření vazby"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Hodnota je mimo povolený rozsah."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Aktuální výběr není kompatibilní se zadaným typem převodu."; +Strings.OfficeOM.L_InvalidBindingError = "Chyba neplatné vazby"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Zadané hodnoty startRow nebo startColumn jsou neplatné."; +Strings.OfficeOM.L_InvalidSetRows = "Zadané řádky jsou neplatné."; +Strings.OfficeOM.L_NetworkProblem = "Problém se sítí"; +Strings.OfficeOM.L_CannotWriteToSelection = "Do aktuálního výběru se nedá zapisovat."; +Strings.OfficeOM.L_MissingParameter = "Chybějící parametr"; +Strings.OfficeOM.L_IndexOutOfRange = "Index je mimo rozsah."; +Strings.OfficeOM.L_SettingsStaleError = "Chyba zastaralých nastavení"; +Strings.OfficeOM.L_CannotNavigateTo = "Objekt je v umístění, kde se nepodporuje navigace."; +Strings.OfficeOM.L_ReadSettingsError = "Chyba čtení nastavení"; +Strings.OfficeOM.L_InvalidGetColumns = "Zadané sloupce jsou neplatné."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Zadaný typ převodu není podporovaný."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Aplikace {0} neexistuje. Nevolá se rutina Microsoft.Office.WebExtension.initialize(reason)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Operace nastavení se nepovedla, protože zadaný datový objekt přepíše nebo posune data."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Hodnota indexu řádku je mimo povolený rozsah. Použijte hodnotu (0 nebo vyšší), která je menší než počet řádků."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Zadaný řádek je prázdný."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Hodnota indexu sloupce je mimo povolený rozsah. Použijte hodnotu (0 nebo vyšší), která je menší než počet sloupců."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Nepodporovaný výčet"; +Strings.OfficeOM.L_InvalidParameters = "Funkce {0} má neplatné parametry."; +Strings.OfficeOM.L_SetDataParametersConflict = "Zadané parametry způsobují konflikt."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Před načtením dalšího souboru volejte closeAsync pro aktuální soubor."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Typ zadaného datového objektu není kompatibilní s aktuálním výběrem."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Výčet není v aktuální hostitelské aplikaci podporovaný."; +Strings.OfficeOM.L_InvalidCoercion = "Neplatný typ převodu"; +Strings.OfficeOM.L_NotSupportedEventType = "Zadaný typ události {0} není podporovaný."; +Strings.OfficeOM.L_UnsupportedDataObject = "Zadaný typ datového objektu není podporovaný."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Požadovaná sada dat je moc velká."; +Strings.OfficeOM.L_AppNameNotExist = "AppName pro {0} neexistuje."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Vyberte něco, prosím."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Našlo se více objektů se stejným názvem."; +Strings.OfficeOM.L_InvalidCellsValue = "Minimálně jeden parametr buňky má hodnoty, které nejsou povolené. Překontrolujte hodnoty a zkuste to znovu."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Zadaný datový objekt není kompatibilní s typem vazby."; +Strings.OfficeOM.L_InvalidFormatValue = "Minimálně jeden parametr formátu má hodnoty, které nejsou povolené. Překontrolujte hodnoty a zkuste to znovu."; +Strings.OfficeOM.L_NotSupportedBindingType = "Zadaný typ vazby {0} není podporovaný."; +Strings.OfficeOM.L_InitializeNotReady = "Soubor Office.js ještě není úplně načtený. Zkuste to znovu později nebo přidejte inicializační kód do funkce Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Připomenutí formátování"; +Strings.OfficeOM.L_ShuttingDown = "Operace se nepovedla, protože data na serveru nejsou aktuální."; +Strings.OfficeOM.L_OperationNotSupported = "Operace není podporovaná."; +Strings.OfficeOM.L_DocumentReadOnly = "Požadovaná operace není v aktuálním režimu dokumentu povolená."; +Strings.OfficeOM.L_NamedItemNotFound = "Pojmenovaná položka neexistuje."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Neplatné volání rozhraní API v aktuálním kontextu"; +Strings.OfficeOM.L_InvalidGetRows = "Zadané řádky jsou neplatné."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Poznámka: Přes volání formátovacího API by se nemělo nastavovat víc než 100 formátování."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Počkejte, než se dokončí předchozí volání."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Zadaný datový objekt je moc velký."; +Strings.OfficeOM.L_DataWriteError = "Chyba zápisu dat"; +Strings.OfficeOM.L_InvalidBindingOperation = "Neplatná operace vazby"; +Strings.OfficeOM.L_APICallFailed = "Volání API selhalo"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Zadané ID neexistuje."; +Strings.OfficeOM.L_FunctionCallFailed = "Volání funkce {0} se nepovedlo, kód chyby: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Zadaný datový objekt se neshoduje s velikostí aktuálního výběru."; +Strings.OfficeOM.L_SaveSettingsError = "Chyba ukládání nastavení"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Toto rozhraní API se omezilo, aby se zpomalila četnost volání."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Zadané hodnoty startRow nebo startColumn jsou neplatné."; +Strings.OfficeOM.L_InvalidFormat = "Chyba neplatného formátu"; +Strings.OfficeOM.L_BindingNotExist = "Zadaná vazba neexistuje."; +Strings.OfficeOM.L_SettingNameNotExist = "Zadaný název nastavení neexistuje."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Nepovedlo se přidat obslužnou rutinu události."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Tento prohlížeč nepodporuje požadované rozhraní API."; +Strings.OfficeOM.L_InvalidAPICall = "Neplatné volání rozhraní API"; +Strings.OfficeOM.L_EventRegistrationError = "Chyba registrace události"; +Strings.OfficeOM.L_ElementMissing = "Nemohli jsme naformátovat buňku tabulky, protože chybí některé hodnoty parametrů. Ještě jednou zkontrolujte parametry a zkuste to znovu."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Parametry souřadnic nejde použít s převodem typu Tabulka, pokud tabulka obsahuje sloučené buňky."; +Strings.OfficeOM.L_NavOutOfBound = "Operace se nepovedla, protože index je mimo rozsah."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Zpětné volání nemůže být zadané v seznamu argumentů i ve volitelném objektu."; +Strings.OfficeOM.L_CustomXmlError = "Chyba vlastního kódu XML"; +Strings.OfficeOM.L_SettingsAreStale = "Nastavení se nepodařilo uložit, protože nejsou aktuální."; +Strings.OfficeOM.L_TooManyOptionalFunction = "více volitelných funkcí v seznamu parametrů"; +Strings.OfficeOM.L_MissingRequiredArguments = "chybí některé požadované argumenty"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Parametry souřadnic nejde použít s převodem typu Tabulka, pokud tabulka obsahuje sloučené buňky."; +Strings.OfficeOM.L_HostError = "Chyba hostitele"; +Strings.OfficeOM.L_OutOfRange = "Mimo rozsah"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Nejde vytvořit vazbu s aktuálním výběrem a zadaným typem vazby."; +Strings.OfficeOM.L_TooManyOptionalObjects = "více volitelných objektů v seznamu parametrů"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Vybraný obsah musí být ve formátu tabulky. Zformátujte data jako tabulku a zkuste to znovu."; +Strings.OfficeOM.L_APINotSupported = "API není podporované"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Zadaná velikost řezu není podporovaná."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Nepovedlo se odebrat obslužnou rutinu události."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Nesouvislé výběry nejsou podporované."; +Strings.OfficeOM.L_DataReadError = "Chyba čtení dat"; +Strings.OfficeOM.L_InternalErrorDescription = "Došlo k vnitřní chybě."; +Strings.OfficeOM.L_InvalidDataFormat = "Formát zadaného datového objektu je neplatný."; +Strings.OfficeOM.L_RequestTimeout = "Zpracování volání trvalo moc dlouho."; +Strings.OfficeOM.L_DataStale = "Neaktuální data"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Aktuální výběr není podporovaný."; +Strings.OfficeOM.L_MemoryLimit = "Překročený limit paměti"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Poznámka: Tabulka by neměla obsahovat víc než 20 000 buněk."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Minimálně jeden parametr tableOptions má hodnoty, které nejsou povolené. Překontrolujte hodnoty a zkuste to znovu."; +Strings.OfficeOM.L_PermissionDenied = "Oprávnění odepřena"; +Strings.OfficeOM.L_InvalidDataObject = "Neplatný datový objekt"; +Strings.OfficeOM.L_UserNotSignedIn = "Žádný uživatel není přihlášený v Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Nejde vytvořit vazbu na aktuální výběr."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Zadané sloupce jsou neplatné."; +Strings.OfficeOM.L_BadSelectorString = "Řetězec předaný selektoru je nesprávně naformátovaný nebo není podporovaný."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Zadané hodnoty rowCount nebo columnCount jsou neplatné."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Typ OsfControl není podporovaný."; +Strings.OfficeOM.L_InvalidValue = "Neplatná hodnota"; +Strings.OfficeOM.L_DataNotMatchSelection = "Zadaný datový objekt není kompatibilní s tvarem nebo rozměry aktuálního výběru."; +Strings.OfficeOM.L_InternalError = "Vnitřní chyba"; +Strings.OfficeOM.L_NotSupported = "Funkce {0} není podporovaná."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Zadaný uzel nejde najít."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Zadaný typ převodu není kompatibilní s tímto typem vazby."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Problémy se sítí zabránily načtení souboru."; +Strings.OfficeOM.L_TooManyArguments = "příliš mnoho argumentů"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Operace není u tohoto typu vazby podporovaná."; +Strings.OfficeOM.L_InValidOptionalArgument = "neplatný volitelný argument"; +Strings.OfficeOM.L_FileTypeNotSupported = "Zadaný typ souboru není podporovaný."; +Strings.OfficeOM.L_GetDataParametersConflict = "Zadané parametry způsobují konflikt."; +Strings.OfficeOM.L_CallbackNotAFunction = "Zpětné volání musí být typu funkce. Bylo typu {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/office_strings.js new file mode 100644 index 000000000..0201e3742 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Zadaný typ vazby není kompatibilní se zadanou pojmenovanou položkou.";Strings.OfficeOM.L_EventHandlerNotExist="Zadaná obslužná rutina událostí se pro tuto vazbu nenašla.";Strings.OfficeOM.L_UnknownBindingType="Tento typ vazby není podporovaný.";Strings.OfficeOM.L_InvalidNode="Neplatný uzel";Strings.OfficeOM.L_NotImplemented="Funkce {0} není implementovaná.";Strings.OfficeOM.L_NoCapability="K provedení této akce nemáte dostatečná oprávnění.";Strings.OfficeOM.L_SettingsCannotSave="Nastavení nejde uložit.";Strings.OfficeOM.L_DataWriteReminder="Připomenutí zápisu dat";Strings.OfficeOM.L_InvalidBinding="Neplatná vazba";Strings.OfficeOM.L_InvalidSetColumns="Zadané sloupce jsou neplatné.";Strings.OfficeOM.L_BindingCreationError="Chyba vytváření vazby";Strings.OfficeOM.L_FormatValueOutOfRange="Hodnota je mimo povolený rozsah.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Aktuální výběr není kompatibilní se zadaným typem převodu.";Strings.OfficeOM.L_InvalidBindingError="Chyba neplatné vazby";Strings.OfficeOM.L_InvalidGetStartRowColumn="Zadané hodnoty startRow nebo startColumn jsou neplatné.";Strings.OfficeOM.L_InvalidSetRows="Zadané řádky jsou neplatné.";Strings.OfficeOM.L_NetworkProblem="Problém se sítí";Strings.OfficeOM.L_CannotWriteToSelection="Do aktuálního výběru se nedá zapisovat.";Strings.OfficeOM.L_MissingParameter="Chybějící parametr";Strings.OfficeOM.L_IndexOutOfRange="Index je mimo rozsah.";Strings.OfficeOM.L_SettingsStaleError="Chyba zastaralých nastavení";Strings.OfficeOM.L_CannotNavigateTo="Objekt je v umístění, kde se nepodporuje navigace.";Strings.OfficeOM.L_ReadSettingsError="Chyba čtení nastavení";Strings.OfficeOM.L_InvalidGetColumns="Zadané sloupce jsou neplatné.";Strings.OfficeOM.L_CoercionTypeNotSupported="Zadaný typ převodu není podporovaný.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Aplikace {0} neexistuje. Nevolá se rutina Microsoft.Office.WebExtension.initialize(reason).";Strings.OfficeOM.L_OverwriteWorksheetData="Operace nastavení se nepovedla, protože zadaný datový objekt přepíše nebo posune data.";Strings.OfficeOM.L_RowIndexOutOfRange="Hodnota indexu řádku je mimo povolený rozsah. Použijte hodnotu (0 nebo vyšší), která je menší než počet řádků.";Strings.OfficeOM.L_InvalidReadForBlankRow="Zadaný řádek je prázdný.";Strings.OfficeOM.L_ColIndexOutOfRange="Hodnota indexu sloupce je mimo povolený rozsah. Použijte hodnotu (0 nebo vyšší), která je menší než počet sloupců.";Strings.OfficeOM.L_UnsupportedEnumeration="Nepodporovaný výčet";Strings.OfficeOM.L_InvalidParameters="Funkce {0} má neplatné parametry.";Strings.OfficeOM.L_SetDataParametersConflict="Zadané parametry způsobují konflikt.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Před načtením dalšího souboru volejte closeAsync pro aktuální soubor.";Strings.OfficeOM.L_DataNotMatchCoercionType="Typ zadaného datového objektu není kompatibilní s aktuálním výběrem.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Výčet není v aktuální hostitelské aplikaci podporovaný.";Strings.OfficeOM.L_InvalidCoercion="Neplatný typ převodu";Strings.OfficeOM.L_NotSupportedEventType="Zadaný typ události {0} není podporovaný.";Strings.OfficeOM.L_UnsupportedDataObject="Zadaný typ datového objektu není podporovaný.";Strings.OfficeOM.L_GetDataIsTooLarge="Požadovaná sada dat je moc velká.";Strings.OfficeOM.L_AppNameNotExist="AppName pro {0} neexistuje.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Vyberte něco, prosím.";Strings.OfficeOM.L_MultipleNamedItemFound="Našlo se více objektů se stejným názvem.";Strings.OfficeOM.L_InvalidCellsValue="Minimálně jeden parametr buňky má hodnoty, které nejsou povolené. Překontrolujte hodnoty a zkuste to znovu.";Strings.OfficeOM.L_DataNotMatchBindingType="Zadaný datový objekt není kompatibilní s typem vazby.";Strings.OfficeOM.L_InvalidFormatValue="Minimálně jeden parametr formátu má hodnoty, které nejsou povolené. Překontrolujte hodnoty a zkuste to znovu.";Strings.OfficeOM.L_NotSupportedBindingType="Zadaný typ vazby {0} není podporovaný.";Strings.OfficeOM.L_InitializeNotReady="Soubor Office.js ještě není úplně načtený. Zkuste to znovu později nebo přidejte inicializační kód do funkce Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Připomenutí formátování";Strings.OfficeOM.L_ShuttingDown="Operace se nepovedla, protože data na serveru nejsou aktuální.";Strings.OfficeOM.L_OperationNotSupported="Operace není podporovaná.";Strings.OfficeOM.L_DocumentReadOnly="Požadovaná operace není v aktuálním režimu dokumentu povolená.";Strings.OfficeOM.L_NamedItemNotFound="Pojmenovaná položka neexistuje.";Strings.OfficeOM.L_InvalidApiCallInContext="Neplatné volání rozhraní API v aktuálním kontextu";Strings.OfficeOM.L_InvalidGetRows="Zadané řádky jsou neplatné.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Poznámka: Přes volání formátovacího API by se nemělo nastavovat víc než 100 formátování.";Strings.OfficeOM.L_TooManyIncompleteRequests="Počkejte, než se dokončí předchozí volání.";Strings.OfficeOM.L_SetDataIsTooLarge="Zadaný datový objekt je moc velký.";Strings.OfficeOM.L_DataWriteError="Chyba zápisu dat";Strings.OfficeOM.L_InvalidBindingOperation="Neplatná operace vazby";Strings.OfficeOM.L_APICallFailed="Volání API selhalo";Strings.OfficeOM.L_SpecifiedIdNotExist="Zadané ID neexistuje.";Strings.OfficeOM.L_FunctionCallFailed="Volání funkce {0} se nepovedlo, kód chyby: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Zadaný datový objekt se neshoduje s velikostí aktuálního výběru.";Strings.OfficeOM.L_SaveSettingsError="Chyba ukládání nastavení";Strings.OfficeOM.L_RequestTokenUnavailable="Toto rozhraní API se omezilo, aby se zpomalila četnost volání.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Zadané hodnoty startRow nebo startColumn jsou neplatné.";Strings.OfficeOM.L_InvalidFormat="Chyba neplatného formátu";Strings.OfficeOM.L_BindingNotExist="Zadaná vazba neexistuje.";Strings.OfficeOM.L_SettingNameNotExist="Zadaný název nastavení neexistuje.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Nepovedlo se přidat obslužnou rutinu události.";Strings.OfficeOM.L_BrowserAPINotSupported="Tento prohlížeč nepodporuje požadované rozhraní API.";Strings.OfficeOM.L_InvalidAPICall="Neplatné volání rozhraní API";Strings.OfficeOM.L_EventRegistrationError="Chyba registrace události";Strings.OfficeOM.L_ElementMissing="Nemohli jsme naformátovat buňku tabulky, protože chybí některé hodnoty parametrů. Ještě jednou zkontrolujte parametry a zkuste to znovu.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Parametry souřadnic nejde použít s převodem typu Tabulka, pokud tabulka obsahuje sloučené buňky.";Strings.OfficeOM.L_NavOutOfBound="Operace se nepovedla, protože index je mimo rozsah.";Strings.OfficeOM.L_RedundantCallbackSpecification="Zpětné volání nemůže být zadané v seznamu argumentů i ve volitelném objektu.";Strings.OfficeOM.L_CustomXmlError="Chyba vlastního kódu XML";Strings.OfficeOM.L_SettingsAreStale="Nastavení se nepodařilo uložit, protože nejsou aktuální.";Strings.OfficeOM.L_TooManyOptionalFunction="více volitelných funkcí v seznamu parametrů";Strings.OfficeOM.L_MissingRequiredArguments="chybí některé požadované argumenty";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Parametry souřadnic nejde použít s převodem typu Tabulka, pokud tabulka obsahuje sloučené buňky.";Strings.OfficeOM.L_HostError="Chyba hostitele";Strings.OfficeOM.L_OutOfRange="Mimo rozsah";Strings.OfficeOM.L_InvalidSelectionForBindingType="Nejde vytvořit vazbu s aktuálním výběrem a zadaným typem vazby.";Strings.OfficeOM.L_TooManyOptionalObjects="více volitelných objektů v seznamu parametrů";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Vybraný obsah musí být ve formátu tabulky. Zformátujte data jako tabulku a zkuste to znovu.";Strings.OfficeOM.L_APINotSupported="API není podporované";Strings.OfficeOM.L_SliceSizeNotSupported="Zadaná velikost řezu není podporovaná.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Nepovedlo se odebrat obslužnou rutinu události.";Strings.OfficeOM.L_BindingToMultipleSelection="Nesouvislé výběry nejsou podporované.";Strings.OfficeOM.L_DataReadError="Chyba čtení dat";Strings.OfficeOM.L_InternalErrorDescription="Došlo k vnitřní chybě.";Strings.OfficeOM.L_InvalidDataFormat="Formát zadaného datového objektu je neplatný.";Strings.OfficeOM.L_RequestTimeout="Zpracování volání trvalo moc dlouho.";Strings.OfficeOM.L_DataStale="Neaktuální data";Strings.OfficeOM.L_GetSelectionNotSupported="Aktuální výběr není podporovaný.";Strings.OfficeOM.L_MemoryLimit="Překročený limit paměti";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Poznámka: Tabulka by neměla obsahovat víc než 20 000 buněk.";Strings.OfficeOM.L_InvalidTableOptionValue="Minimálně jeden parametr tableOptions má hodnoty, které nejsou povolené. Překontrolujte hodnoty a zkuste to znovu.";Strings.OfficeOM.L_PermissionDenied="Oprávnění odepřena";Strings.OfficeOM.L_InvalidDataObject="Neplatný datový objekt";Strings.OfficeOM.L_UserNotSignedIn="Žádný uživatel není přihlášený v Office.";Strings.OfficeOM.L_SelectionCannotBound="Nejde vytvořit vazbu na aktuální výběr.";Strings.OfficeOM.L_InvalidColumnsForBinding="Zadané sloupce jsou neplatné.";Strings.OfficeOM.L_BadSelectorString="Řetězec předaný selektoru je nesprávně naformátovaný nebo není podporovaný.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Zadané hodnoty rowCount nebo columnCount jsou neplatné.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Typ OsfControl není podporovaný.";Strings.OfficeOM.L_InvalidValue="Neplatná hodnota";Strings.OfficeOM.L_DataNotMatchSelection="Zadaný datový objekt není kompatibilní s tvarem nebo rozměry aktuálního výběru.";Strings.OfficeOM.L_InternalError="Vnitřní chyba";Strings.OfficeOM.L_NotSupported="Funkce {0} není podporovaná.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Zadaný uzel nejde najít.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Zadaný typ převodu není kompatibilní s tímto typem vazby.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Problémy se sítí zabránily načtení souboru.";Strings.OfficeOM.L_TooManyArguments="příliš mnoho argumentů";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operace není u tohoto typu vazby podporovaná.";Strings.OfficeOM.L_InValidOptionalArgument="neplatný volitelný argument";Strings.OfficeOM.L_FileTypeNotSupported="Zadaný typ souboru není podporovaný.";Strings.OfficeOM.L_GetDataParametersConflict="Zadané parametry způsobují konflikt.";Strings.OfficeOM.L_CallbackNotAFunction="Zpětné volání musí být typu funkce. Bylo typu {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/outlook_strings.debug.js new file mode 100644 index 000000000..bab3ed0ab --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Příloha se nedá odstranit, protože se nenašla příloha s indexem přílohy."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Požadavek nesmí být větší než 1 MB. Upravte svou žádost Webových služeb Exchange (EWS)."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Je potřeba, aby zvýšené oprávnění volalo metodu: {0}."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Chyba přílohy"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Koncové datum předchází počátečnímu datu."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Minimálně jeden ze zadaných zobrazovaných názvů je moc dlouhý."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Celkový počet příjemců v poli nesmí přesáhnout {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Sanitace HTML se nepovedla."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Chyba zápisu dat"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Pro přístup k chráněným členům rozhraní JavaScript API pro Office je potřeba zvýšené oprávnění. "; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Přílohy se nedají přidat, protože zpráva už má maximální možný počet příloh."; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Vnitřní chyba protokolu: {0}."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Před dokončením nahrávání uživatel odebral přílohu."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Hodnotu offset této časové známky není možné najít."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Příloha se nedá přidat, protože je moc velká."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Čas ukončení nesmí předcházet času zahájení."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Uvedené parametry neodpovídají očekávanému formátu."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Příloha se nedá přidat k položce."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Nebyli uvedení žádní příjemci."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ID přílohy není platné."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Přílohy se nedají přidat, když se ze serveru načítá celá odpověď nebo předání dál."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Minimálně jedna ze zadaných e-mailových adres je moc dlouhá."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Cesta k příloze není platná."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Příloha se nedá odstranit z položky."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Došlo k chybě vnitřního formátu."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Nebylo zadané platné datum."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Při vkládání dat uživatel změnil pozici kurzoru." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/outlook_strings.js new file mode 100644 index 000000000..20e646bf5 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/cs-cz/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Příloha se nedá odstranit, protože se nenašla příloha s indexem přílohy.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Požadavek nesmí být větší než 1 MB. Upravte svou žádost Webových služeb Exchange (EWS).";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Je potřeba, aby zvýšené oprávnění volalo metodu: {0}.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Chyba přílohy";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Koncové datum předchází počátečnímu datu.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Minimálně jeden ze zadaných zobrazovaných názvů je moc dlouhý.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Celkový počet příjemců v poli nesmí přesáhnout {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Sanitace HTML se nepovedla.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Chyba zápisu dat";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Pro přístup k chráněným členům rozhraní JavaScript API pro Office je potřeba zvýšené oprávnění. ";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Přílohy se nedají přidat, protože zpráva už má maximální možný počet příloh.";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Vnitřní chyba protokolu: {0}.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Před dokončením nahrávání uživatel odebral přílohu.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Hodnotu offset této časové známky není možné najít.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Příloha se nedá přidat, protože je moc velká.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Čas ukončení nesmí předcházet času zahájení.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Uvedené parametry neodpovídají očekávanému formátu.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Příloha se nedá přidat k položce.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Nebyli uvedení žádní příjemci.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ID přílohy není platné.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Přílohy se nedají přidat, když se ze serveru načítá celá odpověď nebo předání dál.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Minimálně jedna ze zadaných e-mailových adres je moc dlouhá.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Cesta k příloze není platná.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Příloha se nedá odstranit z položky.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Došlo k chybě vnitřního formátu.";_u.ExtensibilityStrings.l_InvalidDate_Text="Nebylo zadané platné datum.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Při vkládání dat uživatel změnil pozici kurzoru." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/office_strings.debug.js new file mode 100644 index 000000000..bfeb76ebf --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Den angivne bindingstype er ikke kompatibel med det navngivne element. "; +Strings.OfficeOM.L_EventHandlerNotExist = "Den angivne hændelseshandler blev ikke fundet for denne binding."; +Strings.OfficeOM.L_UnknownBindingType = "Bindingstypen understøttes ikke."; +Strings.OfficeOM.L_InvalidNode = "Ugyldig node"; +Strings.OfficeOM.L_NotImplemented = "Funktion {0} er ikke implementeret."; +Strings.OfficeOM.L_NoCapability = "Du har ikke tilstrækkelige rettigheder til at udføre denne handling."; +Strings.OfficeOM.L_SettingsCannotSave = "Indstillingerne kunne ikke gemmes."; +Strings.OfficeOM.L_DataWriteReminder = "Påmindelse om dataskrivning"; +Strings.OfficeOM.L_InvalidBinding = "Ugyldig binding"; +Strings.OfficeOM.L_InvalidSetColumns = "De angivne kolonner er ugyldige."; +Strings.OfficeOM.L_BindingCreationError = "Fejl ved oprettelse af binding"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Værdien er uden for det tilladte interval."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Den aktuelle markering er ikke kompatibel med den angivne type tvangsforanstaltning."; +Strings.OfficeOM.L_InvalidBindingError = "Ugyldig bindingsfejl"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "De angivne værdier for startRow eller startColumn er ugyldige."; +Strings.OfficeOM.L_InvalidSetRows = "De angivne rækker er ugyldige."; +Strings.OfficeOM.L_NetworkProblem = "Netværksproblem"; +Strings.OfficeOM.L_CannotWriteToSelection = "Der kan ikke skrives til det aktuelle valg."; +Strings.OfficeOM.L_MissingParameter = "Parameter mangler"; +Strings.OfficeOM.L_IndexOutOfRange = "Indeks er uden for område."; +Strings.OfficeOM.L_SettingsStaleError = "Fejl pga. forældede indstillinger"; +Strings.OfficeOM.L_CannotNavigateTo = "Objektet er placeret et sted, hvor navigation ikke understøttes."; +Strings.OfficeOM.L_ReadSettingsError = "Fejl ved læsning af indstillinger"; +Strings.OfficeOM.L_InvalidGetColumns = "De angivne kolonner er ugyldige."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Den angivne type tvangsforanstaltning understøttes ikke."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Programmet {0} findes ikke. Microsoft.Office.WebExtension.initialize(reason) er ikke kaldt."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Indstillingshandlingen mislykkedes, fordi det medfølgende dataobjekt vil overskrive eller skifte data."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Rækkeindeksværdien ligger uden for det tilladte interval. Brug en værdi (0 eller højere), som er lavere end antallet af rækker."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Den angivne række er tom."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Kolonneindeksværdien ligger uden for det tilladte interval. Brug en værdi (0 eller højere), som er lavere end antallet af kolonner."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Ikke-understøttet optælling"; +Strings.OfficeOM.L_InvalidParameters = "Funktion {0} har ugyldige parametre."; +Strings.OfficeOM.L_SetDataParametersConflict = "De angivne parametre er i konflikt."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Kald closeAsync i den aktuelle fil, før du henter en anden."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Typen for det angivne dataobjekt er ikke kompatibel med den aktuelle markering."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Optællingen understøttes ikke i det aktuelle værtsprogram."; +Strings.OfficeOM.L_InvalidCoercion = "Ugyldig type tvangsforanstaltning"; +Strings.OfficeOM.L_NotSupportedEventType = "Den angivne hændelsestype {0} understøttes ikke."; +Strings.OfficeOM.L_UnsupportedDataObject = "Det angivne dataobjekt understøttes ikke."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Det anmodede datasæt er for stort."; +Strings.OfficeOM.L_AppNameNotExist = "Programnavn til {0} findes ikke."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Foretag en markering."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Der er fundet flere objekter med samme navn."; +Strings.OfficeOM.L_InvalidCellsValue = "En eller flere af parametrene i cellerne har værdier, som ikke er tilladt. Dobbelttjek værdierne, og prøv igen."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Det angivne dataobjekt er ikke kompatibelt med bindingstypen."; +Strings.OfficeOM.L_InvalidFormatValue = "En eller flere af formatparametrene har værdier, som ikke er tilladt. Dobbelttjek værdierne, og prøv igen."; +Strings.OfficeOM.L_NotSupportedBindingType = "Den angivne bindingstype {0} understøttes ikke."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js er endnu ikke fuldt indlæst. Prøv igen senere, eller sørg for at tilføje din initialiseringskode i funktionen Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Påmindelse om formatering"; +Strings.OfficeOM.L_ShuttingDown = "Handlingen mislykkedes, fordi dataene ikke findes på serveren."; +Strings.OfficeOM.L_OperationNotSupported = "Handlingen understøttes ikke."; +Strings.OfficeOM.L_DocumentReadOnly = "Den ønskede handling er ikke tilladt i den aktuelle dokumenttilstand."; +Strings.OfficeOM.L_NamedItemNotFound = "Det navngivne element findes ikke."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Ugyldigt API-kald i den aktuelle kontekst."; +Strings.OfficeOM.L_InvalidGetRows = "De angivne rækker er ugyldige."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Bemærk! Det foreslås, at antallet af formateringssæt, der er angivet af et Formatting API-kald, er under 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Vent, indtil det forrige opkald er fuldført."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Det angivne dataobjekt er for stort."; +Strings.OfficeOM.L_DataWriteError = "Fejl i skrivning af data"; +Strings.OfficeOM.L_InvalidBindingOperation = "Ugyldig bindingshandling"; +Strings.OfficeOM.L_APICallFailed = "API-kald mislykkedes"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Det angivne id findes ikke."; +Strings.OfficeOM.L_FunctionCallFailed = "Kald til funktionen {0} mislykkedes, fejlkode: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Det angivne dataobjekt svarer ikke til størrelsen på den aktuelle markering."; +Strings.OfficeOM.L_SaveSettingsError = "Fejl ved lagring af indstillinger"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Denne API er blevet begrænset for at nedsætte opkaldshyppigheden."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "De angivne værdier for startRow eller startColumn er ugyldige."; +Strings.OfficeOM.L_InvalidFormat = "Ugyldigt format-fejl"; +Strings.OfficeOM.L_BindingNotExist = "Den angivne binding findes ikke."; +Strings.OfficeOM.L_SettingNameNotExist = "Den angivne indstilling findes ikke."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Hændelseshandleren blev ikke tilføjet."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Denne browser understøtter ikke den anmodede API."; +Strings.OfficeOM.L_InvalidAPICall = "Ugyldigt API-kald"; +Strings.OfficeOM.L_EventRegistrationError = "Fejl ved registrering af hændelse"; +Strings.OfficeOM.L_ElementMissing = "Vi kunne ikke formatere tabelcellen, fordi der mangler nogle parameterværdier. Dobbelttjek parametrene, og prøv igen."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Koordinatparametre kan ikke bruges med tvangsforanstaltningen af typen Tabel, hvis tabellen indeholder flettede celler."; +Strings.OfficeOM.L_NavOutOfBound = "Handlingen mislykkedes, fordi indekset er uden for området."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Der kan ikke specificeres tilbagekald både i argumentlisten og i valgfrit objekt."; +Strings.OfficeOM.L_CustomXmlError = "Brugerdefineret XML-fejl."; +Strings.OfficeOM.L_SettingsAreStale = "Indstillingerne kunne ikke gemmes, fordi de ikke er aktuelle."; +Strings.OfficeOM.L_TooManyOptionalFunction = "flere valgfrie funktioner på parameterliste"; +Strings.OfficeOM.L_MissingRequiredArguments = "en række obligatoriske argumenter mangler"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Koordinatparametre kan ikke bruges med tvangsforanstaltningen af typen Tabel, hvis tabellen indeholder flettede celler."; +Strings.OfficeOM.L_HostError = "Værtsfejl"; +Strings.OfficeOM.L_OutOfRange = "Uden for intervallet"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Der kan ikke oprettes en binding med den aktuelle markering og den angivne bindingstype."; +Strings.OfficeOM.L_TooManyOptionalObjects = "flere valgfrie objekter på parameterliste"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Markeret indhold skal være i tabelformat. Formatér dataene som en tabel, og prøv igen."; +Strings.OfficeOM.L_APINotSupported = "API understøttes ikke"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Den angivne udsnitsstørrelse understøttes ikke."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Hændelseshandleren blev ikke fjernet."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Ikke-sammenhængende markeringer understøttes ikke."; +Strings.OfficeOM.L_DataReadError = "Fejl i læsning af data"; +Strings.OfficeOM.L_InternalErrorDescription = "Der opstod en intern fejl."; +Strings.OfficeOM.L_InvalidDataFormat = "Formatet for det angivne dataobjekt er ugyldigt."; +Strings.OfficeOM.L_RequestTimeout = "Opkaldet tog for lang tid at udføre."; +Strings.OfficeOM.L_DataStale = "Data er ikke aktuelle"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Den aktuelle markering understøttes ikke."; +Strings.OfficeOM.L_MemoryLimit = "Hukommelsesgrænsen er overskredet"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Bemærk! Det foreslås, at antallet af celler i en tabel er under 20.000 celler."; +Strings.OfficeOM.L_InvalidTableOptionValue = "En eller flere af parametrene for TabelIndstillinger har værdier, som ikke er tilladt. Dobbelttjek værdierne, og prøv igen."; +Strings.OfficeOM.L_PermissionDenied = "Tilladelse nægtet"; +Strings.OfficeOM.L_InvalidDataObject = "Ugyldigt dataobjekt"; +Strings.OfficeOM.L_UserNotSignedIn = "Ingen bruger er logget på Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Den aktuelle markering kan ikke bindes."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "De angivne kolonner er ugyldige."; +Strings.OfficeOM.L_BadSelectorString = "Den streng, der er overført til vælgeren, er formateret forkert eller understøttes ikke."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "De angivne værdier for wowCount eller columnCount er ugyldige."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Typen OsfControl understøttes ikke."; +Strings.OfficeOM.L_InvalidValue = "Ugyldig værdi"; +Strings.OfficeOM.L_DataNotMatchSelection = "Det angivne dataobjekt er ikke kompatibelt med figuren eller målene i den aktuelle markering."; +Strings.OfficeOM.L_InternalError = "Intern fejl"; +Strings.OfficeOM.L_NotSupported = "Funktionen {0} understøttes ikke."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Den angivne node blev ikke fundet."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Den angivne type tvangsforanstaltning er ikke kompatibel med denne bindingstype."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Et netværksproblem har forhindret hentning af filen."; +Strings.OfficeOM.L_TooManyArguments = "for mange argumenter"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Handlingen understøttes ikke på denne bindingstype."; +Strings.OfficeOM.L_InValidOptionalArgument = "ugyldigt valgfrit argument"; +Strings.OfficeOM.L_FileTypeNotSupported = "Den angivne filtype understøttes ikke."; +Strings.OfficeOM.L_GetDataParametersConflict = "De angivne parametre er i konflikt."; +Strings.OfficeOM.L_CallbackNotAFunction = "Tilbagekald skal være af typen funktion, men var af typen {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/office_strings.js new file mode 100644 index 000000000..fe9d75e71 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Den angivne bindingstype er ikke kompatibel med det navngivne element. ";Strings.OfficeOM.L_EventHandlerNotExist="Den angivne hændelseshandler blev ikke fundet for denne binding.";Strings.OfficeOM.L_UnknownBindingType="Bindingstypen understøttes ikke.";Strings.OfficeOM.L_InvalidNode="Ugyldig node";Strings.OfficeOM.L_NotImplemented="Funktion {0} er ikke implementeret.";Strings.OfficeOM.L_NoCapability="Du har ikke tilstrækkelige rettigheder til at udføre denne handling.";Strings.OfficeOM.L_SettingsCannotSave="Indstillingerne kunne ikke gemmes.";Strings.OfficeOM.L_DataWriteReminder="Påmindelse om dataskrivning";Strings.OfficeOM.L_InvalidBinding="Ugyldig binding";Strings.OfficeOM.L_InvalidSetColumns="De angivne kolonner er ugyldige.";Strings.OfficeOM.L_BindingCreationError="Fejl ved oprettelse af binding";Strings.OfficeOM.L_FormatValueOutOfRange="Værdien er uden for det tilladte interval.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Den aktuelle markering er ikke kompatibel med den angivne type tvangsforanstaltning.";Strings.OfficeOM.L_InvalidBindingError="Ugyldig bindingsfejl";Strings.OfficeOM.L_InvalidGetStartRowColumn="De angivne værdier for startRow eller startColumn er ugyldige.";Strings.OfficeOM.L_InvalidSetRows="De angivne rækker er ugyldige.";Strings.OfficeOM.L_NetworkProblem="Netværksproblem";Strings.OfficeOM.L_CannotWriteToSelection="Der kan ikke skrives til det aktuelle valg.";Strings.OfficeOM.L_MissingParameter="Parameter mangler";Strings.OfficeOM.L_IndexOutOfRange="Indeks er uden for område.";Strings.OfficeOM.L_SettingsStaleError="Fejl pga. forældede indstillinger";Strings.OfficeOM.L_CannotNavigateTo="Objektet er placeret et sted, hvor navigation ikke understøttes.";Strings.OfficeOM.L_ReadSettingsError="Fejl ved læsning af indstillinger";Strings.OfficeOM.L_InvalidGetColumns="De angivne kolonner er ugyldige.";Strings.OfficeOM.L_CoercionTypeNotSupported="Den angivne type tvangsforanstaltning understøttes ikke.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Programmet {0} findes ikke. Microsoft.Office.WebExtension.initialize(reason) er ikke kaldt.";Strings.OfficeOM.L_OverwriteWorksheetData="Indstillingshandlingen mislykkedes, fordi det medfølgende dataobjekt vil overskrive eller skifte data.";Strings.OfficeOM.L_RowIndexOutOfRange="Rækkeindeksværdien ligger uden for det tilladte interval. Brug en værdi (0 eller højere), som er lavere end antallet af rækker.";Strings.OfficeOM.L_InvalidReadForBlankRow="Den angivne række er tom.";Strings.OfficeOM.L_ColIndexOutOfRange="Kolonneindeksværdien ligger uden for det tilladte interval. Brug en værdi (0 eller højere), som er lavere end antallet af kolonner.";Strings.OfficeOM.L_UnsupportedEnumeration="Ikke-understøttet optælling";Strings.OfficeOM.L_InvalidParameters="Funktion {0} har ugyldige parametre.";Strings.OfficeOM.L_SetDataParametersConflict="De angivne parametre er i konflikt.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Kald closeAsync i den aktuelle fil, før du henter en anden.";Strings.OfficeOM.L_DataNotMatchCoercionType="Typen for det angivne dataobjekt er ikke kompatibel med den aktuelle markering.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Optællingen understøttes ikke i det aktuelle værtsprogram.";Strings.OfficeOM.L_InvalidCoercion="Ugyldig type tvangsforanstaltning";Strings.OfficeOM.L_NotSupportedEventType="Den angivne hændelsestype {0} understøttes ikke.";Strings.OfficeOM.L_UnsupportedDataObject="Det angivne dataobjekt understøttes ikke.";Strings.OfficeOM.L_GetDataIsTooLarge="Det anmodede datasæt er for stort.";Strings.OfficeOM.L_AppNameNotExist="Programnavn til {0} findes ikke.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Foretag en markering.";Strings.OfficeOM.L_MultipleNamedItemFound="Der er fundet flere objekter med samme navn.";Strings.OfficeOM.L_InvalidCellsValue="En eller flere af parametrene i cellerne har værdier, som ikke er tilladt. Dobbelttjek værdierne, og prøv igen.";Strings.OfficeOM.L_DataNotMatchBindingType="Det angivne dataobjekt er ikke kompatibelt med bindingstypen.";Strings.OfficeOM.L_InvalidFormatValue="En eller flere af formatparametrene har værdier, som ikke er tilladt. Dobbelttjek værdierne, og prøv igen.";Strings.OfficeOM.L_NotSupportedBindingType="Den angivne bindingstype {0} understøttes ikke.";Strings.OfficeOM.L_InitializeNotReady="Office.js er endnu ikke fuldt indlæst. Prøv igen senere, eller sørg for at tilføje din initialiseringskode i funktionen Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Påmindelse om formatering";Strings.OfficeOM.L_ShuttingDown="Handlingen mislykkedes, fordi dataene ikke findes på serveren.";Strings.OfficeOM.L_OperationNotSupported="Handlingen understøttes ikke.";Strings.OfficeOM.L_DocumentReadOnly="Den ønskede handling er ikke tilladt i den aktuelle dokumenttilstand.";Strings.OfficeOM.L_NamedItemNotFound="Det navngivne element findes ikke.";Strings.OfficeOM.L_InvalidApiCallInContext="Ugyldigt API-kald i den aktuelle kontekst.";Strings.OfficeOM.L_InvalidGetRows="De angivne rækker er ugyldige.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Bemærk! Det foreslås, at antallet af formateringssæt, der er angivet af et Formatting API-kald, er under 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Vent, indtil det forrige opkald er fuldført.";Strings.OfficeOM.L_SetDataIsTooLarge="Det angivne dataobjekt er for stort.";Strings.OfficeOM.L_DataWriteError="Fejl i skrivning af data";Strings.OfficeOM.L_InvalidBindingOperation="Ugyldig bindingshandling";Strings.OfficeOM.L_APICallFailed="API-kald mislykkedes";Strings.OfficeOM.L_SpecifiedIdNotExist="Det angivne id findes ikke.";Strings.OfficeOM.L_FunctionCallFailed="Kald til funktionen {0} mislykkedes, fejlkode: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Det angivne dataobjekt svarer ikke til størrelsen på den aktuelle markering.";Strings.OfficeOM.L_SaveSettingsError="Fejl ved lagring af indstillinger";Strings.OfficeOM.L_RequestTokenUnavailable="Denne API er blevet begrænset for at nedsætte opkaldshyppigheden.";Strings.OfficeOM.L_InvalidSetStartRowColumn="De angivne værdier for startRow eller startColumn er ugyldige.";Strings.OfficeOM.L_InvalidFormat="Ugyldigt format-fejl";Strings.OfficeOM.L_BindingNotExist="Den angivne binding findes ikke.";Strings.OfficeOM.L_SettingNameNotExist="Den angivne indstilling findes ikke.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Hændelseshandleren blev ikke tilføjet.";Strings.OfficeOM.L_BrowserAPINotSupported="Denne browser understøtter ikke den anmodede API.";Strings.OfficeOM.L_InvalidAPICall="Ugyldigt API-kald";Strings.OfficeOM.L_EventRegistrationError="Fejl ved registrering af hændelse";Strings.OfficeOM.L_ElementMissing="Vi kunne ikke formatere tabelcellen, fordi der mangler nogle parameterværdier. Dobbelttjek parametrene, og prøv igen.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Koordinatparametre kan ikke bruges med tvangsforanstaltningen af typen Tabel, hvis tabellen indeholder flettede celler.";Strings.OfficeOM.L_NavOutOfBound="Handlingen mislykkedes, fordi indekset er uden for området.";Strings.OfficeOM.L_RedundantCallbackSpecification="Der kan ikke specificeres tilbagekald både i argumentlisten og i valgfrit objekt.";Strings.OfficeOM.L_CustomXmlError="Brugerdefineret XML-fejl.";Strings.OfficeOM.L_SettingsAreStale="Indstillingerne kunne ikke gemmes, fordi de ikke er aktuelle.";Strings.OfficeOM.L_TooManyOptionalFunction="flere valgfrie funktioner på parameterliste";Strings.OfficeOM.L_MissingRequiredArguments="en række obligatoriske argumenter mangler";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Koordinatparametre kan ikke bruges med tvangsforanstaltningen af typen Tabel, hvis tabellen indeholder flettede celler.";Strings.OfficeOM.L_HostError="Værtsfejl";Strings.OfficeOM.L_OutOfRange="Uden for intervallet";Strings.OfficeOM.L_InvalidSelectionForBindingType="Der kan ikke oprettes en binding med den aktuelle markering og den angivne bindingstype.";Strings.OfficeOM.L_TooManyOptionalObjects="flere valgfrie objekter på parameterliste";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Markeret indhold skal være i tabelformat. Formatér dataene som en tabel, og prøv igen.";Strings.OfficeOM.L_APINotSupported="API understøttes ikke";Strings.OfficeOM.L_SliceSizeNotSupported="Den angivne udsnitsstørrelse understøttes ikke.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Hændelseshandleren blev ikke fjernet.";Strings.OfficeOM.L_BindingToMultipleSelection="Ikke-sammenhængende markeringer understøttes ikke.";Strings.OfficeOM.L_DataReadError="Fejl i læsning af data";Strings.OfficeOM.L_InternalErrorDescription="Der opstod en intern fejl.";Strings.OfficeOM.L_InvalidDataFormat="Formatet for det angivne dataobjekt er ugyldigt.";Strings.OfficeOM.L_RequestTimeout="Opkaldet tog for lang tid at udføre.";Strings.OfficeOM.L_DataStale="Data er ikke aktuelle";Strings.OfficeOM.L_GetSelectionNotSupported="Den aktuelle markering understøttes ikke.";Strings.OfficeOM.L_MemoryLimit="Hukommelsesgrænsen er overskredet";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Bemærk! Det foreslås, at antallet af celler i en tabel er under 20.000 celler.";Strings.OfficeOM.L_InvalidTableOptionValue="En eller flere af parametrene for TabelIndstillinger har værdier, som ikke er tilladt. Dobbelttjek værdierne, og prøv igen.";Strings.OfficeOM.L_PermissionDenied="Tilladelse nægtet";Strings.OfficeOM.L_InvalidDataObject="Ugyldigt dataobjekt";Strings.OfficeOM.L_UserNotSignedIn="Ingen bruger er logget på Office.";Strings.OfficeOM.L_SelectionCannotBound="Den aktuelle markering kan ikke bindes.";Strings.OfficeOM.L_InvalidColumnsForBinding="De angivne kolonner er ugyldige.";Strings.OfficeOM.L_BadSelectorString="Den streng, der er overført til vælgeren, er formateret forkert eller understøttes ikke.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="De angivne værdier for wowCount eller columnCount er ugyldige.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Typen OsfControl understøttes ikke.";Strings.OfficeOM.L_InvalidValue="Ugyldig værdi";Strings.OfficeOM.L_DataNotMatchSelection="Det angivne dataobjekt er ikke kompatibelt med figuren eller målene i den aktuelle markering.";Strings.OfficeOM.L_InternalError="Intern fejl";Strings.OfficeOM.L_NotSupported="Funktionen {0} understøttes ikke.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Den angivne node blev ikke fundet.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Den angivne type tvangsforanstaltning er ikke kompatibel med denne bindingstype.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Et netværksproblem har forhindret hentning af filen.";Strings.OfficeOM.L_TooManyArguments="for mange argumenter";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Handlingen understøttes ikke på denne bindingstype.";Strings.OfficeOM.L_InValidOptionalArgument="ugyldigt valgfrit argument";Strings.OfficeOM.L_FileTypeNotSupported="Den angivne filtype understøttes ikke.";Strings.OfficeOM.L_GetDataParametersConflict="De angivne parametre er i konflikt.";Strings.OfficeOM.L_CallbackNotAFunction="Tilbagekald skal være af typen funktion, men var af typen {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/outlook_strings.debug.js new file mode 100644 index 000000000..43ac6929b --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Den vedhæftede fil kan ikke slettes, fordi den vedhæftede fil ikke kan findes med indekset for den vedhæftede fil."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Forespørgslen overskrider grænsen på 1 MB. Rediger EWS-anmodningen."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Der kræves administratorrettigheder for at kalde metoden: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Fejl ved vedhæftet fil"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Slutdatoen ligger før startdatoen."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Et eller flere af de viste navne , der er angivet, er for langt."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Det samlede antal modtagere i feltet må ikke overskride {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "HTML-santizationen mislykkedes."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Fejl i skrivning af data"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Der kræves administratorrettigheder for at få adgang til beskyttede medlemmer af JavaScript-API'en til Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Vedhæftede filer kan ikke tilføjes, fordi meddelelsen har allerede det maksimale antal vedhæftede filer"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Intern protokolfejl: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Brugeren fjernede den vedhæftede fil, før overførslen er fuldført."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Der blev ikke fundet en forskydning for dette tidsstempel."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Den vedhæftede fil kan ikke tilføjes, fordi den er for stor."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Sluttidspunktet kan ikke være før starttidspunktet."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "De angivne parametre svarer ikke til det forventede format."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Den vedhæftede fil kan ikke føjes til elementet."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Der blev ikke angivet nogen gyldige modtagere."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Den vedhæftede fils id var ugyldigt."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Vedhæftede filer kan ikke tilføjes, mens det fulde svar eller videresendelsen hentes fra serveren."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "En eller flere af de angivne mailadresser er for lang."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Stien for den vedhæftede fil var ugyldig."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Den vedhæftede fil kan ikke slettes fra elementet."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Der opstod en intern formatfejl."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Inputtet fortolkes ikke som en gyldig dato."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Brugeren ændrede placering af markøren, mens data blev indsat." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/outlook_strings.js new file mode 100644 index 000000000..b9aeb240b --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/da-dk/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Den vedhæftede fil kan ikke slettes, fordi den vedhæftede fil ikke kan findes med indekset for den vedhæftede fil.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Forespørgslen overskrider grænsen på 1 MB. Rediger EWS-anmodningen.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Der kræves administratorrettigheder for at kalde metoden: '{0}'.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Fejl ved vedhæftet fil";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Slutdatoen ligger før startdatoen.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Et eller flere af de viste navne , der er angivet, er for langt.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Det samlede antal modtagere i feltet må ikke overskride {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="HTML-santizationen mislykkedes.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Fejl i skrivning af data";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Der kræves administratorrettigheder for at få adgang til beskyttede medlemmer af JavaScript-API'en til Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Vedhæftede filer kan ikke tilføjes, fordi meddelelsen har allerede det maksimale antal vedhæftede filer";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Intern protokolfejl: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Brugeren fjernede den vedhæftede fil, før overførslen er fuldført.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Der blev ikke fundet en forskydning for dette tidsstempel.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Den vedhæftede fil kan ikke tilføjes, fordi den er for stor.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Sluttidspunktet kan ikke være før starttidspunktet.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="De angivne parametre svarer ikke til det forventede format.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Den vedhæftede fil kan ikke føjes til elementet.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Der blev ikke angivet nogen gyldige modtagere.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Den vedhæftede fils id var ugyldigt.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Vedhæftede filer kan ikke tilføjes, mens det fulde svar eller videresendelsen hentes fra serveren.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="En eller flere af de angivne mailadresser er for lang.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Stien for den vedhæftede fil var ugyldig.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Den vedhæftede fil kan ikke slettes fra elementet.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Der opstod en intern formatfejl.";_u.ExtensibilityStrings.l_InvalidDate_Text="Inputtet fortolkes ikke som en gyldig dato.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Brugeren ændrede placering af markøren, mens data blev indsat." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/office_strings.debug.js new file mode 100644 index 000000000..e3be91c01 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Der angegebene Bindungstyp ist mit dem angegebenen benannten Element nicht kompatibel."; +Strings.OfficeOM.L_EventHandlerNotExist = "Der angegebene Ereignishandler für diese Bindung wurde nicht gefunden."; +Strings.OfficeOM.L_UnknownBindingType = "Der Bindungstyp wird nicht unterstützt."; +Strings.OfficeOM.L_InvalidNode = "Ungültiger Knoten."; +Strings.OfficeOM.L_NotImplemented = "Funktion {0} ist nicht implementiert."; +Strings.OfficeOM.L_NoCapability = "Sie verfügen nicht über ausreichende Berechtigungen für diese Aktion."; +Strings.OfficeOM.L_SettingsCannotSave = "Die Einstellungen konnten nicht gespeichert werden."; +Strings.OfficeOM.L_DataWriteReminder = "Erinnerung zum Schreiben von Daten"; +Strings.OfficeOM.L_InvalidBinding = "Ungültige Bindung."; +Strings.OfficeOM.L_InvalidSetColumns = "Die angegebenen Spalten sind ungültig."; +Strings.OfficeOM.L_BindingCreationError = "Fehler beim Erstellen der Bindung."; +Strings.OfficeOM.L_FormatValueOutOfRange = "Der Wert liegt außerhalb des zulässigen Bereichs."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Die aktuelle Auswahl ist mit dem angegebenen Koersionstyp nicht kompatibel."; +Strings.OfficeOM.L_InvalidBindingError = "Fehler: Ungültige Bindung."; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Die angegebenen startRow- oder startColumn-Werte sind ungültig."; +Strings.OfficeOM.L_InvalidSetRows = "Die angegebenen Zeilen sind ungültig."; +Strings.OfficeOM.L_NetworkProblem = "Netzwerkproblem"; +Strings.OfficeOM.L_CannotWriteToSelection = "In die aktuelle Auswahl kann nicht geschrieben werden."; +Strings.OfficeOM.L_MissingParameter = "Fehlender Parameter"; +Strings.OfficeOM.L_IndexOutOfRange = "Index außerhalb des Gültigkeitsbereichs."; +Strings.OfficeOM.L_SettingsStaleError = "Fehler: Veraltete Einstellungen."; +Strings.OfficeOM.L_CannotNavigateTo = "Das Objekt befindet sich an einem Ort, wo keine Navigation unterstützt wird."; +Strings.OfficeOM.L_ReadSettingsError = "Fehler beim Lesen von Einstellungen."; +Strings.OfficeOM.L_InvalidGetColumns = "Die angegebenen Spalten sind ungültig."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Der angegebene Koersionstyp wird nicht unterstützt."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Die Anwendung {0} ist nicht vorhanden. Microsoft.Office.WebExtension.initialize(Ursache) wird nicht aufgerufen."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Fehler im festgelegten Vorgang, weil das bereitgestellte Datenobjekt Daten überschreiben oder verschieben würde."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Der Wert für den Zeilenindex liegt außerhalb des zulässigen Bereichs. Verwenden Sie einen Wert (0 oder höher), der kleiner als die Anzahl der Zeilen ist."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Die angegebene Zeile ist leer."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Der Wert für den Spaltenindex liegt außerhalb des zulässigen Bereichs. Verwenden Sie einen Wert (0 oder höher), der kleiner als die Anzahl der Spalten ist."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Nicht unterstützte Aufzählung"; +Strings.OfficeOM.L_InvalidParameters = "Funktion {0} hat ungültige Parameter."; +Strings.OfficeOM.L_SetDataParametersConflict = "Die angegebenen Parameter stehen in Konflikt."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = 'Rufen Sie "closeAsync" für die aktuelle Datei auf, bevor Sie eine weitere Datei abrufen.'; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Der Typ des angegebenen Datenobjekts ist mit der aktuellen Auswahl nicht kompatibel."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Die Aufzählung wird in der aktuellen Hostanwendung nicht unterstützt."; +Strings.OfficeOM.L_InvalidCoercion = "Ungültiger Koersionstyp."; +Strings.OfficeOM.L_NotSupportedEventType = 'Der angegebenen Ereignistyp "{0}" wird nicht unterstützt.'; +Strings.OfficeOM.L_UnsupportedDataObject = "Der bereitgestellte Datenobjekttyp wird nicht unterstützt."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Der angeforderte Datensatz ist zu groß."; +Strings.OfficeOM.L_AppNameNotExist = "AppName für {0} ist nicht vorhanden."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Bitte treffen Sie eine Auswahl."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Es wurden mehrere Objekte mit dem gleichen Namen gefunden."; +Strings.OfficeOM.L_InvalidCellsValue = 'Mindestens einer der "cells"-Parameter besitzt einen Wert, der nicht zulässig ist. Überprüfen Sie die Werte genau, und versuchen Sie es erneut.'; +Strings.OfficeOM.L_DataNotMatchBindingType = "Das angegebene Datenobjekt ist mit dem Bindungstyp nicht kompatibel."; +Strings.OfficeOM.L_InvalidFormatValue = 'Mindestens einer der "format"-Parameter besitzt einen Wert, der nicht zulässig ist. Überprüfen Sie die Werte genau, und versuchen Sie es erneut.'; +Strings.OfficeOM.L_NotSupportedBindingType = 'Der angegebene Bindungstyp "{0}" wird nicht unterstützt.'; +Strings.OfficeOM.L_InitializeNotReady = "Office.js wurde noch nicht vollständig geladen. Versuchen Sie es bitte später erneut, oder stellen Sie sicher, dass Ihr Initialisierungscode der Office.initialize-Funktion hinzugefügt wird."; +Strings.OfficeOM.L_FormattingReminder = "Formatierungserinnerung"; +Strings.OfficeOM.L_ShuttingDown = "Vorgangsfehler, weil die Daten auf dem Server nicht aktuell sind."; +Strings.OfficeOM.L_OperationNotSupported = "Dieser Vorgang wird nicht unterstützt."; +Strings.OfficeOM.L_DocumentReadOnly = "Der angeforderte Vorgang ist im aktuellen Dokumentmodus nicht zulässig."; +Strings.OfficeOM.L_NamedItemNotFound = "Das benannte Element ist nicht vorhanden."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Ungültiger API-Aufruf im aktuellen Kontext."; +Strings.OfficeOM.L_InvalidGetRows = "Die angegebenen Zeilen sind ungültig."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Hinweis: Die von einem Formatierungs-API-Aufruf festgelegten Formatierungssätze sollten unter 100 liegen."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Warten Sie, bis der vorherige Aufruf abgeschlossen ist."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Das angegebene Datenobjekt ist zu groß."; +Strings.OfficeOM.L_DataWriteError = "Fehler beim Schreiben von Daten."; +Strings.OfficeOM.L_InvalidBindingOperation = "Ungültiger Bindungsvorgang."; +Strings.OfficeOM.L_APICallFailed = "Fehler beim API-Aufruf."; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Die angegebene ID ist nicht vorhanden."; +Strings.OfficeOM.L_FunctionCallFailed = 'Fehler beim Aufrufen der Funktion "{0}". Fehlercode: {1}.'; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Das bereitgestellte Datenobjekt entspricht nicht der Größe der aktuellen Auswahl."; +Strings.OfficeOM.L_SaveSettingsError = "Fehler beim Speichern von Einstellungen."; +Strings.OfficeOM.L_RequestTokenUnavailable = "Diese API wurde eingeschränkt, um die Anrufhäufigkeit herabzusetzen."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Die angegebenen startRow- oder startColumn-Werte sind ungültig."; +Strings.OfficeOM.L_InvalidFormat = "Fehler: Ungültiges Format."; +Strings.OfficeOM.L_BindingNotExist = "Die angegebene Bindung ist nicht vorhanden."; +Strings.OfficeOM.L_SettingNameNotExist = "Der angegebene Einstellungsname ist nicht vorhanden."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Fehler beim Hinzufügen des Ereignishandlers."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Dieser Browser unterstützt die angeforderte API nicht."; +Strings.OfficeOM.L_InvalidAPICall = "Ungültiger API-Aufruf."; +Strings.OfficeOM.L_EventRegistrationError = "Ereignis-Registrierungsfehler"; +Strings.OfficeOM.L_ElementMissing = "Die Tabellenzelle konnte nicht formatiert werden, weil einige Parameterwerte fehlen. Überprüfen Sie die Werte genau, und versuchen Sie es erneut."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = 'Koordinatenparameter können nicht mit dem Koersionstyp "Tabelle" verwendet werden, wenn die Tabelle verbundene Zellen enthält.'; +Strings.OfficeOM.L_NavOutOfBound = "Vorgangsfehler, weil der Index außerhalb des Bereichs liegt."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Ein Rückruf kann nicht sowohl in der Argumenteliste als auch in einem optionalen Objekt angegeben werden."; +Strings.OfficeOM.L_CustomXmlError = "Benutzerdefiniertes XML-Fehler."; +Strings.OfficeOM.L_SettingsAreStale = "Einstellungen konnten nicht gespeichert werden, da sie nicht aktuell sind."; +Strings.OfficeOM.L_TooManyOptionalFunction = "mehrere optionale Funktionen in der Parameterliste"; +Strings.OfficeOM.L_MissingRequiredArguments = "fehlen einige erforderliche Argumente"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = 'Koordinatenparameter können nicht mit dem Koersionstyp "Tabelle" verwendet werden, wenn die Tabelle verbundene Zellen enthält.'; +Strings.OfficeOM.L_HostError = "Hostfehler"; +Strings.OfficeOM.L_OutOfRange = "Außerhalb des zulässigen Bereichs"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Eine Bindung kann nicht mit der aktuellen Auswahl und dem angegebenen Bindungstyp erstellt werden."; +Strings.OfficeOM.L_TooManyOptionalObjects = "mehrere optionale Objekte in der Parameterliste"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Die ausgewählten Inhalte müssen im Tabellenformat vorliegen. Formatieren Sie die Daten als Tabelle, und versuchen Sie es dann erneut."; +Strings.OfficeOM.L_APINotSupported = "Nicht unterstützte API."; +Strings.OfficeOM.L_SliceSizeNotSupported = "Die angegebene Datenschnittgröße wird nicht unterstützt."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Fehler beim Entfernen des Ereignishandlers."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Eine nicht zusammenhängende Auswahl wird nicht unterstützt."; +Strings.OfficeOM.L_DataReadError = "Fehler beim Lesen von Daten."; +Strings.OfficeOM.L_InternalErrorDescription = "Ein interner Fehler ist aufgetreten."; +Strings.OfficeOM.L_InvalidDataFormat = "Das Format des angegebenen Datenobjekts ist ungültig."; +Strings.OfficeOM.L_RequestTimeout = "Die Ausführung des Aufrufs hat zu lang gedauert."; +Strings.OfficeOM.L_DataStale = "Nicht aktuelle Daten"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Die aktuelle Auswahl wird nicht unterstützt."; +Strings.OfficeOM.L_MemoryLimit = "Arbeitsspeichergrenze überschritten"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Hinweis: Die Anzahl der Zellen in einer Tabelle sollte unter 20.000 Zellen liegen."; +Strings.OfficeOM.L_InvalidTableOptionValue = 'Mindestens einer der "tableOptions"-Parameter besitzt einen Wert, der nicht zulässig ist. Überprüfen Sie die Werte genau, und versuchen Sie es erneut.'; +Strings.OfficeOM.L_PermissionDenied = "Zugriff verweigert."; +Strings.OfficeOM.L_InvalidDataObject = "Ungültiges Datenobjekt."; +Strings.OfficeOM.L_UserNotSignedIn = "Kein Benutzer ist bei Office angemeldet."; +Strings.OfficeOM.L_SelectionCannotBound = "Eine Bindung an die aktuelle Auswahl ist nicht möglich."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Die angegebenen Spalten sind ungültig."; +Strings.OfficeOM.L_BadSelectorString = "Die an den Selektor übergebene Zeichenfolge ist nicht ordnungsgemäß formatiert oder wird nicht unterstützt."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Die angegebenen rowCount- oder columnCount-Werte sind ungültig."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Der OsfControl-Typ wird nicht unterstützt."; +Strings.OfficeOM.L_InvalidValue = "Ungültiger Wert"; +Strings.OfficeOM.L_DataNotMatchSelection = "Das bereitgestellte Datenobjekt ist mit der Form oder den Abmessungen der aktuellen Auswahl nicht kompatibel."; +Strings.OfficeOM.L_InternalError = "Interner Fehler"; +Strings.OfficeOM.L_NotSupported = 'Die Funktion "{0}" wird nicht unterstützt.'; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Der angegebene Knoten wurde nicht gefunden."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Der angegebenen Koersionstyp ist mit diesem Bindungstyp nicht kompatibel."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Ein Netzwerkproblem hat den Abruf der Datei verhindert."; +Strings.OfficeOM.L_TooManyArguments = "zu viele Argumente"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Der Vorgang wird für diesen Bindungstyp nicht unterstützt."; +Strings.OfficeOM.L_InValidOptionalArgument = "ungültiges optionales Argument"; +Strings.OfficeOM.L_FileTypeNotSupported = "Der angegebene Dateityp wird nicht unterstützt."; +Strings.OfficeOM.L_GetDataParametersConflict = "Die angegebenen Parameter stehen in Konflikt."; +Strings.OfficeOM.L_CallbackNotAFunction = 'Der Rückruf muss vom Typ "Funktion" sein, war aber vom Typ "{0}".' diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/office_strings.js new file mode 100644 index 000000000..dc019fa06 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Der angegebene Bindungstyp ist mit dem angegebenen benannten Element nicht kompatibel.";Strings.OfficeOM.L_EventHandlerNotExist="Der angegebene Ereignishandler für diese Bindung wurde nicht gefunden.";Strings.OfficeOM.L_UnknownBindingType="Der Bindungstyp wird nicht unterstützt.";Strings.OfficeOM.L_InvalidNode="Ungültiger Knoten.";Strings.OfficeOM.L_NotImplemented="Funktion {0} ist nicht implementiert.";Strings.OfficeOM.L_NoCapability="Sie verfügen nicht über ausreichende Berechtigungen für diese Aktion.";Strings.OfficeOM.L_SettingsCannotSave="Die Einstellungen konnten nicht gespeichert werden.";Strings.OfficeOM.L_DataWriteReminder="Erinnerung zum Schreiben von Daten";Strings.OfficeOM.L_InvalidBinding="Ungültige Bindung.";Strings.OfficeOM.L_InvalidSetColumns="Die angegebenen Spalten sind ungültig.";Strings.OfficeOM.L_BindingCreationError="Fehler beim Erstellen der Bindung.";Strings.OfficeOM.L_FormatValueOutOfRange="Der Wert liegt außerhalb des zulässigen Bereichs.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Die aktuelle Auswahl ist mit dem angegebenen Koersionstyp nicht kompatibel.";Strings.OfficeOM.L_InvalidBindingError="Fehler: Ungültige Bindung.";Strings.OfficeOM.L_InvalidGetStartRowColumn="Die angegebenen startRow- oder startColumn-Werte sind ungültig.";Strings.OfficeOM.L_InvalidSetRows="Die angegebenen Zeilen sind ungültig.";Strings.OfficeOM.L_NetworkProblem="Netzwerkproblem";Strings.OfficeOM.L_CannotWriteToSelection="In die aktuelle Auswahl kann nicht geschrieben werden.";Strings.OfficeOM.L_MissingParameter="Fehlender Parameter";Strings.OfficeOM.L_IndexOutOfRange="Index außerhalb des Gültigkeitsbereichs.";Strings.OfficeOM.L_SettingsStaleError="Fehler: Veraltete Einstellungen.";Strings.OfficeOM.L_CannotNavigateTo="Das Objekt befindet sich an einem Ort, wo keine Navigation unterstützt wird.";Strings.OfficeOM.L_ReadSettingsError="Fehler beim Lesen von Einstellungen.";Strings.OfficeOM.L_InvalidGetColumns="Die angegebenen Spalten sind ungültig.";Strings.OfficeOM.L_CoercionTypeNotSupported="Der angegebene Koersionstyp wird nicht unterstützt.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Die Anwendung {0} ist nicht vorhanden. Microsoft.Office.WebExtension.initialize(Ursache) wird nicht aufgerufen.";Strings.OfficeOM.L_OverwriteWorksheetData="Fehler im festgelegten Vorgang, weil das bereitgestellte Datenobjekt Daten überschreiben oder verschieben würde.";Strings.OfficeOM.L_RowIndexOutOfRange="Der Wert für den Zeilenindex liegt außerhalb des zulässigen Bereichs. Verwenden Sie einen Wert (0 oder höher), der kleiner als die Anzahl der Zeilen ist.";Strings.OfficeOM.L_InvalidReadForBlankRow="Die angegebene Zeile ist leer.";Strings.OfficeOM.L_ColIndexOutOfRange="Der Wert für den Spaltenindex liegt außerhalb des zulässigen Bereichs. Verwenden Sie einen Wert (0 oder höher), der kleiner als die Anzahl der Spalten ist.";Strings.OfficeOM.L_UnsupportedEnumeration="Nicht unterstützte Aufzählung";Strings.OfficeOM.L_InvalidParameters="Funktion {0} hat ungültige Parameter.";Strings.OfficeOM.L_SetDataParametersConflict="Die angegebenen Parameter stehen in Konflikt.";Strings.OfficeOM.L_CloseFileBeforeRetrieve='Rufen Sie "closeAsync" für die aktuelle Datei auf, bevor Sie eine weitere Datei abrufen.';Strings.OfficeOM.L_DataNotMatchCoercionType="Der Typ des angegebenen Datenobjekts ist mit der aktuellen Auswahl nicht kompatibel.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Die Aufzählung wird in der aktuellen Hostanwendung nicht unterstützt.";Strings.OfficeOM.L_InvalidCoercion="Ungültiger Koersionstyp.";Strings.OfficeOM.L_NotSupportedEventType='Der angegebenen Ereignistyp "{0}" wird nicht unterstützt.';Strings.OfficeOM.L_UnsupportedDataObject="Der bereitgestellte Datenobjekttyp wird nicht unterstützt.";Strings.OfficeOM.L_GetDataIsTooLarge="Der angeforderte Datensatz ist zu groß.";Strings.OfficeOM.L_AppNameNotExist="AppName für {0} ist nicht vorhanden.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Bitte treffen Sie eine Auswahl.";Strings.OfficeOM.L_MultipleNamedItemFound="Es wurden mehrere Objekte mit dem gleichen Namen gefunden.";Strings.OfficeOM.L_InvalidCellsValue='Mindestens einer der "cells"-Parameter besitzt einen Wert, der nicht zulässig ist. Überprüfen Sie die Werte genau, und versuchen Sie es erneut.';Strings.OfficeOM.L_DataNotMatchBindingType="Das angegebene Datenobjekt ist mit dem Bindungstyp nicht kompatibel.";Strings.OfficeOM.L_InvalidFormatValue='Mindestens einer der "format"-Parameter besitzt einen Wert, der nicht zulässig ist. Überprüfen Sie die Werte genau, und versuchen Sie es erneut.';Strings.OfficeOM.L_NotSupportedBindingType='Der angegebene Bindungstyp "{0}" wird nicht unterstützt.';Strings.OfficeOM.L_InitializeNotReady="Office.js wurde noch nicht vollständig geladen. Versuchen Sie es bitte später erneut, oder stellen Sie sicher, dass Ihr Initialisierungscode der Office.initialize-Funktion hinzugefügt wird.";Strings.OfficeOM.L_FormattingReminder="Formatierungserinnerung";Strings.OfficeOM.L_ShuttingDown="Vorgangsfehler, weil die Daten auf dem Server nicht aktuell sind.";Strings.OfficeOM.L_OperationNotSupported="Dieser Vorgang wird nicht unterstützt.";Strings.OfficeOM.L_DocumentReadOnly="Der angeforderte Vorgang ist im aktuellen Dokumentmodus nicht zulässig.";Strings.OfficeOM.L_NamedItemNotFound="Das benannte Element ist nicht vorhanden.";Strings.OfficeOM.L_InvalidApiCallInContext="Ungültiger API-Aufruf im aktuellen Kontext.";Strings.OfficeOM.L_InvalidGetRows="Die angegebenen Zeilen sind ungültig.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Hinweis: Die von einem Formatierungs-API-Aufruf festgelegten Formatierungssätze sollten unter 100 liegen.";Strings.OfficeOM.L_TooManyIncompleteRequests="Warten Sie, bis der vorherige Aufruf abgeschlossen ist.";Strings.OfficeOM.L_SetDataIsTooLarge="Das angegebene Datenobjekt ist zu groß.";Strings.OfficeOM.L_DataWriteError="Fehler beim Schreiben von Daten.";Strings.OfficeOM.L_InvalidBindingOperation="Ungültiger Bindungsvorgang.";Strings.OfficeOM.L_APICallFailed="Fehler beim API-Aufruf.";Strings.OfficeOM.L_SpecifiedIdNotExist="Die angegebene ID ist nicht vorhanden.";Strings.OfficeOM.L_FunctionCallFailed='Fehler beim Aufrufen der Funktion "{0}". Fehlercode: {1}.';Strings.OfficeOM.L_DataNotMatchBindingSize="Das bereitgestellte Datenobjekt entspricht nicht der Größe der aktuellen Auswahl.";Strings.OfficeOM.L_SaveSettingsError="Fehler beim Speichern von Einstellungen.";Strings.OfficeOM.L_RequestTokenUnavailable="Diese API wurde eingeschränkt, um die Anrufhäufigkeit herabzusetzen.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Die angegebenen startRow- oder startColumn-Werte sind ungültig.";Strings.OfficeOM.L_InvalidFormat="Fehler: Ungültiges Format.";Strings.OfficeOM.L_BindingNotExist="Die angegebene Bindung ist nicht vorhanden.";Strings.OfficeOM.L_SettingNameNotExist="Der angegebene Einstellungsname ist nicht vorhanden.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Fehler beim Hinzufügen des Ereignishandlers.";Strings.OfficeOM.L_BrowserAPINotSupported="Dieser Browser unterstützt die angeforderte API nicht.";Strings.OfficeOM.L_InvalidAPICall="Ungültiger API-Aufruf.";Strings.OfficeOM.L_EventRegistrationError="Ereignis-Registrierungsfehler";Strings.OfficeOM.L_ElementMissing="Die Tabellenzelle konnte nicht formatiert werden, weil einige Parameterwerte fehlen. Überprüfen Sie die Werte genau, und versuchen Sie es erneut.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported='Koordinatenparameter können nicht mit dem Koersionstyp "Tabelle" verwendet werden, wenn die Tabelle verbundene Zellen enthält.';Strings.OfficeOM.L_NavOutOfBound="Vorgangsfehler, weil der Index außerhalb des Bereichs liegt.";Strings.OfficeOM.L_RedundantCallbackSpecification="Ein Rückruf kann nicht sowohl in der Argumenteliste als auch in einem optionalen Objekt angegeben werden.";Strings.OfficeOM.L_CustomXmlError="Benutzerdefiniertes XML-Fehler.";Strings.OfficeOM.L_SettingsAreStale="Einstellungen konnten nicht gespeichert werden, da sie nicht aktuell sind.";Strings.OfficeOM.L_TooManyOptionalFunction="mehrere optionale Funktionen in der Parameterliste";Strings.OfficeOM.L_MissingRequiredArguments="fehlen einige erforderliche Argumente";Strings.OfficeOM.L_NonUniformPartialGetNotSupported='Koordinatenparameter können nicht mit dem Koersionstyp "Tabelle" verwendet werden, wenn die Tabelle verbundene Zellen enthält.';Strings.OfficeOM.L_HostError="Hostfehler";Strings.OfficeOM.L_OutOfRange="Außerhalb des zulässigen Bereichs";Strings.OfficeOM.L_InvalidSelectionForBindingType="Eine Bindung kann nicht mit der aktuellen Auswahl und dem angegebenen Bindungstyp erstellt werden.";Strings.OfficeOM.L_TooManyOptionalObjects="mehrere optionale Objekte in der Parameterliste";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Die ausgewählten Inhalte müssen im Tabellenformat vorliegen. Formatieren Sie die Daten als Tabelle, und versuchen Sie es dann erneut.";Strings.OfficeOM.L_APINotSupported="Nicht unterstützte API.";Strings.OfficeOM.L_SliceSizeNotSupported="Die angegebene Datenschnittgröße wird nicht unterstützt.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Fehler beim Entfernen des Ereignishandlers.";Strings.OfficeOM.L_BindingToMultipleSelection="Eine nicht zusammenhängende Auswahl wird nicht unterstützt.";Strings.OfficeOM.L_DataReadError="Fehler beim Lesen von Daten.";Strings.OfficeOM.L_InternalErrorDescription="Ein interner Fehler ist aufgetreten.";Strings.OfficeOM.L_InvalidDataFormat="Das Format des angegebenen Datenobjekts ist ungültig.";Strings.OfficeOM.L_RequestTimeout="Die Ausführung des Aufrufs hat zu lang gedauert.";Strings.OfficeOM.L_DataStale="Nicht aktuelle Daten";Strings.OfficeOM.L_GetSelectionNotSupported="Die aktuelle Auswahl wird nicht unterstützt.";Strings.OfficeOM.L_MemoryLimit="Arbeitsspeichergrenze überschritten";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Hinweis: Die Anzahl der Zellen in einer Tabelle sollte unter 20.000 Zellen liegen.";Strings.OfficeOM.L_InvalidTableOptionValue='Mindestens einer der "tableOptions"-Parameter besitzt einen Wert, der nicht zulässig ist. Überprüfen Sie die Werte genau, und versuchen Sie es erneut.';Strings.OfficeOM.L_PermissionDenied="Zugriff verweigert.";Strings.OfficeOM.L_InvalidDataObject="Ungültiges Datenobjekt.";Strings.OfficeOM.L_UserNotSignedIn="Kein Benutzer ist bei Office angemeldet.";Strings.OfficeOM.L_SelectionCannotBound="Eine Bindung an die aktuelle Auswahl ist nicht möglich.";Strings.OfficeOM.L_InvalidColumnsForBinding="Die angegebenen Spalten sind ungültig.";Strings.OfficeOM.L_BadSelectorString="Die an den Selektor übergebene Zeichenfolge ist nicht ordnungsgemäß formatiert oder wird nicht unterstützt.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Die angegebenen rowCount- oder columnCount-Werte sind ungültig.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Der OsfControl-Typ wird nicht unterstützt.";Strings.OfficeOM.L_InvalidValue="Ungültiger Wert";Strings.OfficeOM.L_DataNotMatchSelection="Das bereitgestellte Datenobjekt ist mit der Form oder den Abmessungen der aktuellen Auswahl nicht kompatibel.";Strings.OfficeOM.L_InternalError="Interner Fehler";Strings.OfficeOM.L_NotSupported='Die Funktion "{0}" wird nicht unterstützt.';Strings.OfficeOM.L_CustomXmlNodeNotFound="Der angegebene Knoten wurde nicht gefunden.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Der angegebenen Koersionstyp ist mit diesem Bindungstyp nicht kompatibel.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Ein Netzwerkproblem hat den Abruf der Datei verhindert.";Strings.OfficeOM.L_TooManyArguments="zu viele Argumente";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Der Vorgang wird für diesen Bindungstyp nicht unterstützt.";Strings.OfficeOM.L_InValidOptionalArgument="ungültiges optionales Argument";Strings.OfficeOM.L_FileTypeNotSupported="Der angegebene Dateityp wird nicht unterstützt.";Strings.OfficeOM.L_GetDataParametersConflict="Die angegebenen Parameter stehen in Konflikt.";Strings.OfficeOM.L_CallbackNotAFunction='Der Rückruf muss vom Typ "Funktion" sein, war aber vom Typ "{0}".' \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/outlook_strings.debug.js new file mode 100644 index 000000000..9b551b6d6 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Die Anlage kann nicht gelöscht werden, da keine Anlage mit diesem Anlageindex gefunden wurde."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Die Anforderung überschreitet die Größenbeschränkung von 1 MB. Ändern Sie Ihre EWS-Anforderung."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Für den Aufruf der Methode '{0}' sind erhöhte Rechte erforderlich."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Anlagefehler"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Das Ende liegt vor dem Beginn."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Mindestens einer der angegebenen Anzeigenamen ist zu lang."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Die Gesamtzahl der Empfänger im Feld kann {0} nicht überschreiten."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Fehler bei der HTML-Bereinigung"; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Fehler beim Schreiben von Daten"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Für den Zugriff auf geschützte Elemente des JavaScript-APIs für Office sind erhöhte Rechte erforderlich."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Anlagen können nicht hinzugefügt werden, da die Nachricht bereits die maximal zulässige Anzahl an Anlagen aufweist."; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Interner Protokollfehler: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Der Benutzer hat die Anlage entfernt, bevor der Upload abgeschlossen wurde."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Für diesen Zeitstempel wurde kein Offset gefunden."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Die Anlage kann nicht hinzugefügt werden, da sie zu groß ist."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Der Endzeitpunkt kann nicht vor dem Anfangszeitpunkt liegen."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Der angegebene Parameter weist nicht das erwartete Format auf."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Die Anlage kann dem Element nicht hinzugefügt werden."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Es wurden keine gültigen Empfänger angegeben."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Die Anlage-ID war ungültig."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Anlagen können nicht hinzugefügt werden, während die vollständige Antwort oder Weiterleitung vom Server abgerufen wird."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Mindestens eine der angegebenen E-Mail-Adressen ist zu lang."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Der Pfad zur Anlage war ungültig."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Die Anlage kann nicht aus dem Element gelöscht werden."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Interner Formatfehler"; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Die Eingabe kann nicht zu einem gültigen Datum aufgelöst werden."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Der Benutzer hat die Position des Cursors geändert, während die Daten eingefügt wurden." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/outlook_strings.js new file mode 100644 index 000000000..7aa884479 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/de-de/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Die Anlage kann nicht gelöscht werden, da keine Anlage mit diesem Anlageindex gefunden wurde.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Die Anforderung überschreitet die Größenbeschränkung von 1 MB. Ändern Sie Ihre EWS-Anforderung.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Für den Aufruf der Methode '{0}' sind erhöhte Rechte erforderlich.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Anlagefehler";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Das Ende liegt vor dem Beginn.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Mindestens einer der angegebenen Anzeigenamen ist zu lang.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Die Gesamtzahl der Empfänger im Feld kann {0} nicht überschreiten.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Fehler bei der HTML-Bereinigung";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Fehler beim Schreiben von Daten";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Für den Zugriff auf geschützte Elemente des JavaScript-APIs für Office sind erhöhte Rechte erforderlich.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Anlagen können nicht hinzugefügt werden, da die Nachricht bereits die maximal zulässige Anzahl an Anlagen aufweist.";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Interner Protokollfehler: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Der Benutzer hat die Anlage entfernt, bevor der Upload abgeschlossen wurde.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Für diesen Zeitstempel wurde kein Offset gefunden.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Die Anlage kann nicht hinzugefügt werden, da sie zu groß ist.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Der Endzeitpunkt kann nicht vor dem Anfangszeitpunkt liegen.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Der angegebene Parameter weist nicht das erwartete Format auf.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Die Anlage kann dem Element nicht hinzugefügt werden.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Es wurden keine gültigen Empfänger angegeben.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Die Anlage-ID war ungültig.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Anlagen können nicht hinzugefügt werden, während die vollständige Antwort oder Weiterleitung vom Server abgerufen wird.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Mindestens eine der angegebenen E-Mail-Adressen ist zu lang.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Der Pfad zur Anlage war ungültig.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Die Anlage kann nicht aus dem Element gelöscht werden.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Interner Formatfehler";_u.ExtensibilityStrings.l_InvalidDate_Text="Die Eingabe kann nicht zu einem gültigen Datum aufgelöst werden.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Der Benutzer hat die Position des Cursors geändert, während die Daten eingefügt wurden." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/office_strings.debug.js new file mode 100644 index 000000000..718905417 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Ο καθορισμένος τύπος σύνδεσης δεν είναι συμβατός με το καθορισμένο στοιχείο που δόθηκε."; +Strings.OfficeOM.L_EventHandlerNotExist = "Το καθορισμένο πρόγραμμα χειρισμού συμβάντων δεν βρέθηκε για αυτήν τη σύνδεση."; +Strings.OfficeOM.L_UnknownBindingType = "Ο τύπος σύνδεσης δεν υποστηρίζεται."; +Strings.OfficeOM.L_InvalidNode = "Μη έγκυρος κόμβος"; +Strings.OfficeOM.L_NotImplemented = "Η λειτουργία {0} δεν έχει υλοποιηθεί."; +Strings.OfficeOM.L_NoCapability = "Δεν έχετε επαρκή δικαιώματα για αυτή την ενέργεια."; +Strings.OfficeOM.L_SettingsCannotSave = "Δεν ήταν δυνατή η αποθήκευση των ρυθμίσεων."; +Strings.OfficeOM.L_DataWriteReminder = "Υπενθύμιση εγγραφής δεδομένων"; +Strings.OfficeOM.L_InvalidBinding = "Μη έγκυρη σύνδεση"; +Strings.OfficeOM.L_InvalidSetColumns = "Οι καθορισμένες στήλες δεν είναι έγκυρες."; +Strings.OfficeOM.L_BindingCreationError = "Σφάλμα δημιουργίας σύνδεσης"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Η τιμή είναι εκτός της επιτρεπόμενης περιοχής."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Η τρέχουσα επιλογή δεν είναι συμβατή με τον καθορισμένο τύπο αναγκαστικής μετατροπής."; +Strings.OfficeOM.L_InvalidBindingError = "Παρουσιάστηκε σφάλμα μη έγκυρης σύνδεσης"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Οι καθορισμένες τιμές startRow ή startColumn δεν είναι έγκυρες."; +Strings.OfficeOM.L_InvalidSetRows = "Οι καθορισμένες γραμμές δεν είναι έγκυρες."; +Strings.OfficeOM.L_NetworkProblem = "Πρόβλημα δικτύου"; +Strings.OfficeOM.L_CannotWriteToSelection = "Δεν είναι δυνατή η εγγραφή στην τρέχουσα επιλογή."; +Strings.OfficeOM.L_MissingParameter = "Λείπει παράμετρος"; +Strings.OfficeOM.L_IndexOutOfRange = "Δείκτης εκτός περιοχής."; +Strings.OfficeOM.L_SettingsStaleError = "Σφάλμα μη ενημερωμένων ρυθμίσεων"; +Strings.OfficeOM.L_CannotNavigateTo = "Το αντικείμενο βρίσκεται σε θέση όπου δεν υποστηρίζεται η περιήγηση."; +Strings.OfficeOM.L_ReadSettingsError = "Σφάλμα ρυθμίσεων ανάγνωσης"; +Strings.OfficeOM.L_InvalidGetColumns = "Οι καθορισμένες στήλες δεν είναι έγκυρες."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Ο καθορισμένος τύπος αναγκαστικής μετατροπής δεν υποστηρίζεται."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Η εφαρμογή {0} δεν υπάρχει. Δεν είναι δυνατή η κλήση του Microsoft.Office.WebExtension.Initialize(Reason)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Η λειτουργία ορισμού απέτυχε επειδή το αντικείμενο δεδομένων που δόθηκε θα αντικαταστήσει ή θα μετακινήσει δεδομένα."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Η τιμή δείκτη γραμμής βρίσκεται εκτός της επιτρεπόμενης περιοχής. Χρησιμοποιήστε μια τιμή (0 ή υψηλότερη) η οποία θα είναι μικρότερη από το πλήθος των γραμμών."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Η καθορισμένη γραμμή είναι κενή."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Η τιμή δείκτη στήλης βρίσκεται εκτός της επιτρεπόμενης περιοχής. Χρησιμοποιήστε μια τιμή (0 ή υψηλότερη) η οποία θα είναι μικρότερη από το πλήθος των στηλών."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Μη υποστηριζόμενη απαρίθμηση"; +Strings.OfficeOM.L_InvalidParameters = "Η συνάρτηση {0} έχει μη έγκυρες παραμέτρους."; +Strings.OfficeOM.L_SetDataParametersConflict = "Οι καθορισμένες παράμετροι παρουσιάζουν διένεξη."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Κλήση closeAsync στο τρέχον αρχείο πριν από την ανάκτηση άλλου."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Ο τύπος του καθορισμένου αντικειμένου δεδομένων δεν είναι συμβατός με την τρέχουσα επιλογή."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Η απαρίθμηση δεν υποστηρίζεται στην τρέχουσα εφαρμογή κεντρικού υπολογιστή."; +Strings.OfficeOM.L_InvalidCoercion = "Μη έγκυρος τύπος αναγκαστικής μετατροπής"; +Strings.OfficeOM.L_NotSupportedEventType = "Ο καθορισμένος τύπος συμβάντος {0} δεν υποστηρίζεται."; +Strings.OfficeOM.L_UnsupportedDataObject = "Ο τύπος του αντικειμένου δεδομένων που δόθηκε δεν υποστηρίζεται."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Το σύνολο δεδομένων που ζητήθηκε είναι πολύ μεγάλο."; +Strings.OfficeOM.L_AppNameNotExist = "Το AppName για {0} δεν υπάρχει."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Επιλέξτε."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Βρέθηκαν πολλά αντικείμενα με το ίδιο όνομα."; +Strings.OfficeOM.L_InvalidCellsValue = "Μία ή περισσότερες από τις παραμέτρους κελιών έχουν τιμές που δεν επιτρέπονται. Επαναλάβετε τον έλεγχο των τιμών και προσπαθήστε ξανά."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Το καθορισμένο αντικείμενο δεδομένων δεν είναι συμβατό με τον τύπο σύνδεσης."; +Strings.OfficeOM.L_InvalidFormatValue = "Μία ή περισσότερες από τις παραμέτρους μορφοποίησης έχουν τιμές που δεν επιτρέπονται. Επαναλάβετε τον έλεγχο των τιμών και προσπαθήστε ξανά."; +Strings.OfficeOM.L_NotSupportedBindingType = "Ο καθορισμένος τύπος σύνδεσης {0} δεν υποστηρίζεται."; +Strings.OfficeOM.L_InitializeNotReady = "Η φόρτωση του Office.js δεν έχει ολοκληρωθεί ακόμη. Προσπαθήστε ξανά αργότερα ή προσθέστε τον κώδικα προετοιμασίας στη συνάρτηση Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Υπενθύμιση μορφοποίησης"; +Strings.OfficeOM.L_ShuttingDown = "Η λειτουργία απέτυχε, επειδή τα δεδομένα στο διακομιστή δεν είναι ενημερωμένα."; +Strings.OfficeOM.L_OperationNotSupported = "Η λειτουργία δεν υποστηρίζεται."; +Strings.OfficeOM.L_DocumentReadOnly = "Η λειτουργία που ζητήθηκε δεν επιτρέπεται στην τρέχουσα κατάσταση του εγγράφου."; +Strings.OfficeOM.L_NamedItemNotFound = "Το καθορισμένο στοιχείο δεν υπάρχει."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Μη έγκυρη κλήση API στο τρέχον περιβάλλον."; +Strings.OfficeOM.L_InvalidGetRows = "Οι καθορισμένες γραμμές δεν είναι έγκυρες."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Σημείωση: Τα σύνολα μορφοποίησης που ορίζονται από μια κλήση Formatting API προτείνεται να είναι κάτω από 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Περιμένετε μέχρι να ολοκληρωθεί η προηγούμενη κλήση."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Το καθορισμένο σύνολο δεδομένων είναι πολύ μεγάλο."; +Strings.OfficeOM.L_DataWriteError = "Σφάλμα εγγραφής δεδομένων"; +Strings.OfficeOM.L_InvalidBindingOperation = "Μη έγκυρη λειτουργία σύνδεσης"; +Strings.OfficeOM.L_APICallFailed = "Απέτυχε η κλήση API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Το καθορισμένο αναγνωριστικό δεν υπάρχει."; +Strings.OfficeOM.L_FunctionCallFailed = "Η κλήση συνάρτησης {0} απέτυχε, κωδικός σφάλματος: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Το αντικείμενο δεδομένων που δόθηκε δεν αντιστοιχεί στο μέγεθος της τρέχουσας επιλογής."; +Strings.OfficeOM.L_SaveSettingsError = "Σφάλμα ρυθμίσεων αποθήκευσης"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Αυτό το API έχει ρυθμιστεί για τη μείωση της συχνότητας κλήσης."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Οι καθορισμένες τιμές startRow ή startColumn δεν είναι έγκυρες."; +Strings.OfficeOM.L_InvalidFormat = "Σφάλμα μη έγκυρης μορφής"; +Strings.OfficeOM.L_BindingNotExist = "Δεν υπάρχει η καθορισμένη σύνδεση."; +Strings.OfficeOM.L_SettingNameNotExist = "Δεν υπάρχει το όνομα της καθορισμένης ρύθμισης."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Απέτυχε η προσθήκη του προγράμματος χειρισμού συμβάντων."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Αυτό το πρόγραμμα περιήγησης δεν υποστηρίζει το API που ζητήθηκε."; +Strings.OfficeOM.L_InvalidAPICall = "Μη έγκυρη κλήση API"; +Strings.OfficeOM.L_EventRegistrationError = "Σφάλμα καταχώρησης συμβάντων"; +Strings.OfficeOM.L_ElementMissing = "Δεν μπορέσαμε να μορφοποιήσουμε το κελί πίνακα, επειδή λείπουν ορισμένες τιμές παραμέτρων. Επαναλάβετε τον έλεγχο των παραμέτρων και προσπαθήστε ξανά."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Οι παράμετροι συντεταγμένων δεν είναι δυνατό να χρησιμοποιηθούν με πίνακα τύπου αναγκαστικής μετατροπής όταν ο πίνακας περιέχει συγχωνευμένα κελιά."; +Strings.OfficeOM.L_NavOutOfBound = "Η λειτουργία απέτυχε επειδή ο δείκτης είναι εκτός περιοχής."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Η επιστροφή κλήσης δεν μπορεί να καθοριστεί ταυτόχρονα και στη λίστα ορισμάτων και στο προαιρετικό αντικείμενο."; +Strings.OfficeOM.L_CustomXmlError = "Σφάλμα προσαρμοσμένης XML."; +Strings.OfficeOM.L_SettingsAreStale = "Δεν ήταν δυνατή η αποθήκευση των ρυθμίσεων, επειδή δεν είναι ενημερωμένες."; +Strings.OfficeOM.L_TooManyOptionalFunction = "πολλές προαιρετικές συναρτήσεις στη λίστα παραμέτρων"; +Strings.OfficeOM.L_MissingRequiredArguments = "απουσιάζουν κάποια απαιτούμενα ορίσματα"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Οι παράμετροι συντεταγμένων δεν είναι δυνατό να χρησιμοποιηθούν με πίνακα τύπου αναγκαστικής μετατροπής όταν ο πίνακας περιέχει συγχωνευμένα κελιά."; +Strings.OfficeOM.L_HostError = "Σφάλμα υποδοχής"; +Strings.OfficeOM.L_OutOfRange = "Εκτός περιοχής"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Δεν είναι δυνατή η δημιουργία σύνδεσης με την τρέχουσα επιλογή και τον τύπο σύνδεσης που έχει οριστεί."; +Strings.OfficeOM.L_TooManyOptionalObjects = "πολλά προαιρετικά αντικείμενα στη λίστα παραμέτρων"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Το επιλεγμένο περιεχόμενο πρέπει να είναι σε μορφή πίνακα. Μορφοποιήστε τα δεδομένα ως πίνακα και προσπαθήστε ξανά."; +Strings.OfficeOM.L_APINotSupported = "Το API δεν υποστηρίζεται"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Το καθορισμένο μέγεθος φέτας δεν υποστηρίζεται."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Απέτυχε η κατάργηση του προγράμματος χειρισμού συμβάντων."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Οι μη συνεχόμενες επιλογές δεν υποστηρίζονται."; +Strings.OfficeOM.L_DataReadError = "Σφάλμα ανάγνωσης δεδομένων"; +Strings.OfficeOM.L_InternalErrorDescription = "Παρουσιάστηκε εσωτερικό σφάλμα."; +Strings.OfficeOM.L_InvalidDataFormat = "Η μορφή του καθορισμένου αντικειμένου δεδομένων δεν είναι έγκυρη."; +Strings.OfficeOM.L_RequestTimeout = "Η εκτέλεση της κλήσης καθυστέρησε."; +Strings.OfficeOM.L_DataStale = "Μη ενημερωμένα δεδομένα"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Η τρέχουσα επιλογή δεν υποστηρίζεται."; +Strings.OfficeOM.L_MemoryLimit = "Έγινε υπέρβαση του ορίου μνήμης"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Σημείωση: Το πλήθος των κελιών σε έναν πίνακα προτείνεται να είναι κάτω από 20.000 κελιά."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Μία ή περισσότερες από τις παραμέτρους tableOptions έχουν τιμές που δεν επιτρέπονται. Επαναλάβετε τον έλεγχο των τιμών και προσπαθήστε ξανά."; +Strings.OfficeOM.L_PermissionDenied = "Δεν έχετε δικαίωμα πρόσβασης"; +Strings.OfficeOM.L_InvalidDataObject = "Μη έγκυρο αντικείμενο δεδομένων"; +Strings.OfficeOM.L_UserNotSignedIn = "Κανένας χρήστης δεν έχει συνδεθεί στο Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Δεν είναι δυνατή η σύνδεση στην τρέχουσα επιλογή."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Οι καθορισμένες στήλες δεν είναι έγκυρες."; +Strings.OfficeOM.L_BadSelectorString = "Η συμβολοσειρά που περνά στον επιλογέα δεν είναι σωστά διαμορφωμένη ή δεν υποστηρίζεται."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Οι καθορισμένες τιμές της rowCount ή columnCount δεν είναι έγκυρες."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Ο τύπος OsfControl δεν υποστηρίζεται."; +Strings.OfficeOM.L_InvalidValue = "Μη έγκυρη τιμή"; +Strings.OfficeOM.L_DataNotMatchSelection = "Το αντικείμενο δεδομένων που δόθηκε δεν είναι συμβατό με το σχήμα ή τις διαστάσεις της τρέχουσας επιλογής."; +Strings.OfficeOM.L_InternalError = "Εσωτερικό σφάλμα"; +Strings.OfficeOM.L_NotSupported = "Η συνάρτηση {0} δεν υποστηρίζεται."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Ο καθορισμένος κόμβος δεν βρέθηκε."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Ο καθορισμένος τύπος αναγκαστικής μετατροπής δεν είναι συμβατός με αυτόν τον τύπο σύνδεσης."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Ένα πρόβλημα δικτύου εμπόδισε την ανάκτηση του αρχείου."; +Strings.OfficeOM.L_TooManyArguments = "πάρα πολλά ορίσματα"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Η λειτουργία δεν υποστηρίζεται σε αυτόν τον τύπο σύνδεσης."; +Strings.OfficeOM.L_InValidOptionalArgument = "μη έγκυρο προαιρετικό όρισμα"; +Strings.OfficeOM.L_FileTypeNotSupported = "Ο καθορισμένος τύπος αρχείου δεν υποστηρίζεται."; +Strings.OfficeOM.L_GetDataParametersConflict = "Οι καθορισμένες παράμετροι παρουσιάζουν διένεξη."; +Strings.OfficeOM.L_CallbackNotAFunction = "Η επιστροφή κλήσης πρέπει να είναι τύπου συνάρτησης, ήταν τύπου {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/office_strings.js new file mode 100644 index 000000000..b2f49a199 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Ο καθορισμένος τύπος σύνδεσης δεν είναι συμβατός με το καθορισμένο στοιχείο που δόθηκε.";Strings.OfficeOM.L_EventHandlerNotExist="Το καθορισμένο πρόγραμμα χειρισμού συμβάντων δεν βρέθηκε για αυτήν τη σύνδεση.";Strings.OfficeOM.L_UnknownBindingType="Ο τύπος σύνδεσης δεν υποστηρίζεται.";Strings.OfficeOM.L_InvalidNode="Μη έγκυρος κόμβος";Strings.OfficeOM.L_NotImplemented="Η λειτουργία {0} δεν έχει υλοποιηθεί.";Strings.OfficeOM.L_NoCapability="Δεν έχετε επαρκή δικαιώματα για αυτή την ενέργεια.";Strings.OfficeOM.L_SettingsCannotSave="Δεν ήταν δυνατή η αποθήκευση των ρυθμίσεων.";Strings.OfficeOM.L_DataWriteReminder="Υπενθύμιση εγγραφής δεδομένων";Strings.OfficeOM.L_InvalidBinding="Μη έγκυρη σύνδεση";Strings.OfficeOM.L_InvalidSetColumns="Οι καθορισμένες στήλες δεν είναι έγκυρες.";Strings.OfficeOM.L_BindingCreationError="Σφάλμα δημιουργίας σύνδεσης";Strings.OfficeOM.L_FormatValueOutOfRange="Η τιμή είναι εκτός της επιτρεπόμενης περιοχής.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Η τρέχουσα επιλογή δεν είναι συμβατή με τον καθορισμένο τύπο αναγκαστικής μετατροπής.";Strings.OfficeOM.L_InvalidBindingError="Παρουσιάστηκε σφάλμα μη έγκυρης σύνδεσης";Strings.OfficeOM.L_InvalidGetStartRowColumn="Οι καθορισμένες τιμές startRow ή startColumn δεν είναι έγκυρες.";Strings.OfficeOM.L_InvalidSetRows="Οι καθορισμένες γραμμές δεν είναι έγκυρες.";Strings.OfficeOM.L_NetworkProblem="Πρόβλημα δικτύου";Strings.OfficeOM.L_CannotWriteToSelection="Δεν είναι δυνατή η εγγραφή στην τρέχουσα επιλογή.";Strings.OfficeOM.L_MissingParameter="Λείπει παράμετρος";Strings.OfficeOM.L_IndexOutOfRange="Δείκτης εκτός περιοχής.";Strings.OfficeOM.L_SettingsStaleError="Σφάλμα μη ενημερωμένων ρυθμίσεων";Strings.OfficeOM.L_CannotNavigateTo="Το αντικείμενο βρίσκεται σε θέση όπου δεν υποστηρίζεται η περιήγηση.";Strings.OfficeOM.L_ReadSettingsError="Σφάλμα ρυθμίσεων ανάγνωσης";Strings.OfficeOM.L_InvalidGetColumns="Οι καθορισμένες στήλες δεν είναι έγκυρες.";Strings.OfficeOM.L_CoercionTypeNotSupported="Ο καθορισμένος τύπος αναγκαστικής μετατροπής δεν υποστηρίζεται.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Η εφαρμογή {0} δεν υπάρχει. Δεν είναι δυνατή η κλήση του Microsoft.Office.WebExtension.Initialize(Reason).";Strings.OfficeOM.L_OverwriteWorksheetData="Η λειτουργία ορισμού απέτυχε επειδή το αντικείμενο δεδομένων που δόθηκε θα αντικαταστήσει ή θα μετακινήσει δεδομένα.";Strings.OfficeOM.L_RowIndexOutOfRange="Η τιμή δείκτη γραμμής βρίσκεται εκτός της επιτρεπόμενης περιοχής. Χρησιμοποιήστε μια τιμή (0 ή υψηλότερη) η οποία θα είναι μικρότερη από το πλήθος των γραμμών.";Strings.OfficeOM.L_InvalidReadForBlankRow="Η καθορισμένη γραμμή είναι κενή.";Strings.OfficeOM.L_ColIndexOutOfRange="Η τιμή δείκτη στήλης βρίσκεται εκτός της επιτρεπόμενης περιοχής. Χρησιμοποιήστε μια τιμή (0 ή υψηλότερη) η οποία θα είναι μικρότερη από το πλήθος των στηλών.";Strings.OfficeOM.L_UnsupportedEnumeration="Μη υποστηριζόμενη απαρίθμηση";Strings.OfficeOM.L_InvalidParameters="Η συνάρτηση {0} έχει μη έγκυρες παραμέτρους.";Strings.OfficeOM.L_SetDataParametersConflict="Οι καθορισμένες παράμετροι παρουσιάζουν διένεξη.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Κλήση closeAsync στο τρέχον αρχείο πριν από την ανάκτηση άλλου.";Strings.OfficeOM.L_DataNotMatchCoercionType="Ο τύπος του καθορισμένου αντικειμένου δεδομένων δεν είναι συμβατός με την τρέχουσα επιλογή.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Η απαρίθμηση δεν υποστηρίζεται στην τρέχουσα εφαρμογή κεντρικού υπολογιστή.";Strings.OfficeOM.L_InvalidCoercion="Μη έγκυρος τύπος αναγκαστικής μετατροπής";Strings.OfficeOM.L_NotSupportedEventType="Ο καθορισμένος τύπος συμβάντος {0} δεν υποστηρίζεται.";Strings.OfficeOM.L_UnsupportedDataObject="Ο τύπος του αντικειμένου δεδομένων που δόθηκε δεν υποστηρίζεται.";Strings.OfficeOM.L_GetDataIsTooLarge="Το σύνολο δεδομένων που ζητήθηκε είναι πολύ μεγάλο.";Strings.OfficeOM.L_AppNameNotExist="Το AppName για {0} δεν υπάρχει.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Επιλέξτε.";Strings.OfficeOM.L_MultipleNamedItemFound="Βρέθηκαν πολλά αντικείμενα με το ίδιο όνομα.";Strings.OfficeOM.L_InvalidCellsValue="Μία ή περισσότερες από τις παραμέτρους κελιών έχουν τιμές που δεν επιτρέπονται. Επαναλάβετε τον έλεγχο των τιμών και προσπαθήστε ξανά.";Strings.OfficeOM.L_DataNotMatchBindingType="Το καθορισμένο αντικείμενο δεδομένων δεν είναι συμβατό με τον τύπο σύνδεσης.";Strings.OfficeOM.L_InvalidFormatValue="Μία ή περισσότερες από τις παραμέτρους μορφοποίησης έχουν τιμές που δεν επιτρέπονται. Επαναλάβετε τον έλεγχο των τιμών και προσπαθήστε ξανά.";Strings.OfficeOM.L_NotSupportedBindingType="Ο καθορισμένος τύπος σύνδεσης {0} δεν υποστηρίζεται.";Strings.OfficeOM.L_InitializeNotReady="Η φόρτωση του Office.js δεν έχει ολοκληρωθεί ακόμη. Προσπαθήστε ξανά αργότερα ή προσθέστε τον κώδικα προετοιμασίας στη συνάρτηση Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Υπενθύμιση μορφοποίησης";Strings.OfficeOM.L_ShuttingDown="Η λειτουργία απέτυχε, επειδή τα δεδομένα στο διακομιστή δεν είναι ενημερωμένα.";Strings.OfficeOM.L_OperationNotSupported="Η λειτουργία δεν υποστηρίζεται.";Strings.OfficeOM.L_DocumentReadOnly="Η λειτουργία που ζητήθηκε δεν επιτρέπεται στην τρέχουσα κατάσταση του εγγράφου.";Strings.OfficeOM.L_NamedItemNotFound="Το καθορισμένο στοιχείο δεν υπάρχει.";Strings.OfficeOM.L_InvalidApiCallInContext="Μη έγκυρη κλήση API στο τρέχον περιβάλλον.";Strings.OfficeOM.L_InvalidGetRows="Οι καθορισμένες γραμμές δεν είναι έγκυρες.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Σημείωση: Τα σύνολα μορφοποίησης που ορίζονται από μια κλήση Formatting API προτείνεται να είναι κάτω από 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Περιμένετε μέχρι να ολοκληρωθεί η προηγούμενη κλήση.";Strings.OfficeOM.L_SetDataIsTooLarge="Το καθορισμένο σύνολο δεδομένων είναι πολύ μεγάλο.";Strings.OfficeOM.L_DataWriteError="Σφάλμα εγγραφής δεδομένων";Strings.OfficeOM.L_InvalidBindingOperation="Μη έγκυρη λειτουργία σύνδεσης";Strings.OfficeOM.L_APICallFailed="Απέτυχε η κλήση API";Strings.OfficeOM.L_SpecifiedIdNotExist="Το καθορισμένο αναγνωριστικό δεν υπάρχει.";Strings.OfficeOM.L_FunctionCallFailed="Η κλήση συνάρτησης {0} απέτυχε, κωδικός σφάλματος: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Το αντικείμενο δεδομένων που δόθηκε δεν αντιστοιχεί στο μέγεθος της τρέχουσας επιλογής.";Strings.OfficeOM.L_SaveSettingsError="Σφάλμα ρυθμίσεων αποθήκευσης";Strings.OfficeOM.L_RequestTokenUnavailable="Αυτό το API έχει ρυθμιστεί για τη μείωση της συχνότητας κλήσης.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Οι καθορισμένες τιμές startRow ή startColumn δεν είναι έγκυρες.";Strings.OfficeOM.L_InvalidFormat="Σφάλμα μη έγκυρης μορφής";Strings.OfficeOM.L_BindingNotExist="Δεν υπάρχει η καθορισμένη σύνδεση.";Strings.OfficeOM.L_SettingNameNotExist="Δεν υπάρχει το όνομα της καθορισμένης ρύθμισης.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Απέτυχε η προσθήκη του προγράμματος χειρισμού συμβάντων.";Strings.OfficeOM.L_BrowserAPINotSupported="Αυτό το πρόγραμμα περιήγησης δεν υποστηρίζει το API που ζητήθηκε.";Strings.OfficeOM.L_InvalidAPICall="Μη έγκυρη κλήση API";Strings.OfficeOM.L_EventRegistrationError="Σφάλμα καταχώρησης συμβάντων";Strings.OfficeOM.L_ElementMissing="Δεν μπορέσαμε να μορφοποιήσουμε το κελί πίνακα, επειδή λείπουν ορισμένες τιμές παραμέτρων. Επαναλάβετε τον έλεγχο των παραμέτρων και προσπαθήστε ξανά.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Οι παράμετροι συντεταγμένων δεν είναι δυνατό να χρησιμοποιηθούν με πίνακα τύπου αναγκαστικής μετατροπής όταν ο πίνακας περιέχει συγχωνευμένα κελιά.";Strings.OfficeOM.L_NavOutOfBound="Η λειτουργία απέτυχε επειδή ο δείκτης είναι εκτός περιοχής.";Strings.OfficeOM.L_RedundantCallbackSpecification="Η επιστροφή κλήσης δεν μπορεί να καθοριστεί ταυτόχρονα και στη λίστα ορισμάτων και στο προαιρετικό αντικείμενο.";Strings.OfficeOM.L_CustomXmlError="Σφάλμα προσαρμοσμένης XML.";Strings.OfficeOM.L_SettingsAreStale="Δεν ήταν δυνατή η αποθήκευση των ρυθμίσεων, επειδή δεν είναι ενημερωμένες.";Strings.OfficeOM.L_TooManyOptionalFunction="πολλές προαιρετικές συναρτήσεις στη λίστα παραμέτρων";Strings.OfficeOM.L_MissingRequiredArguments="απουσιάζουν κάποια απαιτούμενα ορίσματα";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Οι παράμετροι συντεταγμένων δεν είναι δυνατό να χρησιμοποιηθούν με πίνακα τύπου αναγκαστικής μετατροπής όταν ο πίνακας περιέχει συγχωνευμένα κελιά.";Strings.OfficeOM.L_HostError="Σφάλμα υποδοχής";Strings.OfficeOM.L_OutOfRange="Εκτός περιοχής";Strings.OfficeOM.L_InvalidSelectionForBindingType="Δεν είναι δυνατή η δημιουργία σύνδεσης με την τρέχουσα επιλογή και τον τύπο σύνδεσης που έχει οριστεί.";Strings.OfficeOM.L_TooManyOptionalObjects="πολλά προαιρετικά αντικείμενα στη λίστα παραμέτρων";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Το επιλεγμένο περιεχόμενο πρέπει να είναι σε μορφή πίνακα. Μορφοποιήστε τα δεδομένα ως πίνακα και προσπαθήστε ξανά.";Strings.OfficeOM.L_APINotSupported="Το API δεν υποστηρίζεται";Strings.OfficeOM.L_SliceSizeNotSupported="Το καθορισμένο μέγεθος φέτας δεν υποστηρίζεται.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Απέτυχε η κατάργηση του προγράμματος χειρισμού συμβάντων.";Strings.OfficeOM.L_BindingToMultipleSelection="Οι μη συνεχόμενες επιλογές δεν υποστηρίζονται.";Strings.OfficeOM.L_DataReadError="Σφάλμα ανάγνωσης δεδομένων";Strings.OfficeOM.L_InternalErrorDescription="Παρουσιάστηκε εσωτερικό σφάλμα.";Strings.OfficeOM.L_InvalidDataFormat="Η μορφή του καθορισμένου αντικειμένου δεδομένων δεν είναι έγκυρη.";Strings.OfficeOM.L_RequestTimeout="Η εκτέλεση της κλήσης καθυστέρησε.";Strings.OfficeOM.L_DataStale="Μη ενημερωμένα δεδομένα";Strings.OfficeOM.L_GetSelectionNotSupported="Η τρέχουσα επιλογή δεν υποστηρίζεται.";Strings.OfficeOM.L_MemoryLimit="Έγινε υπέρβαση του ορίου μνήμης";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Σημείωση: Το πλήθος των κελιών σε έναν πίνακα προτείνεται να είναι κάτω από 20.000 κελιά.";Strings.OfficeOM.L_InvalidTableOptionValue="Μία ή περισσότερες από τις παραμέτρους tableOptions έχουν τιμές που δεν επιτρέπονται. Επαναλάβετε τον έλεγχο των τιμών και προσπαθήστε ξανά.";Strings.OfficeOM.L_PermissionDenied="Δεν έχετε δικαίωμα πρόσβασης";Strings.OfficeOM.L_InvalidDataObject="Μη έγκυρο αντικείμενο δεδομένων";Strings.OfficeOM.L_UserNotSignedIn="Κανένας χρήστης δεν έχει συνδεθεί στο Office.";Strings.OfficeOM.L_SelectionCannotBound="Δεν είναι δυνατή η σύνδεση στην τρέχουσα επιλογή.";Strings.OfficeOM.L_InvalidColumnsForBinding="Οι καθορισμένες στήλες δεν είναι έγκυρες.";Strings.OfficeOM.L_BadSelectorString="Η συμβολοσειρά που περνά στον επιλογέα δεν είναι σωστά διαμορφωμένη ή δεν υποστηρίζεται.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Οι καθορισμένες τιμές της rowCount ή columnCount δεν είναι έγκυρες.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Ο τύπος OsfControl δεν υποστηρίζεται.";Strings.OfficeOM.L_InvalidValue="Μη έγκυρη τιμή";Strings.OfficeOM.L_DataNotMatchSelection="Το αντικείμενο δεδομένων που δόθηκε δεν είναι συμβατό με το σχήμα ή τις διαστάσεις της τρέχουσας επιλογής.";Strings.OfficeOM.L_InternalError="Εσωτερικό σφάλμα";Strings.OfficeOM.L_NotSupported="Η συνάρτηση {0} δεν υποστηρίζεται.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Ο καθορισμένος κόμβος δεν βρέθηκε.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Ο καθορισμένος τύπος αναγκαστικής μετατροπής δεν είναι συμβατός με αυτόν τον τύπο σύνδεσης.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Ένα πρόβλημα δικτύου εμπόδισε την ανάκτηση του αρχείου.";Strings.OfficeOM.L_TooManyArguments="πάρα πολλά ορίσματα";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Η λειτουργία δεν υποστηρίζεται σε αυτόν τον τύπο σύνδεσης.";Strings.OfficeOM.L_InValidOptionalArgument="μη έγκυρο προαιρετικό όρισμα";Strings.OfficeOM.L_FileTypeNotSupported="Ο καθορισμένος τύπος αρχείου δεν υποστηρίζεται.";Strings.OfficeOM.L_GetDataParametersConflict="Οι καθορισμένες παράμετροι παρουσιάζουν διένεξη.";Strings.OfficeOM.L_CallbackNotAFunction="Η επιστροφή κλήσης πρέπει να είναι τύπου συνάρτησης, ήταν τύπου {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/outlook_strings.debug.js new file mode 100644 index 000000000..69fa2054c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Δεν είναι δυνατή η διαγραφή του συνημμένου, επειδή δεν είναι δυνατή η εύρεση του συνημμένου με το δείκτη συνημμένου."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Η αίτηση υπερβαίνει το όριο μεγέθους 1 MB. Τροποποιήστε την αίτησή σας EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Απαιτούνται αυξημένα δικαιώματα για κλήση της μεθόδου: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Σφάλμα συνημμένου"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Η ημερομηνία λήξης που ορίσατε προηγείται της ημερομηνίας έναρξης."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Ένα ή περισσότερα από τα εμφανιζόμενα ονόματα που παρέχονται είναι πολύ μεγάλο."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Ο συνολικός αριθμός παραληπτών στο πεδίο δεν μπορεί να υπερβαίνει το {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Η επιδιόρθωση HTML απέτυχε."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Σφάλμα εγγραφής δεδομένων"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Απαιτούνται αυξημένα δικαιώματα για πρόσβαση σε προστατευμένα μέλη του JavaScript API για το Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Δεν είναι δυνατή η προσθήκη συνημμένων, επειδή το μήνυμα διαθέτει ήδη το μέγιστο αριθμό συνημμένων"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Εσωτερικό σφάλμα πρωτοκόλλου: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Ο χρήστης κατάργησε το συνημμένο προτού ολοκληρωθεί η αποστολή."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Δεν ήταν δυνατό να βρεθεί μια μετατόπιση για αυτή τη χρονική σήμανση."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Δεν είναι δυνατή η προσθήκη του συνημμένου, επειδή είναι πάρα πολύ μεγάλο."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Η ώρα λήξης δεν μπορεί να είναι πριν την ώρα έναρξης."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Οι δεδομένες παράμετροι δεν ταιριάζουν με την αναμενόμενη μορφή."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Δεν είναι δυνατή η προσθήκη του συνημμένου στο στοιχείο."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Δεν δόθηκαν έγκυροι παραλήπτες."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Το αναγνωριστικό συνημμένου δεν ήταν έγκυρο."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Δεν είναι δυνατή η προσθήκη συνημμένων κατά την ανάκτηση της πλήρους απάντησης ή προώθησης από το διακομιστή."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Μία ή περισσότερες από τις διευθύνσεις email που παρέχονται είναι πολύ μεγάλη."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Η διαδρομή συνημμένου δεν ήταν έγκυρη."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Δεν είναι δυνατή η διαγραφή του συνημμένου από το στοιχείο."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Παρουσιάστηκε εσωτερικό σφάλμα μορφής."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Η είσοδος δεν αναλύεται σε έγκυρη ημερομηνία."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Ο χρήστης άλλαξε τη θέση του δρομέα, κατά την εισαγωγή των δεδομένων." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/outlook_strings.js new file mode 100644 index 000000000..1ed32ced7 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/el-gr/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Δεν είναι δυνατή η διαγραφή του συνημμένου, επειδή δεν είναι δυνατή η εύρεση του συνημμένου με το δείκτη συνημμένου.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Η αίτηση υπερβαίνει το όριο μεγέθους 1 MB. Τροποποιήστε την αίτησή σας EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Απαιτούνται αυξημένα δικαιώματα για κλήση της μεθόδου: '{0}'.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Σφάλμα συνημμένου";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Η ημερομηνία λήξης που ορίσατε προηγείται της ημερομηνίας έναρξης.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Ένα ή περισσότερα από τα εμφανιζόμενα ονόματα που παρέχονται είναι πολύ μεγάλο.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Ο συνολικός αριθμός παραληπτών στο πεδίο δεν μπορεί να υπερβαίνει το {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Η επιδιόρθωση HTML απέτυχε.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Σφάλμα εγγραφής δεδομένων";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Απαιτούνται αυξημένα δικαιώματα για πρόσβαση σε προστατευμένα μέλη του JavaScript API για το Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Δεν είναι δυνατή η προσθήκη συνημμένων, επειδή το μήνυμα διαθέτει ήδη το μέγιστο αριθμό συνημμένων";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Εσωτερικό σφάλμα πρωτοκόλλου: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Ο χρήστης κατάργησε το συνημμένο προτού ολοκληρωθεί η αποστολή.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Δεν ήταν δυνατό να βρεθεί μια μετατόπιση για αυτή τη χρονική σήμανση.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Δεν είναι δυνατή η προσθήκη του συνημμένου, επειδή είναι πάρα πολύ μεγάλο.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Η ώρα λήξης δεν μπορεί να είναι πριν την ώρα έναρξης.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Οι δεδομένες παράμετροι δεν ταιριάζουν με την αναμενόμενη μορφή.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Δεν είναι δυνατή η προσθήκη του συνημμένου στο στοιχείο.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Δεν δόθηκαν έγκυροι παραλήπτες.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Το αναγνωριστικό συνημμένου δεν ήταν έγκυρο.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Δεν είναι δυνατή η προσθήκη συνημμένων κατά την ανάκτηση της πλήρους απάντησης ή προώθησης από το διακομιστή.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Μία ή περισσότερες από τις διευθύνσεις email που παρέχονται είναι πολύ μεγάλη.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Η διαδρομή συνημμένου δεν ήταν έγκυρη.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Δεν είναι δυνατή η διαγραφή του συνημμένου από το στοιχείο.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Παρουσιάστηκε εσωτερικό σφάλμα μορφής.";_u.ExtensibilityStrings.l_InvalidDate_Text="Η είσοδος δεν αναλύεται σε έγκυρη ημερομηνία.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Ο χρήστης άλλαξε τη θέση του δρομέα, κατά την εισαγωγή των δεδομένων." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/office_strings.debug.js new file mode 100644 index 000000000..cba92d59c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/office_strings.debug.js @@ -0,0 +1,133 @@ +Type.registerNamespace('Strings'); +Strings.OfficeOM=function Strings_OfficeOM() { +} +Strings.OfficeOM.registerClass('Strings.OfficeOM'); +Strings.OfficeOM.L_InvalidNamedItemForBindingType='The specified binding type is not compatible with the supplied named item.'; +Strings.OfficeOM.L_EventHandlerNotExist='The specified event handler was not found for this binding.'; +Strings.OfficeOM.L_UnknownBindingType='The binding type is not supported.'; +Strings.OfficeOM.L_InvalidNode='Invalid Node'; +Strings.OfficeOM.L_NotImplemented='Function {0} is not implemented.'; +Strings.OfficeOM.L_NoCapability='You don\'t have sufficient permissions for this action.'; +Strings.OfficeOM.L_SettingsCannotSave='The settings could not be saved.'; +Strings.OfficeOM.L_ActivityLimitReached='Activity limit has been reached.'; +Strings.OfficeOM.L_DataWriteReminder='Data Write Reminder'; +Strings.OfficeOM.L_InvalidBinding='Invalid Binding'; +Strings.OfficeOM.L_InvalidSetColumns='The specified columns are invalid.'; +Strings.OfficeOM.L_BindingCreationError='Binding Creation Error'; +Strings.OfficeOM.L_FormatValueOutOfRange='The value is out of the allowed range.'; +Strings.OfficeOM.L_SelectionNotSupportCoercionType='The current selection is not compatible with the specified coercion type.'; +Strings.OfficeOM.L_InvalidBindingError='Invalid Binding Error'; +Strings.OfficeOM.L_InvalidGetStartRowColumn='The specified startRow or startColumn values are invalid.'; +Strings.OfficeOM.L_InvalidSetRows='The specified rows are invalid.'; +Strings.OfficeOM.L_NetworkProblem='Network Problem'; +Strings.OfficeOM.L_CannotWriteToSelection='Cannot write to the current selection.'; +Strings.OfficeOM.L_MissingParameter='Missing Parameter'; +Strings.OfficeOM.L_IndexOutOfRange='Index out of range.'; +Strings.OfficeOM.L_SettingsStaleError='Settings Stale Error'; +Strings.OfficeOM.L_CannotNavigateTo='The object is located in a place where navigation is not supported.'; +Strings.OfficeOM.L_ReadSettingsError='Read Settings Error'; +Strings.OfficeOM.L_InvalidGetColumns='The specified columns are invalid.'; +Strings.OfficeOM.L_CoercionTypeNotSupported='The specified coercion type is not supported.'; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled='Application {0} does not exist. Microsoft.Office.WebExtension.initialize(reason) is not called.'; +Strings.OfficeOM.L_OverwriteWorksheetData='The set operation failed because the supplied data object will overwrite or shift data.'; +Strings.OfficeOM.L_RowIndexOutOfRange='The row index value is out of the allowed range. Use a value (0 or higher) that\'s less than the number of rows.'; +Strings.OfficeOM.L_InvalidReadForBlankRow='The specified row is blank.'; +Strings.OfficeOM.L_ColIndexOutOfRange='The column index value is out of the allowed range. Use a value (0 or higher) that\'s less than the number of columns.'; +Strings.OfficeOM.L_UnsupportedEnumeration='Unsupported Enumeration'; +Strings.OfficeOM.L_InvalidParameters='Function {0} has invalid parameters.'; +Strings.OfficeOM.L_SetDataParametersConflict='The specified parameters conflict.'; +Strings.OfficeOM.L_CloseFileBeforeRetrieve='Call closeAsync on the current File before retrieving another.'; +Strings.OfficeOM.L_DataNotMatchCoercionType='The type of the specified data object is not compatible with the current selection.'; +Strings.OfficeOM.L_RunMustReturnPromise='The batch function passed to the \".run\" method didn\'t return a promise. The function must return a promise, so that any automatically-tracked objects can be released at the batch\'s completion. Typically, you return a promise by returning the response from \"context.sync()\".'; +Strings.OfficeOM.L_UnsupportedEnumerationMessage='The enumeration isn\'t supported in the current host application.'; +Strings.OfficeOM.L_InvalidCoercion='Invalid Coercion Type'; +Strings.OfficeOM.L_NotSupportedEventType='The specified event type {0} is not supported.'; +Strings.OfficeOM.L_UnsupportedDataObject='The supplied data object type is not supported.'; +Strings.OfficeOM.L_GetDataIsTooLarge='The requested data set is too large.'; +Strings.OfficeOM.L_AppNameNotExist='Add-in Name for {0} doesn\'t exist.'; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText='Please make a selection.'; +Strings.OfficeOM.L_MultipleNamedItemFound='Multiple objects with the same name were found.'; +Strings.OfficeOM.L_InvalidCellsValue='One or more of the cells parameters have values that aren\'t allowed. Double-check the values and try again.'; +Strings.OfficeOM.L_DataNotMatchBindingType='The specified data object is not compatible with the binding type.'; +Strings.OfficeOM.L_InvalidFormatValue='One or more of the format parameters have values that aren\'t allowed. Double-check the values and try again.'; +Strings.OfficeOM.L_NotSupportedBindingType='The specified binding type {0} is not supported.'; +Strings.OfficeOM.L_InitializeNotReady='Office.js has not been fully loaded yet. Please try again later or make sure to add your initialization code on the Office.initialize function.'; +Strings.OfficeOM.L_FormattingReminder='Formatting Reminder'; +Strings.OfficeOM.L_ShuttingDown='Operation failed because the data is not current on the server.'; +Strings.OfficeOM.L_OperationNotSupported='The operation is not supported.'; +Strings.OfficeOM.L_InvalidRequestContext='Cannot use the object across different request contexts.'; +Strings.OfficeOM.L_DocumentReadOnly='The requested operation is not allowed on the current document mode.'; +Strings.OfficeOM.L_NamedItemNotFound='The named item does not exist.'; +Strings.OfficeOM.L_InvalidApiCallInContext='Invalid API call in the current context.'; +Strings.OfficeOM.L_InvalidGetRows='The specified rows are invalid.'; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits='Note: The formatting sets set by a Formatting API call is suggested to be below 100.'; +Strings.OfficeOM.L_TooManyIncompleteRequests='Wait until the previous call completes.'; +Strings.OfficeOM.L_SetDataIsTooLarge='The specified data object is too large.'; +Strings.OfficeOM.L_DataWriteError='Data Write Error'; +Strings.OfficeOM.L_InvalidBindingOperation='Invalid Binding Operation'; +Strings.OfficeOM.L_APICallFailed='API Call Failed'; +Strings.OfficeOM.L_SpecifiedIdNotExist='The specified ID does not exist.'; +Strings.OfficeOM.L_FunctionCallFailed='Function {0} call failed, error code: {1}.'; +Strings.OfficeOM.L_DataNotMatchBindingSize='The supplied data object does not match the size of the current selection.'; +Strings.OfficeOM.L_SaveSettingsError='Save Settings Error'; +Strings.OfficeOM.L_RequestTokenUnavailable='This API has been throttled to slow the call frequency.'; +Strings.OfficeOM.L_InvalidSetStartRowColumn='The specified startRow or startColumn values are invalid.'; +Strings.OfficeOM.L_InvalidFormat='Invalid Format Error'; +Strings.OfficeOM.L_InvalidArgument='The argument \'{0}\' doesn\'t work for this situation, is missing, or isn\'t in the right format.'; +Strings.OfficeOM.L_BindingNotExist='The specified binding does not exist.'; +Strings.OfficeOM.L_SettingNameNotExist='The specified setting name does not exist.'; +Strings.OfficeOM.L_EventHandlerAdditionFailed='Failed to add the event handler.'; +Strings.OfficeOM.L_BrowserAPINotSupported='This browser does not support the requested API.'; +Strings.OfficeOM.L_InvalidAPICall='Invalid API Call'; +Strings.OfficeOM.L_EventRegistrationError='Event Registration Error'; +Strings.OfficeOM.L_ElementMissing='We couldn\'t format the table cell because some parameter values are missing. Double-check the parameters and try again.'; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported='Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.'; +Strings.OfficeOM.L_NavOutOfBound='The operation failed because the index is out of range.'; +Strings.OfficeOM.L_RedundantCallbackSpecification='Callback cannot be specified both in argument list and in optional object.'; +Strings.OfficeOM.L_CustomXmlError='Custom XML Error.'; +Strings.OfficeOM.L_PropertyNotLoaded='The property \'{0}\' is not available. Before reading the property\'s value, call the load method on the containing object and call \"context.sync()\" on the associated request context.'; +Strings.OfficeOM.L_SettingsAreStale='Settings could not be saved because they are not current.'; +Strings.OfficeOM.L_TooManyOptionalFunction='multiple optional functions in parameter list'; +Strings.OfficeOM.L_MissingRequiredArguments='missing some required arguments'; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported='Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.'; +Strings.OfficeOM.L_HostError='Host Error'; +Strings.OfficeOM.L_OutOfRange='Out of Range'; +Strings.OfficeOM.L_InvalidSelectionForBindingType='A binding cannot be created with the current selection and the specified binding type.'; +Strings.OfficeOM.L_TooManyOptionalObjects='multiple optional objects in parameter list'; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData='Selected content needs to be in table format. Format the data as a table and try again.'; +Strings.OfficeOM.L_APINotSupported='API Not Supported'; +Strings.OfficeOM.L_SliceSizeNotSupported='The specified slice size is not supported.'; +Strings.OfficeOM.L_EventHandlerRemovalFailed='Failed to remove the event handler.'; +Strings.OfficeOM.L_BindingToMultipleSelection='Noncontiguous selections are not supported.'; +Strings.OfficeOM.L_DataReadError='Data Read Error'; +Strings.OfficeOM.L_InternalErrorDescription='An internal error has occurred.'; +Strings.OfficeOM.L_InvalidDataFormat='The format of the specified data object is invalid.'; +Strings.OfficeOM.L_RequestTimeout='The call took too long to execute.'; +Strings.OfficeOM.L_DataStale='Data Not Current'; +Strings.OfficeOM.L_GetSelectionNotSupported='The current selection is not supported.'; +Strings.OfficeOM.L_MemoryLimit='Memory Limit Exceeded'; +Strings.OfficeOM.L_CellDataAmountBeyondLimits='Note: The number of cells in a table is suggested to be below 20,000 cells.'; +Strings.OfficeOM.L_InvalidTableOptionValue='One or more of the tableOptions parameters have values that aren\'t allowed. Double-check the values and try again.'; +Strings.OfficeOM.L_PermissionDenied='Permission Denied'; +Strings.OfficeOM.L_InvalidDataObject='Invalid Data Object'; +Strings.OfficeOM.L_UserNotSignedIn='No user is signed into Office.'; +Strings.OfficeOM.L_SelectionCannotBound='Cannot bind to the current selection.'; +Strings.OfficeOM.L_InvalidColumnsForBinding='The specified columns are invalid.'; +Strings.OfficeOM.L_BadSelectorString='The string passed into the selector is improperly formatted or unsupported.'; +Strings.OfficeOM.L_InvalidGetRowColumnCounts='The specified rowCount or columnCount values are invalid.'; +Strings.OfficeOM.L_OsfControlTypeNotSupported='OsfControl type not supported.'; +Strings.OfficeOM.L_InvalidValue='Invalid Value'; +Strings.OfficeOM.L_DataNotMatchSelection='The supplied data object is not compatible with the shape or dimensions of the current selection.'; +Strings.OfficeOM.L_InvalidObjectPath='The object path \'{0}\' isn\'t working for what you\'re trying to do. If you\'re using the object across multiple \"context.sync\" calls and outside the sequential execution of a \".run\" batch, please use the \"context.trackedObjects.add()\" and \"context.trackedObjects.remove()\" methods to manage the object\'s lifetime.'; +Strings.OfficeOM.L_InternalError='Internal Error'; +Strings.OfficeOM.L_NotSupported='Function {0} is not supported.'; +Strings.OfficeOM.L_CustomXmlNodeNotFound='The specified node was not found.'; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding='The specified coercion type is not compatible with this binding type.'; +Strings.OfficeOM.L_NetworkProblemRetrieveFile='A network problem has prevented retrieval of the file.'; +Strings.OfficeOM.L_TooManyArguments='too many arguments'; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType='Operation is not supported on this binding type.'; +Strings.OfficeOM.L_InValidOptionalArgument='invalid optional argument'; +Strings.OfficeOM.L_FileTypeNotSupported='The specified file type is not supported.'; +Strings.OfficeOM.L_GetDataParametersConflict='The specified parameters conflict.'; +Strings.OfficeOM.L_CallbackNotAFunction='Callback must be of type function, was of type {0}.'; + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/office_strings.js new file mode 100644 index 000000000..2a70b88e1 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="The specified binding type is not compatible with the supplied named item.";Strings.OfficeOM.L_EventHandlerNotExist="The specified event handler was not found for this binding.";Strings.OfficeOM.L_UnknownBindingType="The binding type is not supported.";Strings.OfficeOM.L_InvalidNode="Invalid Node";Strings.OfficeOM.L_NotImplemented="Function {0} is not implemented.";Strings.OfficeOM.L_NoCapability="You don't have sufficient permissions for this action.";Strings.OfficeOM.L_SettingsCannotSave="The settings could not be saved.";Strings.OfficeOM.L_ActivityLimitReached="Activity limit has been reached.";Strings.OfficeOM.L_DataWriteReminder="Data Write Reminder";Strings.OfficeOM.L_InvalidBinding="Invalid Binding";Strings.OfficeOM.L_InvalidSetColumns="The specified columns are invalid.";Strings.OfficeOM.L_BindingCreationError="Binding Creation Error";Strings.OfficeOM.L_FormatValueOutOfRange="The value is out of the allowed range.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="The current selection is not compatible with the specified coercion type.";Strings.OfficeOM.L_InvalidBindingError="Invalid Binding Error";Strings.OfficeOM.L_InvalidGetStartRowColumn="The specified startRow or startColumn values are invalid.";Strings.OfficeOM.L_InvalidSetRows="The specified rows are invalid.";Strings.OfficeOM.L_NetworkProblem="Network Problem";Strings.OfficeOM.L_CannotWriteToSelection="Cannot write to the current selection.";Strings.OfficeOM.L_MissingParameter="Missing Parameter";Strings.OfficeOM.L_IndexOutOfRange="Index out of range.";Strings.OfficeOM.L_SettingsStaleError="Settings Stale Error";Strings.OfficeOM.L_CannotNavigateTo="The object is located in a place where navigation is not supported.";Strings.OfficeOM.L_ReadSettingsError="Read Settings Error";Strings.OfficeOM.L_InvalidGetColumns="The specified columns are invalid.";Strings.OfficeOM.L_CoercionTypeNotSupported="The specified coercion type is not supported.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Application {0} does not exist. Microsoft.Office.WebExtension.initialize(reason) is not called.";Strings.OfficeOM.L_OverwriteWorksheetData="The set operation failed because the supplied data object will overwrite or shift data.";Strings.OfficeOM.L_RowIndexOutOfRange="The row index value is out of the allowed range. Use a value (0 or higher) that's less than the number of rows.";Strings.OfficeOM.L_InvalidReadForBlankRow="The specified row is blank.";Strings.OfficeOM.L_ColIndexOutOfRange="The column index value is out of the allowed range. Use a value (0 or higher) that's less than the number of columns.";Strings.OfficeOM.L_UnsupportedEnumeration="Unsupported Enumeration";Strings.OfficeOM.L_InvalidParameters="Function {0} has invalid parameters.";Strings.OfficeOM.L_SetDataParametersConflict="The specified parameters conflict.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Call closeAsync on the current File before retrieving another.";Strings.OfficeOM.L_DataNotMatchCoercionType="The type of the specified data object is not compatible with the current selection.";Strings.OfficeOM.L_RunMustReturnPromise='The batch function passed to the ".run" method didn\'t return a promise. The function must return a promise, so that any automatically-tracked objects can be released at the batch\'s completion. Typically, you return a promise by returning the response from "context.sync()".';Strings.OfficeOM.L_UnsupportedEnumerationMessage="The enumeration isn't supported in the current host application.";Strings.OfficeOM.L_InvalidCoercion="Invalid Coercion Type";Strings.OfficeOM.L_NotSupportedEventType="The specified event type {0} is not supported.";Strings.OfficeOM.L_UnsupportedDataObject="The supplied data object type is not supported.";Strings.OfficeOM.L_GetDataIsTooLarge="The requested data set is too large.";Strings.OfficeOM.L_AppNameNotExist="Add-in Name for {0} doesn't exist.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Please make a selection.";Strings.OfficeOM.L_MultipleNamedItemFound="Multiple objects with the same name were found.";Strings.OfficeOM.L_InvalidCellsValue="One or more of the cells parameters have values that aren't allowed. Double-check the values and try again.";Strings.OfficeOM.L_DataNotMatchBindingType="The specified data object is not compatible with the binding type.";Strings.OfficeOM.L_InvalidFormatValue="One or more of the format parameters have values that aren't allowed. Double-check the values and try again.";Strings.OfficeOM.L_NotSupportedBindingType="The specified binding type {0} is not supported.";Strings.OfficeOM.L_InitializeNotReady="Office.js has not been fully loaded yet. Please try again later or make sure to add your initialization code on the Office.initialize function.";Strings.OfficeOM.L_FormattingReminder="Formatting Reminder";Strings.OfficeOM.L_ShuttingDown="Operation failed because the data is not current on the server.";Strings.OfficeOM.L_OperationNotSupported="The operation is not supported.";Strings.OfficeOM.L_InvalidRequestContext="Cannot use the object across different request contexts.";Strings.OfficeOM.L_DocumentReadOnly="The requested operation is not allowed on the current document mode.";Strings.OfficeOM.L_NamedItemNotFound="The named item does not exist.";Strings.OfficeOM.L_InvalidApiCallInContext="Invalid API call in the current context.";Strings.OfficeOM.L_InvalidGetRows="The specified rows are invalid.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Note: The formatting sets set by a Formatting API call is suggested to be below 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Wait until the previous call completes.";Strings.OfficeOM.L_SetDataIsTooLarge="The specified data object is too large.";Strings.OfficeOM.L_DataWriteError="Data Write Error";Strings.OfficeOM.L_InvalidBindingOperation="Invalid Binding Operation";Strings.OfficeOM.L_APICallFailed="API Call Failed";Strings.OfficeOM.L_SpecifiedIdNotExist="The specified ID does not exist.";Strings.OfficeOM.L_FunctionCallFailed="Function {0} call failed, error code: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="The supplied data object does not match the size of the current selection.";Strings.OfficeOM.L_SaveSettingsError="Save Settings Error";Strings.OfficeOM.L_RequestTokenUnavailable="This API has been throttled to slow the call frequency.";Strings.OfficeOM.L_InvalidSetStartRowColumn="The specified startRow or startColumn values are invalid.";Strings.OfficeOM.L_InvalidFormat="Invalid Format Error";Strings.OfficeOM.L_InvalidArgument="The argument '{0}' doesn't work for this situation, is missing, or isn't in the right format.";Strings.OfficeOM.L_BindingNotExist="The specified binding does not exist.";Strings.OfficeOM.L_SettingNameNotExist="The specified setting name does not exist.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Failed to add the event handler.";Strings.OfficeOM.L_BrowserAPINotSupported="This browser does not support the requested API.";Strings.OfficeOM.L_InvalidAPICall="Invalid API Call";Strings.OfficeOM.L_EventRegistrationError="Event Registration Error";Strings.OfficeOM.L_ElementMissing="We couldn't format the table cell because some parameter values are missing. Double-check the parameters and try again.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.";Strings.OfficeOM.L_NavOutOfBound="The operation failed because the index is out of range.";Strings.OfficeOM.L_RedundantCallbackSpecification="Callback cannot be specified both in argument list and in optional object.";Strings.OfficeOM.L_CustomXmlError="Custom XML Error.";Strings.OfficeOM.L_PropertyNotLoaded="The property '{0}' is not available. Before reading the property's value, call the load method on the containing object and call \"context.sync()\" on the associated request context.";Strings.OfficeOM.L_SettingsAreStale="Settings could not be saved because they are not current.";Strings.OfficeOM.L_TooManyOptionalFunction="multiple optional functions in parameter list";Strings.OfficeOM.L_MissingRequiredArguments="missing some required arguments";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.";Strings.OfficeOM.L_HostError="Host Error";Strings.OfficeOM.L_OutOfRange="Out of Range";Strings.OfficeOM.L_InvalidSelectionForBindingType="A binding cannot be created with the current selection and the specified binding type.";Strings.OfficeOM.L_TooManyOptionalObjects="multiple optional objects in parameter list";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Selected content needs to be in table format. Format the data as a table and try again.";Strings.OfficeOM.L_APINotSupported="API Not Supported";Strings.OfficeOM.L_SliceSizeNotSupported="The specified slice size is not supported.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Failed to remove the event handler.";Strings.OfficeOM.L_BindingToMultipleSelection="Noncontiguous selections are not supported.";Strings.OfficeOM.L_DataReadError="Data Read Error";Strings.OfficeOM.L_InternalErrorDescription="An internal error has occurred.";Strings.OfficeOM.L_InvalidDataFormat="The format of the specified data object is invalid.";Strings.OfficeOM.L_RequestTimeout="The call took too long to execute.";Strings.OfficeOM.L_DataStale="Data Not Current";Strings.OfficeOM.L_GetSelectionNotSupported="The current selection is not supported.";Strings.OfficeOM.L_MemoryLimit="Memory Limit Exceeded";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Note: The number of cells in a table is suggested to be below 20,000 cells.";Strings.OfficeOM.L_InvalidTableOptionValue="One or more of the tableOptions parameters have values that aren't allowed. Double-check the values and try again.";Strings.OfficeOM.L_PermissionDenied="Permission Denied";Strings.OfficeOM.L_InvalidDataObject="Invalid Data Object";Strings.OfficeOM.L_UserNotSignedIn="No user is signed into Office.";Strings.OfficeOM.L_SelectionCannotBound="Cannot bind to the current selection.";Strings.OfficeOM.L_InvalidColumnsForBinding="The specified columns are invalid.";Strings.OfficeOM.L_BadSelectorString="The string passed into the selector is improperly formatted or unsupported.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="The specified rowCount or columnCount values are invalid.";Strings.OfficeOM.L_OsfControlTypeNotSupported="OsfControl type not supported.";Strings.OfficeOM.L_InvalidValue="Invalid Value";Strings.OfficeOM.L_DataNotMatchSelection="The supplied data object is not compatible with the shape or dimensions of the current selection.";Strings.OfficeOM.L_InvalidObjectPath='The object path \'{0}\' isn\'t working for what you\'re trying to do. If you\'re using the object across multiple "context.sync" calls and outside the sequential execution of a ".run" batch, please use the "context.trackedObjects.add()" and "context.trackedObjects.remove()" methods to manage the object\'s lifetime.';Strings.OfficeOM.L_InternalError="Internal Error";Strings.OfficeOM.L_NotSupported="Function {0} is not supported.";Strings.OfficeOM.L_CustomXmlNodeNotFound="The specified node was not found.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="The specified coercion type is not compatible with this binding type.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="A network problem has prevented retrieval of the file.";Strings.OfficeOM.L_TooManyArguments="too many arguments";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operation is not supported on this binding type.";Strings.OfficeOM.L_InValidOptionalArgument="invalid optional argument";Strings.OfficeOM.L_FileTypeNotSupported="The specified file type is not supported.";Strings.OfficeOM.L_GetDataParametersConflict="The specified parameters conflict.";Strings.OfficeOM.L_CallbackNotAFunction="Callback must be of type function, was of type {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/outlook_strings.debug.js new file mode 100644 index 000000000..1fc2b1f45 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/outlook_strings.debug.js @@ -0,0 +1,32 @@ +Type.registerNamespace('_u'); +_u.ExtensibilityStrings=function _u_ExtensibilityStrings() { +} +_u.ExtensibilityStrings.registerClass('_u.ExtensibilityStrings'); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text='The attachment cannot be deleted because attachment with the attachment index cannot be found.'; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text='The request exceeds the 1 MB size limit. Please modify your EWS request.'; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text='Elevated permission is required to call the method: \'{0}\'.'; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text='Attachment Error'; +_u.ExtensibilityStrings.l_InvalidEventDates_Text='The end date occurs before the start date.'; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text='One or more of the display names provided is too long.'; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text='The total number of recipients in the field can\'t exceed {0}.'; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text='The HTML santization has failed.'; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text='Data Write Error'; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text='Elevated permission is required to access protected members of the JavaScript API for Office.'; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text='Attachments cannot be added because the message already has the maximum number of attachments'; +_u.ExtensibilityStrings.l_InternalProtocolError_Text='Internal protocol error: \'{0}\'.'; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text='The user removed the attachment before upload has completed.'; +_u.ExtensibilityStrings.l_OffsetNotfound_Text='An offset for this time stamp couldn\'t be found.'; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text='The attachment cannot be added because it is too big.'; +_u.ExtensibilityStrings.l_InvalidEndTime_Text='The end time cannot be before the start time.'; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text='The given parameters do not match the expected format.'; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text='The attachment cannot be added to the item.'; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text='No valid recipients were provided.'; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text='The attachment ID was invalid.'; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text='Attachments cannot be added while the full reply or forward is being retrieved from the server.'; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text='One or more of the email addresses provided is too long.'; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text='The attachment path was invalid.'; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text='The attachment cannot be deleted from the item.'; +_u.ExtensibilityStrings.l_InternalFormatError_Text='There was an internal format error.'; +_u.ExtensibilityStrings.l_InvalidDate_Text='The input doesn\'t resolve to a valid date.'; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text='The user changed the position of the cursor while the data was being inserted.'; + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/outlook_strings.js new file mode 100644 index 000000000..3a599aa4d --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/en-us/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="The attachment cannot be deleted because attachment with the attachment index cannot be found.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="The request exceeds the 1 MB size limit. Please modify your EWS request.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Elevated permission is required to call the method: '{0}'.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Attachment Error";_u.ExtensibilityStrings.l_InvalidEventDates_Text="The end date occurs before the start date.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="One or more of the display names provided is too long.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="The total number of recipients in the field can't exceed {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="The HTML santization has failed.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Data Write Error";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Elevated permission is required to access protected members of the JavaScript API for Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Attachments cannot be added because the message already has the maximum number of attachments";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Internal protocol error: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="The user removed the attachment before upload has completed.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="An offset for this time stamp couldn't be found.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="The attachment cannot be added because it is too big.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="The end time cannot be before the start time.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="The given parameters do not match the expected format.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="The attachment cannot be added to the item.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="No valid recipients were provided.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="The attachment ID was invalid.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Attachments cannot be added while the full reply or forward is being retrieved from the server.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="One or more of the email addresses provided is too long.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="The attachment path was invalid.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="The attachment cannot be deleted from the item.";_u.ExtensibilityStrings.l_InternalFormatError_Text="There was an internal format error.";_u.ExtensibilityStrings.l_InvalidDate_Text="The input doesn't resolve to a valid date.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="The user changed the position of the cursor while the data was being inserted." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/office_strings.debug.js new file mode 100644 index 000000000..acfae6d2c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "El tipo de enlace especificado no es compatible con el elemento con nombre suministrado."; +Strings.OfficeOM.L_EventHandlerNotExist = "No se encontró el controlador de eventos especificado para este enlace."; +Strings.OfficeOM.L_UnknownBindingType = "El tipo de enlace no es compatible."; +Strings.OfficeOM.L_InvalidNode = "Nodo no válido"; +Strings.OfficeOM.L_NotImplemented = "La función {0} no está implementada."; +Strings.OfficeOM.L_NoCapability = "No dispone de permisos suficientes para esta acción."; +Strings.OfficeOM.L_SettingsCannotSave = "No se pudo guardar la configuración."; +Strings.OfficeOM.L_DataWriteReminder = "Aviso de escritura de datos"; +Strings.OfficeOM.L_InvalidBinding = "Enlace no válido"; +Strings.OfficeOM.L_InvalidSetColumns = "Las columnas especificadas no son válidas."; +Strings.OfficeOM.L_BindingCreationError = "No se pudo crear el enlace"; +Strings.OfficeOM.L_FormatValueOutOfRange = "El valor está fuera del intervalo permitido."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "La selección actual no es compatible con el tipo de conversión especificado."; +Strings.OfficeOM.L_InvalidBindingError = "Error de enlace no válido"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Los valores de startRow o startColumn especificados no son válidos."; +Strings.OfficeOM.L_InvalidSetRows = "Las filas especificadas no son válidas."; +Strings.OfficeOM.L_NetworkProblem = "Problema en la red"; +Strings.OfficeOM.L_CannotWriteToSelection = "No se puede escribir en la selección actual."; +Strings.OfficeOM.L_MissingParameter = "Parámetro ausente"; +Strings.OfficeOM.L_IndexOutOfRange = "Índice fuera del intervalo."; +Strings.OfficeOM.L_SettingsStaleError = "Error de configuración obsoleto"; +Strings.OfficeOM.L_CannotNavigateTo = "El objeto se encuentra en una ubicación donde no se admite la navegación."; +Strings.OfficeOM.L_ReadSettingsError = "Error de configuración de lectura"; +Strings.OfficeOM.L_InvalidGetColumns = "Las columnas especificadas no son válidas."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "No se admite el tipo de conversión especificado."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "La aplicación {0} no existe. No se llamó a Microsoft.Office.WebExtension.initialize(reason)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "La operación establecida no se pudo realizar porque el objeto de datos proporcionado sobrescribirá o cambiará los datos."; +Strings.OfficeOM.L_RowIndexOutOfRange = "El valor de índice de la fila está fuera del intervalo permitido. Utilice un valor (0 o superior) que sea menor que el número de filas."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "La fila especificada está en blanco."; +Strings.OfficeOM.L_ColIndexOutOfRange = "El valor de índice de la columna está fuera del intervalo permitido. Utilice un valor (0 o superior) que sea menor que el número de columnas."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Enumeración no compatible"; +Strings.OfficeOM.L_InvalidParameters = "La función {0} contiene parámetros no válidos."; +Strings.OfficeOM.L_SetDataParametersConflict = "Hay un conflicto en los parámetros especificados."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Llamar a closeAsync en el archivo actual antes de recuperar de otro."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "El tipo de objeto de datos especificado no es compatible con la selección actual."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "La enumeración no se admite la aplicación host actual."; +Strings.OfficeOM.L_InvalidCoercion = "Tipo de conversión no válido"; +Strings.OfficeOM.L_NotSupportedEventType = "No se admite el tipo de evento especificado {0}."; +Strings.OfficeOM.L_UnsupportedDataObject = "No se admite el tipo de objeto de datos proporcionado."; +Strings.OfficeOM.L_GetDataIsTooLarge = "El conjunto de datos solicitado es demasiado grande."; +Strings.OfficeOM.L_AppNameNotExist = "El nombre de aplicación para {0} no existe."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Haga una selección."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Se han encontrado varios objetos con el mismo nombre."; +Strings.OfficeOM.L_InvalidCellsValue = "Uno o más de los parámetros de las celdas tienen valores que no están permitidos. Compruebe los valores y vuelva a intentarlo."; +Strings.OfficeOM.L_DataNotMatchBindingType = "El objeto de datos especificado no es compatible con el tipo de enlace."; +Strings.OfficeOM.L_InvalidFormatValue = "Uno o más de los parámetros de formato tienen valores que no están permitidos. Compruebe los valores y vuelva a intentarlo."; +Strings.OfficeOM.L_NotSupportedBindingType = "No se admite el tipo de enlace especificado {0}."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js no se ha cargado todavía por completo. Inténtelo de nuevo más tarde o asegúrese de agregar el código de inicialización en la función Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Aviso de formato"; +Strings.OfficeOM.L_ShuttingDown = "Hubo un problema con la operación porque los datos no son actuales en el servidor."; +Strings.OfficeOM.L_OperationNotSupported = "No se admite esta operación."; +Strings.OfficeOM.L_DocumentReadOnly = "La operación solicitada no se permite en el modo de documento actual."; +Strings.OfficeOM.L_NamedItemNotFound = "El elemento con nombre no existe."; +Strings.OfficeOM.L_InvalidApiCallInContext = "La llamada a API no es válida en el contexto actual."; +Strings.OfficeOM.L_InvalidGetRows = "Las filas especificadas no son válidas."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Nota: Se recomienda que la serie de formatos establecida mediante una llamada API de formato sea inferior a 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Espere a que finalice la llamada anterior."; +Strings.OfficeOM.L_SetDataIsTooLarge = "El objeto de datos especificado es demasiado grande."; +Strings.OfficeOM.L_DataWriteError = "Error de escritura de datos"; +Strings.OfficeOM.L_InvalidBindingOperation = "Operación de enlace no válido"; +Strings.OfficeOM.L_APICallFailed = "Error de llamada a la API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "El identificador especificado no existe."; +Strings.OfficeOM.L_FunctionCallFailed = "No se pudo llamar a la función {0}. Código de error: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "El objeto de datos proporcionado no coincide con el tamaño de la selección actual."; +Strings.OfficeOM.L_SaveSettingsError = "Error de configuración de guardado"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Esta API se limitó para reducir la frecuencia de llamada."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Los valores de startRow o startColumn especificados no son válidos."; +Strings.OfficeOM.L_InvalidFormat = "Error de formato no válido"; +Strings.OfficeOM.L_BindingNotExist = "El enlace especificado no existe."; +Strings.OfficeOM.L_SettingNameNotExist = "El nombre de configuración especificado no existe."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "No se pudo agregar el controlador de eventos."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Este explorador no es compatible con la API solicitada."; +Strings.OfficeOM.L_InvalidAPICall = "Llamada de API no válida"; +Strings.OfficeOM.L_EventRegistrationError = "Error de registro de eventos"; +Strings.OfficeOM.L_ElementMissing = "No pudimos dar formato a la celda de la tabla porque faltan algunos valores de parámetro. Compruebe los parámetros y vuelva a intentarlo."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "No se pueden utilizar parámetros de coordenadas con el tipo de coerción Tabla cuando la tabla contiene celdas combinadas."; +Strings.OfficeOM.L_NavOutOfBound = "No se pudo realizar la operación porque el índice está fuera del intervalo."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "La devolución de llamada no se puede especificar en la lista de argumentos y en el objeto opcional a la vez."; +Strings.OfficeOM.L_CustomXmlError = "Error de XML personalizado."; +Strings.OfficeOM.L_SettingsAreStale = "No se pudo guardar la configuración porque no está actualizada."; +Strings.OfficeOM.L_TooManyOptionalFunction = "existen varias funciones opcionales en la lista de parámetros"; +Strings.OfficeOM.L_MissingRequiredArguments = "Faltan algunos argumentos necesarios"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "No se pueden utilizar parámetros de coordenadas con el tipo de coerción Tabla cuando la tabla contiene celdas combinadas."; +Strings.OfficeOM.L_HostError = "Error de host"; +Strings.OfficeOM.L_OutOfRange = "Fuera del intervalo"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "No se puede crear un enlace con la selección actual y el tipo de enlace especificado."; +Strings.OfficeOM.L_TooManyOptionalObjects = "existen varios objetos opcionales en la lista de parámetros"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "El contenido seleccionado tiene que estar en formato de tabla. Dé formato de tabla a los datos y vuelva a intentarlo."; +Strings.OfficeOM.L_APINotSupported = "API no compatible"; +Strings.OfficeOM.L_SliceSizeNotSupported = "No se admite el tamaño de segmento especificado."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "No se pudo quitar el controlador de eventos."; +Strings.OfficeOM.L_BindingToMultipleSelection = "No se admiten las selecciones discontinuas."; +Strings.OfficeOM.L_DataReadError = "Error de lectura de datos"; +Strings.OfficeOM.L_InternalErrorDescription = "Error interno."; +Strings.OfficeOM.L_InvalidDataFormat = "El formato del objeto de datos especificado no es válido."; +Strings.OfficeOM.L_RequestTimeout = "La llamada tardó demasiado tiempo en ejecutarse."; +Strings.OfficeOM.L_DataStale = "Datos obsoletos"; +Strings.OfficeOM.L_GetSelectionNotSupported = "No se admite la selección actual."; +Strings.OfficeOM.L_MemoryLimit = "Límite de memoria superado"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Nota: Se recomienda que el número de celdas de una tabla sea inferior a 20.000."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Uno o más de los parámetros de tableOptions tienen valores que no están permitidos. Compruebe los valores y vuelva a intentarlo."; +Strings.OfficeOM.L_PermissionDenied = "Permiso denegado"; +Strings.OfficeOM.L_InvalidDataObject = "Objeto de datos no válido"; +Strings.OfficeOM.L_UserNotSignedIn = "Ningún usuario ha iniciado sesión en Office."; +Strings.OfficeOM.L_SelectionCannotBound = "No se puede enlazar a la selección actual."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Las columnas especificadas no son válidas."; +Strings.OfficeOM.L_BadSelectorString = "El formato de la cadena pasado al selector es incorrecto o no se admite."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Los valores de rowCount o columnCount especificados no son válidos."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "No se admite el tipo OsfControl."; +Strings.OfficeOM.L_InvalidValue = "Valor no válido"; +Strings.OfficeOM.L_DataNotMatchSelection = "El objeto de datos proporcionado no es compatible con la forma o las dimensiones de la selección actual."; +Strings.OfficeOM.L_InternalError = "Error interno"; +Strings.OfficeOM.L_NotSupported = "No se admite la función {0}."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "No se encontró el nodo especificado."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "El tipo de conversión especificado no es compatible con este tipo de enlace."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Un problema de red ha impedido la recuperación del archivo."; +Strings.OfficeOM.L_TooManyArguments = "hay demasiados argumentos"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "La operación no es compatible con este tipo de enlace."; +Strings.OfficeOM.L_InValidOptionalArgument = "argumento opcional no válido"; +Strings.OfficeOM.L_FileTypeNotSupported = "El tipo de archivo especificado no es compatible."; +Strings.OfficeOM.L_GetDataParametersConflict = "Hay un conflicto en los parámetros especificados."; +Strings.OfficeOM.L_CallbackNotAFunction = "La devolución de llamada debe ser de tipo función. Era de tipo {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/office_strings.js new file mode 100644 index 000000000..54f703dbe --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="El tipo de enlace especificado no es compatible con el elemento con nombre suministrado.";Strings.OfficeOM.L_EventHandlerNotExist="No se encontró el controlador de eventos especificado para este enlace.";Strings.OfficeOM.L_UnknownBindingType="El tipo de enlace no es compatible.";Strings.OfficeOM.L_InvalidNode="Nodo no válido";Strings.OfficeOM.L_NotImplemented="La función {0} no está implementada.";Strings.OfficeOM.L_NoCapability="No dispone de permisos suficientes para esta acción.";Strings.OfficeOM.L_SettingsCannotSave="No se pudo guardar la configuración.";Strings.OfficeOM.L_DataWriteReminder="Aviso de escritura de datos";Strings.OfficeOM.L_InvalidBinding="Enlace no válido";Strings.OfficeOM.L_InvalidSetColumns="Las columnas especificadas no son válidas.";Strings.OfficeOM.L_BindingCreationError="No se pudo crear el enlace";Strings.OfficeOM.L_FormatValueOutOfRange="El valor está fuera del intervalo permitido.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="La selección actual no es compatible con el tipo de conversión especificado.";Strings.OfficeOM.L_InvalidBindingError="Error de enlace no válido";Strings.OfficeOM.L_InvalidGetStartRowColumn="Los valores de startRow o startColumn especificados no son válidos.";Strings.OfficeOM.L_InvalidSetRows="Las filas especificadas no son válidas.";Strings.OfficeOM.L_NetworkProblem="Problema en la red";Strings.OfficeOM.L_CannotWriteToSelection="No se puede escribir en la selección actual.";Strings.OfficeOM.L_MissingParameter="Parámetro ausente";Strings.OfficeOM.L_IndexOutOfRange="Índice fuera del intervalo.";Strings.OfficeOM.L_SettingsStaleError="Error de configuración obsoleto";Strings.OfficeOM.L_CannotNavigateTo="El objeto se encuentra en una ubicación donde no se admite la navegación.";Strings.OfficeOM.L_ReadSettingsError="Error de configuración de lectura";Strings.OfficeOM.L_InvalidGetColumns="Las columnas especificadas no son válidas.";Strings.OfficeOM.L_CoercionTypeNotSupported="No se admite el tipo de conversión especificado.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="La aplicación {0} no existe. No se llamó a Microsoft.Office.WebExtension.initialize(reason).";Strings.OfficeOM.L_OverwriteWorksheetData="La operación establecida no se pudo realizar porque el objeto de datos proporcionado sobrescribirá o cambiará los datos.";Strings.OfficeOM.L_RowIndexOutOfRange="El valor de índice de la fila está fuera del intervalo permitido. Utilice un valor (0 o superior) que sea menor que el número de filas.";Strings.OfficeOM.L_InvalidReadForBlankRow="La fila especificada está en blanco.";Strings.OfficeOM.L_ColIndexOutOfRange="El valor de índice de la columna está fuera del intervalo permitido. Utilice un valor (0 o superior) que sea menor que el número de columnas.";Strings.OfficeOM.L_UnsupportedEnumeration="Enumeración no compatible";Strings.OfficeOM.L_InvalidParameters="La función {0} contiene parámetros no válidos.";Strings.OfficeOM.L_SetDataParametersConflict="Hay un conflicto en los parámetros especificados.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Llamar a closeAsync en el archivo actual antes de recuperar de otro.";Strings.OfficeOM.L_DataNotMatchCoercionType="El tipo de objeto de datos especificado no es compatible con la selección actual.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="La enumeración no se admite la aplicación host actual.";Strings.OfficeOM.L_InvalidCoercion="Tipo de conversión no válido";Strings.OfficeOM.L_NotSupportedEventType="No se admite el tipo de evento especificado {0}.";Strings.OfficeOM.L_UnsupportedDataObject="No se admite el tipo de objeto de datos proporcionado.";Strings.OfficeOM.L_GetDataIsTooLarge="El conjunto de datos solicitado es demasiado grande.";Strings.OfficeOM.L_AppNameNotExist="El nombre de aplicación para {0} no existe.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Haga una selección.";Strings.OfficeOM.L_MultipleNamedItemFound="Se han encontrado varios objetos con el mismo nombre.";Strings.OfficeOM.L_InvalidCellsValue="Uno o más de los parámetros de las celdas tienen valores que no están permitidos. Compruebe los valores y vuelva a intentarlo.";Strings.OfficeOM.L_DataNotMatchBindingType="El objeto de datos especificado no es compatible con el tipo de enlace.";Strings.OfficeOM.L_InvalidFormatValue="Uno o más de los parámetros de formato tienen valores que no están permitidos. Compruebe los valores y vuelva a intentarlo.";Strings.OfficeOM.L_NotSupportedBindingType="No se admite el tipo de enlace especificado {0}.";Strings.OfficeOM.L_InitializeNotReady="Office.js no se ha cargado todavía por completo. Inténtelo de nuevo más tarde o asegúrese de agregar el código de inicialización en la función Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Aviso de formato";Strings.OfficeOM.L_ShuttingDown="Hubo un problema con la operación porque los datos no son actuales en el servidor.";Strings.OfficeOM.L_OperationNotSupported="No se admite esta operación.";Strings.OfficeOM.L_DocumentReadOnly="La operación solicitada no se permite en el modo de documento actual.";Strings.OfficeOM.L_NamedItemNotFound="El elemento con nombre no existe.";Strings.OfficeOM.L_InvalidApiCallInContext="La llamada a API no es válida en el contexto actual.";Strings.OfficeOM.L_InvalidGetRows="Las filas especificadas no son válidas.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Nota: Se recomienda que la serie de formatos establecida mediante una llamada API de formato sea inferior a 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Espere a que finalice la llamada anterior.";Strings.OfficeOM.L_SetDataIsTooLarge="El objeto de datos especificado es demasiado grande.";Strings.OfficeOM.L_DataWriteError="Error de escritura de datos";Strings.OfficeOM.L_InvalidBindingOperation="Operación de enlace no válido";Strings.OfficeOM.L_APICallFailed="Error de llamada a la API";Strings.OfficeOM.L_SpecifiedIdNotExist="El identificador especificado no existe.";Strings.OfficeOM.L_FunctionCallFailed="No se pudo llamar a la función {0}. Código de error: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="El objeto de datos proporcionado no coincide con el tamaño de la selección actual.";Strings.OfficeOM.L_SaveSettingsError="Error de configuración de guardado";Strings.OfficeOM.L_RequestTokenUnavailable="Esta API se limitó para reducir la frecuencia de llamada.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Los valores de startRow o startColumn especificados no son válidos.";Strings.OfficeOM.L_InvalidFormat="Error de formato no válido";Strings.OfficeOM.L_BindingNotExist="El enlace especificado no existe.";Strings.OfficeOM.L_SettingNameNotExist="El nombre de configuración especificado no existe.";Strings.OfficeOM.L_EventHandlerAdditionFailed="No se pudo agregar el controlador de eventos.";Strings.OfficeOM.L_BrowserAPINotSupported="Este explorador no es compatible con la API solicitada.";Strings.OfficeOM.L_InvalidAPICall="Llamada de API no válida";Strings.OfficeOM.L_EventRegistrationError="Error de registro de eventos";Strings.OfficeOM.L_ElementMissing="No pudimos dar formato a la celda de la tabla porque faltan algunos valores de parámetro. Compruebe los parámetros y vuelva a intentarlo.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="No se pueden utilizar parámetros de coordenadas con el tipo de coerción Tabla cuando la tabla contiene celdas combinadas.";Strings.OfficeOM.L_NavOutOfBound="No se pudo realizar la operación porque el índice está fuera del intervalo.";Strings.OfficeOM.L_RedundantCallbackSpecification="La devolución de llamada no se puede especificar en la lista de argumentos y en el objeto opcional a la vez.";Strings.OfficeOM.L_CustomXmlError="Error de XML personalizado.";Strings.OfficeOM.L_SettingsAreStale="No se pudo guardar la configuración porque no está actualizada.";Strings.OfficeOM.L_TooManyOptionalFunction="existen varias funciones opcionales en la lista de parámetros";Strings.OfficeOM.L_MissingRequiredArguments="Faltan algunos argumentos necesarios";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="No se pueden utilizar parámetros de coordenadas con el tipo de coerción Tabla cuando la tabla contiene celdas combinadas.";Strings.OfficeOM.L_HostError="Error de host";Strings.OfficeOM.L_OutOfRange="Fuera del intervalo";Strings.OfficeOM.L_InvalidSelectionForBindingType="No se puede crear un enlace con la selección actual y el tipo de enlace especificado.";Strings.OfficeOM.L_TooManyOptionalObjects="existen varios objetos opcionales en la lista de parámetros";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="El contenido seleccionado tiene que estar en formato de tabla. Dé formato de tabla a los datos y vuelva a intentarlo.";Strings.OfficeOM.L_APINotSupported="API no compatible";Strings.OfficeOM.L_SliceSizeNotSupported="No se admite el tamaño de segmento especificado.";Strings.OfficeOM.L_EventHandlerRemovalFailed="No se pudo quitar el controlador de eventos.";Strings.OfficeOM.L_BindingToMultipleSelection="No se admiten las selecciones discontinuas.";Strings.OfficeOM.L_DataReadError="Error de lectura de datos";Strings.OfficeOM.L_InternalErrorDescription="Error interno.";Strings.OfficeOM.L_InvalidDataFormat="El formato del objeto de datos especificado no es válido.";Strings.OfficeOM.L_RequestTimeout="La llamada tardó demasiado tiempo en ejecutarse.";Strings.OfficeOM.L_DataStale="Datos obsoletos";Strings.OfficeOM.L_GetSelectionNotSupported="No se admite la selección actual.";Strings.OfficeOM.L_MemoryLimit="Límite de memoria superado";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Nota: Se recomienda que el número de celdas de una tabla sea inferior a 20.000.";Strings.OfficeOM.L_InvalidTableOptionValue="Uno o más de los parámetros de tableOptions tienen valores que no están permitidos. Compruebe los valores y vuelva a intentarlo.";Strings.OfficeOM.L_PermissionDenied="Permiso denegado";Strings.OfficeOM.L_InvalidDataObject="Objeto de datos no válido";Strings.OfficeOM.L_UserNotSignedIn="Ningún usuario ha iniciado sesión en Office.";Strings.OfficeOM.L_SelectionCannotBound="No se puede enlazar a la selección actual.";Strings.OfficeOM.L_InvalidColumnsForBinding="Las columnas especificadas no son válidas.";Strings.OfficeOM.L_BadSelectorString="El formato de la cadena pasado al selector es incorrecto o no se admite.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Los valores de rowCount o columnCount especificados no son válidos.";Strings.OfficeOM.L_OsfControlTypeNotSupported="No se admite el tipo OsfControl.";Strings.OfficeOM.L_InvalidValue="Valor no válido";Strings.OfficeOM.L_DataNotMatchSelection="El objeto de datos proporcionado no es compatible con la forma o las dimensiones de la selección actual.";Strings.OfficeOM.L_InternalError="Error interno";Strings.OfficeOM.L_NotSupported="No se admite la función {0}.";Strings.OfficeOM.L_CustomXmlNodeNotFound="No se encontró el nodo especificado.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="El tipo de conversión especificado no es compatible con este tipo de enlace.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Un problema de red ha impedido la recuperación del archivo.";Strings.OfficeOM.L_TooManyArguments="hay demasiados argumentos";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="La operación no es compatible con este tipo de enlace.";Strings.OfficeOM.L_InValidOptionalArgument="argumento opcional no válido";Strings.OfficeOM.L_FileTypeNotSupported="El tipo de archivo especificado no es compatible.";Strings.OfficeOM.L_GetDataParametersConflict="Hay un conflicto en los parámetros especificados.";Strings.OfficeOM.L_CallbackNotAFunction="La devolución de llamada debe ser de tipo función. Era de tipo {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/outlook_strings.debug.js new file mode 100644 index 000000000..2207e3c1d --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "No se pueden eliminar los datos adjuntos porque no se encuentran los datos adjuntos con el índice de datos adjuntos."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "La solicitud supera el límite de tamaño de 1 MB. Modifique la solicitud de EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = 'Para llamar al método: "{0}" se necesita un permiso elevado.'; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Error de datos adjuntos"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "La fecha de finalización se produce antes de la fecha de inicio."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Uno o varios nombres de pantalla proporcionados son demasiado largos."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "El número total de destinatarios del campo no puede ser mayor de {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "La inmunización HTML ha fallado."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Error de escritura de datos"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Para tener acceso a los miembros protegidos de la API de JavaScript para Office se necesita un permiso elevado."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "No se pueden agregar datos adjuntos porque el mensaje ya tiene el número máximo de datos adjuntos"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = 'Error de protocolo interno: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "El usuario quitó los datos adjuntos antes de que finalizara la carga."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "No se encontró ningún desplazamiento de esta marca de hora."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Los datos adjuntos no se pueden agregar porque son demasiado grandes."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "La hora de finalización no puede ser anterior a la hora de inicio."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Los parámetros especificados no coinciden con el formato esperado."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Los datos adjuntos no se pueden agregar al elemento."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "No se proporcionaron destinatarios válidos."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "El id. de datos adjuntos no es válido."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "No se pueden agregar datos adjuntos mientras se recupera del servidor la respuesta o el reenvío completos."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Una o varias direcciones de correo electrónico proporcionadas son demasiado largas."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "La ruta de los datos adjuntos no es válida."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Los datos adjuntos no se pueden eliminar del elemento."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Hubo un error de formato interno."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "La entrada no se resuelve en una fecha válida."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "El usuario cambió la posición del cursor mientras se insertaban los datos." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/outlook_strings.js new file mode 100644 index 000000000..254b6167c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/es-es/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="No se pueden eliminar los datos adjuntos porque no se encuentran los datos adjuntos con el índice de datos adjuntos.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="La solicitud supera el límite de tamaño de 1 MB. Modifique la solicitud de EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text='Para llamar al método: "{0}" se necesita un permiso elevado.';_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Error de datos adjuntos";_u.ExtensibilityStrings.l_InvalidEventDates_Text="La fecha de finalización se produce antes de la fecha de inicio.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Uno o varios nombres de pantalla proporcionados son demasiado largos.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="El número total de destinatarios del campo no puede ser mayor de {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="La inmunización HTML ha fallado.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Error de escritura de datos";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Para tener acceso a los miembros protegidos de la API de JavaScript para Office se necesita un permiso elevado.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="No se pueden agregar datos adjuntos porque el mensaje ya tiene el número máximo de datos adjuntos";_u.ExtensibilityStrings.l_InternalProtocolError_Text='Error de protocolo interno: "{0}".';_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="El usuario quitó los datos adjuntos antes de que finalizara la carga.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="No se encontró ningún desplazamiento de esta marca de hora.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Los datos adjuntos no se pueden agregar porque son demasiado grandes.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="La hora de finalización no puede ser anterior a la hora de inicio.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Los parámetros especificados no coinciden con el formato esperado.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Los datos adjuntos no se pueden agregar al elemento.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="No se proporcionaron destinatarios válidos.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="El id. de datos adjuntos no es válido.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="No se pueden agregar datos adjuntos mientras se recupera del servidor la respuesta o el reenvío completos.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Una o varias direcciones de correo electrónico proporcionadas son demasiado largas.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="La ruta de los datos adjuntos no es válida.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Los datos adjuntos no se pueden eliminar del elemento.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Hubo un error de formato interno.";_u.ExtensibilityStrings.l_InvalidDate_Text="La entrada no se resuelve en una fecha válida.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="El usuario cambió la posición del cursor mientras se insertaban los datos." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/office_strings.debug.js new file mode 100644 index 000000000..913c6ead5 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Määratud sidumistüüp ei ühildu esitatud nimelise üksusega."; +Strings.OfficeOM.L_EventHandlerNotExist = "Määratud sündmuseohjurit ei leitud selle sidumise jaoks."; +Strings.OfficeOM.L_UnknownBindingType = "Sidumistüüpi ei toetata."; +Strings.OfficeOM.L_InvalidNode = "Sobimatu sõlm"; +Strings.OfficeOM.L_NotImplemented = "Funktsioon {0} pole juurutatud."; +Strings.OfficeOM.L_NoCapability = "Teil pole selle toimingu jaoks piisavaid lubasid."; +Strings.OfficeOM.L_SettingsCannotSave = "Sätteid ei saanud salvestada."; +Strings.OfficeOM.L_DataWriteReminder = "Andmekirjutuse meeldetuletus"; +Strings.OfficeOM.L_InvalidBinding = "Sobimatu sidumine"; +Strings.OfficeOM.L_InvalidSetColumns = "Määratud veerud ei sobi."; +Strings.OfficeOM.L_BindingCreationError = "Sidumise loomise tõrge"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Väärtus on väljaspool lubatud vahemikku."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Praegune valik ei ühildu määratud kooshoidmistüübiga."; +Strings.OfficeOM.L_InvalidBindingError = "Sobimatu sidumise tõrge"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Määratud väärtus startRow või startColumn ei sobi."; +Strings.OfficeOM.L_InvalidSetRows = "Määratud read ei sobi."; +Strings.OfficeOM.L_NetworkProblem = "Võrguprobleem"; +Strings.OfficeOM.L_CannotWriteToSelection = "Praegusesse valikusse ei saa kirjutada."; +Strings.OfficeOM.L_MissingParameter = "Parameeter on puudu"; +Strings.OfficeOM.L_IndexOutOfRange = "Indeks on väljaspool vahemikku."; +Strings.OfficeOM.L_SettingsStaleError = "Sätete aegumise tõrge"; +Strings.OfficeOM.L_CannotNavigateTo = "Objekt asub kohas, kus navigeerimist ei toetata."; +Strings.OfficeOM.L_ReadSettingsError = "Sätete lugemise tõrge"; +Strings.OfficeOM.L_InvalidGetColumns = "Määratud veerud ei sobi."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Määratud kooshoidmistüüpi ei toetata."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Rakendust {0} pole olemas. Microsoft.Office.WebExtension.initialize(reason) pole kutsutud."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Määramistoiming nurjus, kuna esitatud andmeobjekt kirjutab andmed üle või neid."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Reaindeksi väärtus on väljaspool lubatud vahemikku. Kasutage ridade arvust väiksemat väärtust (0 või suurem)."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Määratud rida on tühi."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Veeruindeksi väärtus on väljaspool lubatud vahemikku. Kasutage veergude arvust väiksemat väärtust (0 või suurem)."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Toetuseta nummerdamine"; +Strings.OfficeOM.L_InvalidParameters = "Funktsiooni {0} parameetrid pole sobivad."; +Strings.OfficeOM.L_SetDataParametersConflict = "Määratud parameetrid on vastuolus."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Enne teise faili toomist kutsuge praeguse faili jaoks closeAsync."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Määratud andmeobjekti tüüp ei ühildu praeguse kooshoidmistüübiga."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Praegune hostrakendus ei toeta nummerdamist."; +Strings.OfficeOM.L_InvalidCoercion = "Sobimatu kooshoidmise tüüp"; +Strings.OfficeOM.L_NotSupportedEventType = "Määratud sündmuse tüüp {0} pole toetatud."; +Strings.OfficeOM.L_UnsupportedDataObject = "Esitatud andmeobjektitüüpi ei toetata."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Nõutud andmekomplekt on liiga mahukas."; +Strings.OfficeOM.L_AppNameNotExist = "{0} AppName'i pole olemas."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Palun valige."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Leiti mitu sama nimega objekti."; +Strings.OfficeOM.L_InvalidCellsValue = "Vähemalt ühe lahtriparameetri väärtus pole lubatud. Kontrollige väärtusi ja proovige uuesti."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Määratud andmeobjekt ei ühildu sidumistüübiga."; +Strings.OfficeOM.L_InvalidFormatValue = "Vähemalt ühe vorminguparameetri väärtus pole lubatud. Kontrollige väärtusi ja proovige uuesti."; +Strings.OfficeOM.L_NotSupportedBindingType = "Määratud sidumistüüp {0} pole toetatud."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js pole veel täielikult laaditud. Palun proovige hiljem uuesti või veenduge, et lähtestamiskood on lisatud funktsiooni Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Vormindamise meeldetuletus"; +Strings.OfficeOM.L_ShuttingDown = "Toiming nurjus, kuna serveris olevad andmed pole ajakohased."; +Strings.OfficeOM.L_OperationNotSupported = "Toimingut ei toetata."; +Strings.OfficeOM.L_DocumentReadOnly = "Nõutud toiming pole praeguses dokumendirežiimis lubatud."; +Strings.OfficeOM.L_NamedItemNotFound = "Nimega üksust pole olemas."; +Strings.OfficeOM.L_InvalidApiCallInContext = "API kutse pole praeguses kontekstis sobiv."; +Strings.OfficeOM.L_InvalidGetRows = "Määratud read ei sobi."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Märkus: vormindus-API määratud vorminduskogude arv peaks soovituslikult olema väiksem kui 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Oodake, kuni eelmine kutse lõpule jõuab."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Määratud andmeobjekt on liiga suur."; +Strings.OfficeOM.L_DataWriteError = "Andmete kirjutamise tõrge"; +Strings.OfficeOM.L_InvalidBindingOperation = "Sobimatu sidumise toiming"; +Strings.OfficeOM.L_APICallFailed = "API kutse nurjus"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Määratud ID-d pole olemas."; +Strings.OfficeOM.L_FunctionCallFailed = "Funktsiooni {0} ei saanud kutsuda; tõrke kood: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Esitatud andmeobjekt ei vasta praeguse valiku suurusele."; +Strings.OfficeOM.L_SaveSettingsError = "Sätete salvestamise tõrge"; +Strings.OfficeOM.L_RequestTokenUnavailable = "See API on kutsete sageduse vähendamiseks ahendatud."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Määratud väärtus startRow või startColumn ei sobi."; +Strings.OfficeOM.L_InvalidFormat = "Sobimatu vormingu tõrge"; +Strings.OfficeOM.L_BindingNotExist = "Määratud sidumist pole olemas."; +Strings.OfficeOM.L_SettingNameNotExist = "Määratud sätte nime pole olemas."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Sündmuseohjurit ei saanud lisada."; +Strings.OfficeOM.L_BrowserAPINotSupported = "See brauser ei toeta taotletud API-t."; +Strings.OfficeOM.L_InvalidAPICall = "Sobimatu API kutse"; +Strings.OfficeOM.L_EventRegistrationError = "Sündmuse registreerimise tõrge"; +Strings.OfficeOM.L_ElementMissing = "Tabelilahtrit ei saanud vormindada, kuna mõni parameetriväärtus on puudu. Kontrollige parameetreid ja proovige uuesti."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Koordinaatparameetreid ei saa kasutada kooshoidmistüübiga Tabel, kui tabel sisaldab liidetud lahtreid."; +Strings.OfficeOM.L_NavOutOfBound = "Toiming nurjus, sest indeks on väljaspool vahemikku."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Tagasikutse ei saa olla korraga määratud nii argumendiloendis kui valikulises objektis."; +Strings.OfficeOM.L_CustomXmlError = "Kohandatud XML-i tõrge."; +Strings.OfficeOM.L_SettingsAreStale = "Sätteid ei saanud salvestada, kuna need pole ajakohased."; +Strings.OfficeOM.L_TooManyOptionalFunction = "parameetriloendis on mitu valikulist funktsiooni"; +Strings.OfficeOM.L_MissingRequiredArguments = "mõned nõutavad argumendid on puudu"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Koordinaatparameetreid ei saa kasutada kooshoidmistüübiga Tabel, kui tabel sisaldab liidetud lahtreid."; +Strings.OfficeOM.L_HostError = "Hosti tõrge"; +Strings.OfficeOM.L_OutOfRange = "Vahemikust väljas"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Sidumist ei saa praeguse valikuga ja määratud sidumistüübiga luua."; +Strings.OfficeOM.L_TooManyOptionalObjects = "parameetriloendis on mitu valikulist objekti"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Valitud sisu peab olema tabelivormingus. Vormindage andmed tabelina ja proovige uuesti."; +Strings.OfficeOM.L_APINotSupported = "API tugi puudub"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Määratud sektorisuurust ei toetata."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Sündmuseohjurit ei saanud eemaldada."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Mittekülgnevaid valikuid ei toetata."; +Strings.OfficeOM.L_DataReadError = "Andmete lugemise tõrge"; +Strings.OfficeOM.L_InternalErrorDescription = "Ilmnes sisemine tõrge."; +Strings.OfficeOM.L_InvalidDataFormat = "Määratud andmeobjekti vorming ei sobi."; +Strings.OfficeOM.L_RequestTimeout = "Kutse käitamiseks kulus liiga palju aega."; +Strings.OfficeOM.L_DataStale = "Andmed pole ajakohased"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Praegune valik pole toetatud."; +Strings.OfficeOM.L_MemoryLimit = "Mälupiirang on ületatud"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Märkus: tabelis peaks soovituslikult olema alla 20 000 lahtri."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Vähemalt ühe tabelisuvandite parameetri väärtus pole lubatud. Kontrollige väärtusi ja proovige uuesti."; +Strings.OfficeOM.L_PermissionDenied = "Õigusest keelduti"; +Strings.OfficeOM.L_InvalidDataObject = "Sobimatu andmeobjekt"; +Strings.OfficeOM.L_UserNotSignedIn = "Office'isse pole kasutajaid sisse logitud."; +Strings.OfficeOM.L_SelectionCannotBound = "Praeguse valikuga ei saa siduda."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Määratud veerud ei sobi."; +Strings.OfficeOM.L_BadSelectorString = "Valijale edasi antud string on valesti vormindatud või toetuseta."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Määratud väärtused rowCount ja columnCount pole sobivad."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Tüüp OsfControl pole toetatud."; +Strings.OfficeOM.L_InvalidValue = "Sobimatu väärtus"; +Strings.OfficeOM.L_DataNotMatchSelection = "Esitatud andmeobjekt ei ühildu praeguse valiku kuju või mõõtmetega."; +Strings.OfficeOM.L_InternalError = "Sisemine tõrge"; +Strings.OfficeOM.L_NotSupported = "Funktsiooni {0} ei toetata."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Määratud sõlme ei leitud."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Määratud kooshoidmistüüp ei ühildu selle sidumistüübiga."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Faili ei saanud võrguprobleemi tõttu tuua."; +Strings.OfficeOM.L_TooManyArguments = "liiga palju argumente"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Toiming pole selle sidumistüübi korral toetatud."; +Strings.OfficeOM.L_InValidOptionalArgument = "sobimatu valikuline argument"; +Strings.OfficeOM.L_FileTypeNotSupported = "Määratud failitüüpi ei toetata."; +Strings.OfficeOM.L_GetDataParametersConflict = "Määratud parameetrid on vastuolus."; +Strings.OfficeOM.L_CallbackNotAFunction = "Tagasikutse peab olema funktsioon-tüüpi, kuid on tüüpi {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/office_strings.js new file mode 100644 index 000000000..5e54d6f69 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Määratud sidumistüüp ei ühildu esitatud nimelise üksusega.";Strings.OfficeOM.L_EventHandlerNotExist="Määratud sündmuseohjurit ei leitud selle sidumise jaoks.";Strings.OfficeOM.L_UnknownBindingType="Sidumistüüpi ei toetata.";Strings.OfficeOM.L_InvalidNode="Sobimatu sõlm";Strings.OfficeOM.L_NotImplemented="Funktsioon {0} pole juurutatud.";Strings.OfficeOM.L_NoCapability="Teil pole selle toimingu jaoks piisavaid lubasid.";Strings.OfficeOM.L_SettingsCannotSave="Sätteid ei saanud salvestada.";Strings.OfficeOM.L_DataWriteReminder="Andmekirjutuse meeldetuletus";Strings.OfficeOM.L_InvalidBinding="Sobimatu sidumine";Strings.OfficeOM.L_InvalidSetColumns="Määratud veerud ei sobi.";Strings.OfficeOM.L_BindingCreationError="Sidumise loomise tõrge";Strings.OfficeOM.L_FormatValueOutOfRange="Väärtus on väljaspool lubatud vahemikku.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Praegune valik ei ühildu määratud kooshoidmistüübiga.";Strings.OfficeOM.L_InvalidBindingError="Sobimatu sidumise tõrge";Strings.OfficeOM.L_InvalidGetStartRowColumn="Määratud väärtus startRow või startColumn ei sobi.";Strings.OfficeOM.L_InvalidSetRows="Määratud read ei sobi.";Strings.OfficeOM.L_NetworkProblem="Võrguprobleem";Strings.OfficeOM.L_CannotWriteToSelection="Praegusesse valikusse ei saa kirjutada.";Strings.OfficeOM.L_MissingParameter="Parameeter on puudu";Strings.OfficeOM.L_IndexOutOfRange="Indeks on väljaspool vahemikku.";Strings.OfficeOM.L_SettingsStaleError="Sätete aegumise tõrge";Strings.OfficeOM.L_CannotNavigateTo="Objekt asub kohas, kus navigeerimist ei toetata.";Strings.OfficeOM.L_ReadSettingsError="Sätete lugemise tõrge";Strings.OfficeOM.L_InvalidGetColumns="Määratud veerud ei sobi.";Strings.OfficeOM.L_CoercionTypeNotSupported="Määratud kooshoidmistüüpi ei toetata.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Rakendust {0} pole olemas. Microsoft.Office.WebExtension.initialize(reason) pole kutsutud.";Strings.OfficeOM.L_OverwriteWorksheetData="Määramistoiming nurjus, kuna esitatud andmeobjekt kirjutab andmed üle või neid.";Strings.OfficeOM.L_RowIndexOutOfRange="Reaindeksi väärtus on väljaspool lubatud vahemikku. Kasutage ridade arvust väiksemat väärtust (0 või suurem).";Strings.OfficeOM.L_InvalidReadForBlankRow="Määratud rida on tühi.";Strings.OfficeOM.L_ColIndexOutOfRange="Veeruindeksi väärtus on väljaspool lubatud vahemikku. Kasutage veergude arvust väiksemat väärtust (0 või suurem).";Strings.OfficeOM.L_UnsupportedEnumeration="Toetuseta nummerdamine";Strings.OfficeOM.L_InvalidParameters="Funktsiooni {0} parameetrid pole sobivad.";Strings.OfficeOM.L_SetDataParametersConflict="Määratud parameetrid on vastuolus.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Enne teise faili toomist kutsuge praeguse faili jaoks closeAsync.";Strings.OfficeOM.L_DataNotMatchCoercionType="Määratud andmeobjekti tüüp ei ühildu praeguse kooshoidmistüübiga.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Praegune hostrakendus ei toeta nummerdamist.";Strings.OfficeOM.L_InvalidCoercion="Sobimatu kooshoidmise tüüp";Strings.OfficeOM.L_NotSupportedEventType="Määratud sündmuse tüüp {0} pole toetatud.";Strings.OfficeOM.L_UnsupportedDataObject="Esitatud andmeobjektitüüpi ei toetata.";Strings.OfficeOM.L_GetDataIsTooLarge="Nõutud andmekomplekt on liiga mahukas.";Strings.OfficeOM.L_AppNameNotExist="{0} AppName'i pole olemas.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Palun valige.";Strings.OfficeOM.L_MultipleNamedItemFound="Leiti mitu sama nimega objekti.";Strings.OfficeOM.L_InvalidCellsValue="Vähemalt ühe lahtriparameetri väärtus pole lubatud. Kontrollige väärtusi ja proovige uuesti.";Strings.OfficeOM.L_DataNotMatchBindingType="Määratud andmeobjekt ei ühildu sidumistüübiga.";Strings.OfficeOM.L_InvalidFormatValue="Vähemalt ühe vorminguparameetri väärtus pole lubatud. Kontrollige väärtusi ja proovige uuesti.";Strings.OfficeOM.L_NotSupportedBindingType="Määratud sidumistüüp {0} pole toetatud.";Strings.OfficeOM.L_InitializeNotReady="Office.js pole veel täielikult laaditud. Palun proovige hiljem uuesti või veenduge, et lähtestamiskood on lisatud funktsiooni Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Vormindamise meeldetuletus";Strings.OfficeOM.L_ShuttingDown="Toiming nurjus, kuna serveris olevad andmed pole ajakohased.";Strings.OfficeOM.L_OperationNotSupported="Toimingut ei toetata.";Strings.OfficeOM.L_DocumentReadOnly="Nõutud toiming pole praeguses dokumendirežiimis lubatud.";Strings.OfficeOM.L_NamedItemNotFound="Nimega üksust pole olemas.";Strings.OfficeOM.L_InvalidApiCallInContext="API kutse pole praeguses kontekstis sobiv.";Strings.OfficeOM.L_InvalidGetRows="Määratud read ei sobi.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Märkus: vormindus-API määratud vorminduskogude arv peaks soovituslikult olema väiksem kui 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Oodake, kuni eelmine kutse lõpule jõuab.";Strings.OfficeOM.L_SetDataIsTooLarge="Määratud andmeobjekt on liiga suur.";Strings.OfficeOM.L_DataWriteError="Andmete kirjutamise tõrge";Strings.OfficeOM.L_InvalidBindingOperation="Sobimatu sidumise toiming";Strings.OfficeOM.L_APICallFailed="API kutse nurjus";Strings.OfficeOM.L_SpecifiedIdNotExist="Määratud ID-d pole olemas.";Strings.OfficeOM.L_FunctionCallFailed="Funktsiooni {0} ei saanud kutsuda; tõrke kood: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Esitatud andmeobjekt ei vasta praeguse valiku suurusele.";Strings.OfficeOM.L_SaveSettingsError="Sätete salvestamise tõrge";Strings.OfficeOM.L_RequestTokenUnavailable="See API on kutsete sageduse vähendamiseks ahendatud.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Määratud väärtus startRow või startColumn ei sobi.";Strings.OfficeOM.L_InvalidFormat="Sobimatu vormingu tõrge";Strings.OfficeOM.L_BindingNotExist="Määratud sidumist pole olemas.";Strings.OfficeOM.L_SettingNameNotExist="Määratud sätte nime pole olemas.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Sündmuseohjurit ei saanud lisada.";Strings.OfficeOM.L_BrowserAPINotSupported="See brauser ei toeta taotletud API-t.";Strings.OfficeOM.L_InvalidAPICall="Sobimatu API kutse";Strings.OfficeOM.L_EventRegistrationError="Sündmuse registreerimise tõrge";Strings.OfficeOM.L_ElementMissing="Tabelilahtrit ei saanud vormindada, kuna mõni parameetriväärtus on puudu. Kontrollige parameetreid ja proovige uuesti.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Koordinaatparameetreid ei saa kasutada kooshoidmistüübiga Tabel, kui tabel sisaldab liidetud lahtreid.";Strings.OfficeOM.L_NavOutOfBound="Toiming nurjus, sest indeks on väljaspool vahemikku.";Strings.OfficeOM.L_RedundantCallbackSpecification="Tagasikutse ei saa olla korraga määratud nii argumendiloendis kui valikulises objektis.";Strings.OfficeOM.L_CustomXmlError="Kohandatud XML-i tõrge.";Strings.OfficeOM.L_SettingsAreStale="Sätteid ei saanud salvestada, kuna need pole ajakohased.";Strings.OfficeOM.L_TooManyOptionalFunction="parameetriloendis on mitu valikulist funktsiooni";Strings.OfficeOM.L_MissingRequiredArguments="mõned nõutavad argumendid on puudu";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Koordinaatparameetreid ei saa kasutada kooshoidmistüübiga Tabel, kui tabel sisaldab liidetud lahtreid.";Strings.OfficeOM.L_HostError="Hosti tõrge";Strings.OfficeOM.L_OutOfRange="Vahemikust väljas";Strings.OfficeOM.L_InvalidSelectionForBindingType="Sidumist ei saa praeguse valikuga ja määratud sidumistüübiga luua.";Strings.OfficeOM.L_TooManyOptionalObjects="parameetriloendis on mitu valikulist objekti";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Valitud sisu peab olema tabelivormingus. Vormindage andmed tabelina ja proovige uuesti.";Strings.OfficeOM.L_APINotSupported="API tugi puudub";Strings.OfficeOM.L_SliceSizeNotSupported="Määratud sektorisuurust ei toetata.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Sündmuseohjurit ei saanud eemaldada.";Strings.OfficeOM.L_BindingToMultipleSelection="Mittekülgnevaid valikuid ei toetata.";Strings.OfficeOM.L_DataReadError="Andmete lugemise tõrge";Strings.OfficeOM.L_InternalErrorDescription="Ilmnes sisemine tõrge.";Strings.OfficeOM.L_InvalidDataFormat="Määratud andmeobjekti vorming ei sobi.";Strings.OfficeOM.L_RequestTimeout="Kutse käitamiseks kulus liiga palju aega.";Strings.OfficeOM.L_DataStale="Andmed pole ajakohased";Strings.OfficeOM.L_GetSelectionNotSupported="Praegune valik pole toetatud.";Strings.OfficeOM.L_MemoryLimit="Mälupiirang on ületatud";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Märkus: tabelis peaks soovituslikult olema alla 20 000 lahtri.";Strings.OfficeOM.L_InvalidTableOptionValue="Vähemalt ühe tabelisuvandite parameetri väärtus pole lubatud. Kontrollige väärtusi ja proovige uuesti.";Strings.OfficeOM.L_PermissionDenied="Õigusest keelduti";Strings.OfficeOM.L_InvalidDataObject="Sobimatu andmeobjekt";Strings.OfficeOM.L_UserNotSignedIn="Office'isse pole kasutajaid sisse logitud.";Strings.OfficeOM.L_SelectionCannotBound="Praeguse valikuga ei saa siduda.";Strings.OfficeOM.L_InvalidColumnsForBinding="Määratud veerud ei sobi.";Strings.OfficeOM.L_BadSelectorString="Valijale edasi antud string on valesti vormindatud või toetuseta.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Määratud väärtused rowCount ja columnCount pole sobivad.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Tüüp OsfControl pole toetatud.";Strings.OfficeOM.L_InvalidValue="Sobimatu väärtus";Strings.OfficeOM.L_DataNotMatchSelection="Esitatud andmeobjekt ei ühildu praeguse valiku kuju või mõõtmetega.";Strings.OfficeOM.L_InternalError="Sisemine tõrge";Strings.OfficeOM.L_NotSupported="Funktsiooni {0} ei toetata.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Määratud sõlme ei leitud.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Määratud kooshoidmistüüp ei ühildu selle sidumistüübiga.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Faili ei saanud võrguprobleemi tõttu tuua.";Strings.OfficeOM.L_TooManyArguments="liiga palju argumente";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Toiming pole selle sidumistüübi korral toetatud.";Strings.OfficeOM.L_InValidOptionalArgument="sobimatu valikuline argument";Strings.OfficeOM.L_FileTypeNotSupported="Määratud failitüüpi ei toetata.";Strings.OfficeOM.L_GetDataParametersConflict="Määratud parameetrid on vastuolus.";Strings.OfficeOM.L_CallbackNotAFunction="Tagasikutse peab olema funktsioon-tüüpi, kuid on tüüpi {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/outlook_strings.debug.js new file mode 100644 index 000000000..f19e42606 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Manust ei saa kustutada, kuna selle manuseindeksiga manust ei leitud."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Taotlus ületab 1 MB mahupiirangu. Muutke oma EWS-i taotlust."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Meetodi {0} kutsumiseks on nõutavad administraatoriõigused."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Manusetõrge"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Lõppkuupäev on varasem kui alguskuupäev."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Vähemalt üks sisestatud kuvatav nimi on liiga pikk."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Väljal olevate adressaatide koguarv ei tohi olla suurem kui {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "HTML-i puhastus nurjus."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Andmete kirjutamise tõrge"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Office'i JavaScripti API kaitstud liikmetele juurdepääsemiseks on nõutavad administraatoriõigused."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Manuseid ei saa lisada, kuna sõnumile on juba lisatud suurim lubatud arv manuseid"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Sisemine protokollitõrge: {0}."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Kasutaja eemaldas manuse enne üleslaadimise lõpulejõudmist."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Selle ajatempli nihet ei leitud."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Manust ei saa lisada, kuna selle maht on liiga suur."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Lõppaeg ei saa olla algusajast varasem."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Sisestatud parameetrite vorming ei vasta eeldatule."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Manust ei saa üksusele lisada."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Sobivaid adressaate ei sisestatud."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Manuse ID ei sobinud."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Manuseid ei saa lisada serverist täielike vastussõnumite või edasisaadetavate sõnumite toomise ajal."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Vähemalt üks sisestatud meiliaadress on liiga pikk."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Manuse tee ei sobinud."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Manust ei saa üksusest kustutada."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Ilmnes sisemine vormingutõrge."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Sisend ei lahene sobivaks kuupäevaks."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Kasutaja muutis andmete sisestamise ajal kursori asukohta." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/outlook_strings.js new file mode 100644 index 000000000..2eccf0729 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/et-ee/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Manust ei saa kustutada, kuna selle manuseindeksiga manust ei leitud.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Taotlus ületab 1 MB mahupiirangu. Muutke oma EWS-i taotlust.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Meetodi {0} kutsumiseks on nõutavad administraatoriõigused.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Manusetõrge";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Lõppkuupäev on varasem kui alguskuupäev.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Vähemalt üks sisestatud kuvatav nimi on liiga pikk.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Väljal olevate adressaatide koguarv ei tohi olla suurem kui {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="HTML-i puhastus nurjus.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Andmete kirjutamise tõrge";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Office'i JavaScripti API kaitstud liikmetele juurdepääsemiseks on nõutavad administraatoriõigused.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Manuseid ei saa lisada, kuna sõnumile on juba lisatud suurim lubatud arv manuseid";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Sisemine protokollitõrge: {0}.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Kasutaja eemaldas manuse enne üleslaadimise lõpulejõudmist.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Selle ajatempli nihet ei leitud.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Manust ei saa lisada, kuna selle maht on liiga suur.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Lõppaeg ei saa olla algusajast varasem.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Sisestatud parameetrite vorming ei vasta eeldatule.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Manust ei saa üksusele lisada.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Sobivaid adressaate ei sisestatud.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Manuse ID ei sobinud.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Manuseid ei saa lisada serverist täielike vastussõnumite või edasisaadetavate sõnumite toomise ajal.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Vähemalt üks sisestatud meiliaadress on liiga pikk.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Manuse tee ei sobinud.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Manust ei saa üksusest kustutada.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Ilmnes sisemine vormingutõrge.";_u.ExtensibilityStrings.l_InvalidDate_Text="Sisend ei lahene sobivaks kuupäevaks.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Kasutaja muutis andmete sisestamise ajal kursori asukohta." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.01.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.01.debug.js new file mode 100644 index 000000000..d2661eece --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.01.debug.js @@ -0,0 +1,1600 @@ +/* Excel specific API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { + OnlyVisible: "onlyVisible" +}); +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +} +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed" +}; +OSF.DDA.RichClientSettingsManager={ + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + window.external.GetContext().GetSettings().Read(keys, values); + if (onReceiving) { + onReceiving(); + } + var serializedSettings={}; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + return serializedSettings; + }, + write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving) { + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + if (onCalling) { + onCalling(); + } + window.external.GetContext().GetSettings().Write(keys, values); + if (onReceiving) { + onReceiving(); + } + } +}; +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + try { + response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name : Strings.OfficeOM.L_InternalError, message : ex }; + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving); + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.write( + hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], + hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], + onCalling, + onReceiving + ); + } + switch (actionId) { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break; + } + return delegateMethods; +} +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], + privateState + ); +} +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() { + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id]=dispatch; + } + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], + partId + ); +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], + handle + ); +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if (rows==1 && cols==1) { + ret=[vbArr]; + } else { + ret=[]; + for (var row=0; row < rows; row++) { + var rowArr=[]; + for (var col=0; col < cols; col++) { + var datum=vbArr[row * cols+col]; + if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode, + Microsoft.Office.Internal.Parameters.OfficeTheme, + Microsoft.Office.Internal.Parameters.DocumentTheme + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; + this.dynamicTypes=dynamicTypes; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.FilePropertiesDescriptor; + define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: ns.Url, value: 0 } + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: 0} + ] + }) + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 }, + { name: ns.SlideRange, value:7 } + ] + }); + ns=Microsoft.Office.WebExtension.GoToType; + define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: ns.Binding, value: 0 }, + { name: ns.NamedItem, value: 1 }, + { name: ns.Slide, value: 2 }, + { name: ns.Index, value: 3 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 }, + { name: ns.Pdf, value: 6 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.Internal.OfficeTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.OfficeTheme, + fromHost: [ + {name: ns.PrimaryFontColor, value: 0}, + {name: ns.PrimaryBackgroundColor, value: 1}, + {name: ns.SecondaryFontColor, value:2}, + {name: ns.SecondaryBackgroundColor, value:3} + ] + }) + } + ns=Microsoft.Office.WebExtension.ActiveView; + if (ns) { + define({ + type:Microsoft.Office.WebExtension.Parameters.ActiveView, + fromHost: [ + {name: 0, value: ns.Read}, + {name: 1, value: ns.Edit} + ] + }) + } + ns=Microsoft.Office.Internal.DocumentTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.DocumentTheme, + fromHost: [ + {name: ns.PrimaryBackgroundColor, value: 0}, + {name: ns.PrimaryFontColor, value: 1}, + {name: ns.SecondaryBackgroundColor, value: 2}, + {name: ns.SecondaryFontColor, value: 3}, + {name: ns.Accent1, value: 4}, + {name: ns.Accent2, value: 5}, + {name: ns.Accent3, value: 6}, + {name: ns.Accent4, value: 7}, + {name: ns.Accent5, value: 8}, + {name: ns.Accent6, value: 9}, + {name: ns.Hyperlink, value: 10}, + {name: ns.FollowedHyperlink, value: 11}, + {name: ns.HeaderLatinFont, value: 12}, + {name: ns.HeaderEastAsianFont, value: 13}, + {name: ns.HeaderScriptFont, value: 14}, + {name: ns.HeaderLocalizedFont, value: 15}, + {name: ns.BodyLatinFont, value: 16}, + {name: ns.BodyEastAsianFont, value: 17}, + {name: ns.BodyScriptFont, value: 18}, + {name: ns.BodyLocalizedFont, value: 19} + ] + }) + } + ns=Microsoft.Office.WebExtension.SelectionMode; + define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: ns.Default, value: 0 }, + { name: ns.Selected, value: 1 }, + { name: ns.None, value: 2 }, + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidNavigateToMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.GoToType, value: 1 }, + { name: ns.SelectionMode, value: 2 } + ] + }); + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidClearFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidSetTableOptionsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.TableOptions, value: 1 }, + ] + }); + define({ + type: cns.dispidSetFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CellFormat, value: 1 }, + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: self } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDocumentThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidOfficeThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidActiveViewChangedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + parameterMap.define=define; + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +delete Microsoft.Office.WebExtension.FileType; +OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) { + var bf=new OSF.DDA.BindingFacade(this); + OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]); + OSF.DDA.ExcelDocument.uber.constructor.call(this, + officeAppContext, + bf, + settings + ); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GoToByIdAsync + ]); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument); +OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.ClearFormatsAsync, + am.SetTableOptionsAsync, + am.SetFormatsAsync + ]); + OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 } + ] +}); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 } + ] +}); +Microsoft.Office.WebExtension.Table={ + All : 0, + Data : 1, + Headers : 2 +}; +(function (){ + var tableOptionProperties={ + headerRow : 0, + bandedRows : 1, + firstColumn : 2, + lastColumn : 3, + bandedColumns : 4, + filterButton : 5, + style : 6, + totalRow : 7 + }; + var cellProperties={ + row : 0, + column : 1 + }; + var formatProperties={ + alignHorizontal : {text:"alignHorizontal", type:1}, + alignVertical : {text:"alignVertical", type:2}, + backgroundColor : {text:"backgroundColor", type:101}, + borderStyle : {text:"borderStyle", type:201}, + borderColor : {text:"borderColor", type:202}, + borderTopStyle : {text:"borderTopStyle", type:203}, + borderTopColor : {text:"borderTopColor", type:204}, + borderBottomStyle : {text:"borderBottomStyle", type:205}, + borderBottomColor : {text:"borderBottomColor", type:206}, + borderLeftStyle : {text:"borderLeftStyle", type:207}, + borderLeftColor : {text:"borderLeftColor", type:208}, + borderRightStyle : {text:"borderRightStyle", type:209}, + borderRightColor : {text:"borderRightColor", type:210}, + borderOutlineStyle : {text:"borderOutlineStyle", type:211}, + borderOutlineColor : {text:"borderOutlineColor", type:212}, + borderInlineStyle : {text:"borderInlineStyle", type:213}, + borderInlineColor : {text:"borderInlineColor", type:214}, + fontFamily : {text:"fontFamily", type:301}, + fontStyle : {text:"fontStyle", type:302}, + fontSize : {text:"fontSize", type:303}, + fontUnderlineStyle : {text:"fontUnderlineStyle", type:304}, + fontColor : {text:"fontColor", type:305}, + fontDirection : {text:"fontDirection", type:306}, + fontStrikethrough : {text:"fontStrikethrough", type:307}, + fontSuperscript : {text:"fontSuperscript", type:308}, + fontSubscript : {text:"fontSubscript", type:309}, + fontNormal : {text:"fontNormal", type:310}, + indentLeft : {text:"indentLeft", type:401}, + indentRight : {text:"indentRight", type:402}, + numberFormat: {text:"numberFormat", type:501}, + width : {text:"width", type:701}, + height : {text:"height", type:702}, + wrapping : {text:"wrapping", type:703} + }; + var borderStyleSet=[ + {name:"none", value: 0}, + {name:"thin", value: 1}, + {name:"medium", value: 2}, + {name:"dashed", value: 3}, + {name:"dotted", value: 4}, + {name:"thick", value: 5}, + {name:"double", value: 6}, + {name:"hair", value: 7}, + {name:"medium dashed", value: 8}, + {name:"dash dot", value: 9}, + {name:"medium dash dot", value: 10}, + {name:"dash dot dot", value: 11}, + {name:"medium dash dot dot", value: 12}, + {name:"slant dash dot", value: 13}, + ]; + var colorSet=[ + {name: "none", value: 0}, + {name: "black", value: 1}, + {name: "blue", value: 2}, + {name: "gray", value: 3}, + {name: "green", value: 4}, + {name: "orange", value: 5}, + {name: "pink", value: 6}, + {name: "purple", value: 7}, + {name: "red", value: 8}, + {name: "teal", value: 9}, + {name: "turquoise", value: 10}, + {name: "violet", value: 11}, + {name: "white", value: 12}, + {name: "yellow", value: 13}, + {name: "automatic", value: 14}, + ]; + var ns=OSF.DDA.SafeArray.Delegate.ParameterMap; + ns.define({ + type: formatProperties.alignHorizontal.text, + toHost: [ + {name: "general", value: 0}, + {name: "left", value: 1}, + {name: "center", value: 2}, + {name: "right", value: 3}, + {name: "fill", value: 4}, + {name: "justify", value: 5}, + {name: "center across selection", value: 6}, + {name: "distributed", value: 7}, + ]}); + ns.define({ + type: formatProperties.alignVertical.text, + toHost: [ + {name: "top", value: 0}, + {name: "center", value: 1}, + {name: "bottom", value: 2}, + {name: "justify", value: 3}, + {name: "distributed", value: 4}, + ]}); + ns.define({ + type: formatProperties.backgroundColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderTopStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderTopColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderBottomStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderBottomColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderLeftStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderLeftColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderRightStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderRightColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderOutlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderOutlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderInlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderInlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontStyle.text, + toHost: [ + {name: "regular", value: 0}, + {name: "italic", value: 1}, + {name: "bold", value: 2}, + {name: "bold italic", value: 3}, + ]}); + ns.define({ + type: formatProperties.fontUnderlineStyle.text, + toHost: [ + {name: "none", value: 0}, + {name: "single", value: 1}, + {name: "double", value: 2}, + {name: "single accounting", value: 3}, + {name: "double accounting", value: 4}, + ]}); + ns.define({ + type: formatProperties.fontColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontDirection.text, + toHost: [ + {name: "context", value: 0}, + {name: "left-to-right", value: 1}, + {name: "right-to-left", value: 2}, + ]}); + ns.define({ + type: formatProperties.width.text, + toHost: [ + {name: "auto fit", value: -1}, + ]}); + ns.define({ + type: formatProperties.height.text, + toHost: [ + {name: "auto fit", value: -1}, + ]}); + ns.define({ + type: Microsoft.Office.WebExtension.Parameters.TableOptions, + toHost: [ + {name: "headerRow", value: 0 }, + {name: "bandedRows", value: 1 }, + {name: "firstColumn", value: 2 }, + {name: "lastColumn", value: 3 }, + {name: "bandedColumns", value: 4 }, + {name: "filterButton", value: 5 }, + {name: "style", value: 6 }, + {name: "totalRow", value: 7 } + ]}); + ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={ + toHost: function (data) { + for (entry in data) { + if (data[entry].format) { + data[entry].format=ns.mapValues(data[entry].format, "toHost"); + } + } + return data; + }, + fromHost: function (args) { + return args; + } + } + ns.specialProcessorDynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]=(function () { + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) { + var textCells="cells"; + var textFormat="format"; + var posCells=0; + var posFormat=1; + var ret=[]; + for (index in cellFormats) { + var cfOld=cellFormats[index]; + var cfNew=[]; + if (cfOld[textCells] !=='undefined') { + var cellsOld=cfOld[textCells]; + var cellsNew; + if (typeof cfOld[textCells]==="object") { + cellsNew=[]; + for (entry in cellsOld) { + if (typeof(cellProperties[entry])!=='undefined') { + cellsNew[cellProperties[entry]]=cellsOld[entry]; + } + } + } else { + cellsNew=cellsOld; + } + cfNew[posCells]=cellsNew; + } + if (cfOld[textFormat]) { + var formatOld=cfOld[textFormat]; + var formatNew=[]; + for (entry in formatOld) { + if (typeof(formatProperties[entry])!=='undefined') { + formatNew.push([formatProperties[entry].type, formatOld[entry]]); + } + } + cfNew[posFormat]=formatNew; + } + ret[index]=cfNew; + } + return ret; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) { + return hostArgs; + } + } + })(); + ns.specialProcessorDynamicTypes[Microsoft.Office.WebExtension.Parameters.TableOptions]=(function () { + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) { + var ret=[]; + for (entry in tableOptions) { + if (tableOptionProperties[entry]!=undefined){ + ret[tableOptionProperties[entry]]=tableOptions[entry]; + } + } + return ret; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) { + return hostArgs; + } + } + })(); +})(); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.01.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.01.js new file mode 100644 index 000000000..c0333f1ef --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.01.js @@ -0,0 +1,11 @@ +/* Excel specific API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType,{OnlyVisible:"onlyVisible"});OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.RichClientSettingsManager={read:function(e,d){var b=[],f=[];e&&e();window.external.GetContext().GetSettings().Read(b,f);d&&d();for(var c={},a=0;a0&&b.push(c)}}}catch(i){}return b}var d=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.EventDescriptors.DocumentThemeChangedEvent,OSF.DDA.EventDescriptors.OfficeThemeChangedEvent,OSF.DDA.EventDescriptors.ActiveViewChangedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode,Microsoft.Office.Internal.Parameters.OfficeTheme,Microsoft.Office.Internal.Parameters.DocumentTheme],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var b=0,a=1;return {toHost:function(c){if(typeof c!="string"&&c[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[b]=c[OSF.DDA.TableDataProperties.TableRows];d[a]=c[OSF.DDA.TableDataProperties.TableHeaders];c=d}return c},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=c(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=c(d[b]);e[OSF.DDA.TableDataProperties.TableHeaders]=c(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(b,d,a);b.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};b.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b};b.dynamicTypes=a};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var f=true,e=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=e.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +delete Microsoft.Office.WebExtension.FileType; +OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) { + var bf=new OSF.DDA.BindingFacade(this); + OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]); + OSF.DDA.ExcelDocument.uber.constructor.call(this, + officeAppContext, + bf, + settings + ); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.js new file mode 100644 index 000000000..56b8c3a11 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-15.js @@ -0,0 +1,11 @@ +/* Excel specific API library */ +/* Version: 15.0.4420.1017 Build Time: 03/31/2014 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType,{OnlyVisible:"onlyVisible"});OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.RichClientSettingsManager={read:function(e,d){var b=[],f=[];e&&e();window.external.GetContext().GetSettings().Read(b,f);d&&d();for(var c={},a=0;a0&&b.push(c)}}}catch(i){}return b}var c=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,a=1;return {toHost:function(b){if(typeof b!="string"&&b[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=b[OSF.DDA.TableDataProperties.TableRows];d[a]=b[OSF.DDA.TableDataProperties.TableHeaders];b=d}return b},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=b(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=b(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=b(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,a);this.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};this.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var e=true,f=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=f.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + + +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response = { + Status: 0, + Payload: 1 +}; + +OSF.DDA.SafeArray.UniqueArguments = { + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException = function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number = ex.number; + if (number) { + switch (number) { + case -2146828218: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor = function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows = vbArr.ubound(1); + var cols = vbArr.ubound(2); + vbArr = vbArr.toArray(); + if (rows == 1 && cols == 1) { + ret = [vbArr]; + } else { + ret = []; + for (var row = 0; row < rows; row++) { + var rowArr = []; + for (var col = 0; col < cols; col++) { + var datum = vbArr[row * cols + col]; + if (datum != OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes = []; + var dynamicTypes = {}; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = (function () { + var tableRows = 0; + var tableHeaders = 1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data != "string" && data[OSF.DDA.TableDataProperties.TableRows] !== undefined) { + var tableData = []; + tableData[tableRows] = data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders] = data[OSF.DDA.TableDataProperties.TableHeaders]; + data = tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs.toArray) { + var dimensions = hostArgs.dimensions(); + if (dimensions === 2) { + ret = _2DVBArrayToJaggedArray(hostArgs); + } else { + var array = hostArgs.toArray(); + if (array.length === 2 && ((array[0] != null && array[0].toArray) || (array[1] != null && array[1].toArray))) { + ret = {}; + ret[OSF.DDA.TableDataProperties.TableRows] = _2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders] = _2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret = array; + } + } + } else { + ret = hostArgs; + } + return ret; + } + }; + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + + this.unpack = function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + var toArraySupported = (arg || typeof arg === "unknown") && arg.toArray; + value = toArraySupported ? arg.toArray() : arg || {}; + } else if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; + +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); + +OSF.DDA.SafeArray.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [ + { + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 }, + { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 } + ] + }, + { + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 } + ] + } +]); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 }, + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 } + ] +}); +OSF.DDA.SafeArray.Delegate.executeAsync = function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + function toArray(args) { + var arrArgs = args; + if (OSF.OUtil.isArray(args)) { + var len = arrArgs.length; + for (var i = 0; i < len; i++) { + arrArgs[i] = toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs = args.getVarDate(); + } else if (typeof args === "object" && !OSF.OUtil.isArray(args)) { + arrArgs = []; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index] = toArray(args[index]); + } + } + } + return arrArgs; + } + function fromSafeArray(value) { + var ret = value; + if (value != null && value.toArray) { + var arrayResult = value.toArray(); + for (var i = 0; i < arrayResult.length; i++) { + arrayResult[i] = fromSafeArray(arrayResult[i]); + } + ret = arrayResult; + } + return ret; + } + try { + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + var result = hostResponseArgs.toArray(); + var status = result[OSF.DDA.SafeArray.Response.Status]; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) { + var payload = result[OSF.DDA.SafeArray.Response.Payload]; + payload = fromSafeArray(payload); + if (payload != null) { + if (!args._chunkResultData) { + args._chunkResultData = new Array(); + } + + args._chunkResultData[payload[0]] = payload[1]; + } + } else { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload = []; + for (var i = 1; i < result.length; i++) + payload[i - 1] = result[i]; + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + if (args._chunkResultData) { + payload = fromSafeArray(payload); + if (payload != null) { + var expectedChunkCount = payload[payload.length - 1]; + if (args._chunkResultData.length == expectedChunkCount) { + payload[payload.length - 1] = args._chunkResultData; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + } + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + }); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent = function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status = hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync = function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync = function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; + +OSF.ClientMode = { + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason = { + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = this.initializeSettings; +}; +OSF.InitializationHelper.prototype.deserializeSettings = function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) { + var settings; + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = (typeof (JSON) !== "undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = (typeof (JSON) !== "undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface = function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + var license = new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler = (OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler)); + var getDelegateMethods, parameterMap; + getDelegateMethods = OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); +}; +OSF.InitializationHelper.prototype.getInitializationReason = function (appContext) { + return OSF.DDA.RichInitializationReason[appContext.get_reason()]; +}; + +OSF.DDA.DispIdHost.getClientDelegateMethods = function (actionId) { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + + if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId == OSF.DDA.AsyncMethodNames.RefreshAsync.id) { + var readSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings); + } + if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId == OSF.DDA.AsyncMethodNames.SaveAsync.id) { + var writeSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings); + } + return delegateMethods; +}; + +var OSF = OSF || {}; +var OSFWebkit; +(function (OSFWebkit) { + var WebkitSafeArray = (function () { + function WebkitSafeArray(data) { + this.data = data; + this.safeArrayFlag = this.isSafeArray(data); + } + WebkitSafeArray.prototype.dimensions = function () { + var dimensions = 0; + if (this.safeArrayFlag) { + dimensions = this.data[0][0]; + } else if (this.isArray()) { + dimensions = 2; + } + return dimensions; + }; + WebkitSafeArray.prototype.getItem = function () { + var array = []; + var element = null; + if (this.safeArrayFlag) { + array = this.toArray(); + } else { + array = this.data; + } + + element = array; + for (var i = 0; i < arguments.length; i++) { + element = element[arguments[i]]; + } + return element; + }; + WebkitSafeArray.prototype.lbound = function (dimension) { + return 0; + }; + WebkitSafeArray.prototype.ubound = function (dimension) { + var ubound = 0; + if (this.safeArrayFlag) { + ubound = this.data[0][dimension]; + } else if (this.isArray()) { + if (dimension == 1) { + return this.data.length; + } else if (dimension == 2) { + if (OSF.OUtil.isArray(this.data[0])) { + return this.data[0].length; + } else if (this.data[0] != null) { + return 1; + } + } + } + return ubound; + }; + WebkitSafeArray.prototype.toArray = function () { + if (this.isArray() == false) { + return this.data; + } + + var arr = []; + var startingIndex = this.safeArrayFlag ? 1 : 0; + for (var i = startingIndex; i < this.data.length; i++) { + var element = this.data[i]; + if (this.isSafeArray(element)) { + arr.push(new WebkitSafeArray(element)); + } else { + arr.push(element); + } + } + return arr; + }; + WebkitSafeArray.prototype.isArray = function () { + return OSF.OUtil.isArray(this.data); + }; + WebkitSafeArray.prototype.isSafeArray = function (obj) { + var isSafeArray = false; + if (OSF.OUtil.isArray(obj) && OSF.OUtil.isArray(obj[0])) { + var bounds = obj[0]; + var dimensions = bounds[0]; + if (bounds.length != dimensions + 1) { + return false; + } + var expectedArraySize = 1; + for (var i = 1; i < bounds.length; i++) { + var dimension = bounds[i]; + if (isFinite(dimension) == false) { + return false; + } + expectedArraySize = expectedArraySize * dimension; + } + + expectedArraySize++; + isSafeArray = (expectedArraySize == obj.length); + } + return isSafeArray; + }; + return WebkitSafeArray; + })(); + OSFWebkit.WebkitSafeArray = WebkitSafeArray; +})(OSFWebkit || (OSFWebkit = {})); +var OSFWebkit; +(function (OSFWebkit) { + (function (ScriptMessaging) { + var scriptMessenger = null; + + function agaveHostCallback(callbackId, params) { + scriptMessenger.agaveHostCallback(callbackId, params); + } + ScriptMessaging.agaveHostCallback = agaveHostCallback; + + function agaveHostEventCallback(callbackId, params) { + scriptMessenger.agaveHostEventCallback(callbackId, params); + } + ScriptMessaging.agaveHostEventCallback = agaveHostEventCallback; + function GetScriptMessenger() { + if (scriptMessenger == null) { + scriptMessenger = new WebkitScriptMessaging("OSF.ScriptMessaging.agaveHostCallback", "OSF.ScriptMessaging.agaveHostEventCallback"); + } + return scriptMessenger; + } + ScriptMessaging.GetScriptMessenger = GetScriptMessenger; + var EventHandlerCallback = (function () { + function EventHandlerCallback(id, targetId, handler) { + this.id = id; + this.targetId = targetId; + this.handler = handler; + } + return EventHandlerCallback; + })(); + var WebkitScriptMessaging = (function () { + function WebkitScriptMessaging(methodCallbackName, eventCallbackName) { + this.callingIndex = 0; + this.callbackList = {}; + this.eventHandlerList = {}; + this.asyncMethodCallbackFunctionName = methodCallbackName; + this.eventCallbackFunctionName = eventCallbackName; + + this.conversationId = WebkitScriptMessaging.getCurrentTimeMS().toString(); + } + WebkitScriptMessaging.prototype.invokeMethod = function (handlerName, methodId, params, callback) { + var messagingArgs = {}; + this.postWebkitMessage(messagingArgs, handlerName, methodId, params, callback); + }; + + WebkitScriptMessaging.prototype.registerEvent = function (handlerName, methodId, dispId, targetId, handler, callback) { + var messagingArgs = { + eventCallbackFunction: this.eventCallbackFunctionName + }; + var hostArgs = { + id: dispId, + targetId: targetId + }; + var correlationId = this.postWebkitMessage(messagingArgs, handlerName, methodId, hostArgs, callback); + + this.eventHandlerList[correlationId] = new EventHandlerCallback(dispId, targetId, handler); + }; + + WebkitScriptMessaging.prototype.unregisterEvent = function (handlerName, methodId, dispId, targetId, callback) { + var hostArgs = { + id: dispId, + targetId: targetId + }; + + for (var key in this.eventHandlerList) { + if (this.eventHandlerList.hasOwnProperty(key)) { + var eventCallback = this.eventHandlerList[key]; + if (eventCallback.id == dispId && eventCallback.targetId == targetId) { + delete this.eventHandlerList[key]; + } + } + } + this.invokeMethod(handlerName, methodId, hostArgs, callback); + }; + + WebkitScriptMessaging.prototype.agaveHostCallback = function (callbackId, params) { + var callbackFunction = this.callbackList[callbackId]; + if (callbackFunction) { + callbackFunction(params); + + delete this.callbackList[callbackId]; + } + }; + + WebkitScriptMessaging.prototype.agaveHostEventCallback = function (callbackId, params) { + var eventCallback = this.eventHandlerList[callbackId]; + if (eventCallback) { + eventCallback.handler(params); + } + }; + + WebkitScriptMessaging.prototype.postWebkitMessage = function (messagingArgs, handlerName, methodId, params, callback) { + var correlationId = this.generateCorrelationId(); + this.callbackList[correlationId] = callback; + messagingArgs.methodId = methodId; + messagingArgs.params = params; + messagingArgs.callbackId = correlationId; + messagingArgs.callbackFunction = this.asyncMethodCallbackFunctionName; + var invokePostMessage = function () { + window.webkit.messageHandlers[handlerName].postMessage(JSON.stringify(messagingArgs)); + }; + + var currentTimestamp = WebkitScriptMessaging.getCurrentTimeMS(); + if (this.lastMessageTimestamp == null || (currentTimestamp - this.lastMessageTimestamp >= WebkitScriptMessaging.MESSAGE_TIME_DELTA)) { + invokePostMessage(); + this.lastMessageTimestamp = currentTimestamp; + } else { + this.lastMessageTimestamp += WebkitScriptMessaging.MESSAGE_TIME_DELTA; + setTimeout(function () { + invokePostMessage(); + }, this.lastMessageTimestamp - currentTimestamp); + } + return correlationId; + }; + + WebkitScriptMessaging.prototype.generateCorrelationId = function () { + ++this.callingIndex; + return this.conversationId + this.callingIndex; + }; + + WebkitScriptMessaging.getCurrentTimeMS = function () { + return (new Date).getTime(); + }; + WebkitScriptMessaging.MESSAGE_TIME_DELTA = 10; + return WebkitScriptMessaging; + })(); + ScriptMessaging.WebkitScriptMessaging = WebkitScriptMessaging; + })(OSFWebkit.ScriptMessaging || (OSFWebkit.ScriptMessaging = {})); + var ScriptMessaging = OSFWebkit.ScriptMessaging; +})(OSFWebkit || (OSFWebkit = {})); +OSF.ScriptMessaging = OSFWebkit.ScriptMessaging; + +var OSFWebkit; +(function (OSFWebkit) { + OSFWebkit.MessageHandlerName = "Agave"; + (function (AppContextProperties) { + AppContextProperties[AppContextProperties["Settings"] = 0] = "Settings"; + AppContextProperties[AppContextProperties["SolutionReferenceId"] = 1] = "SolutionReferenceId"; + AppContextProperties[AppContextProperties["AppType"] = 2] = "AppType"; + AppContextProperties[AppContextProperties["MajorVersion"] = 3] = "MajorVersion"; + AppContextProperties[AppContextProperties["MinorVersion"] = 4] = "MinorVersion"; + AppContextProperties[AppContextProperties["RevisionVersion"] = 5] = "RevisionVersion"; + AppContextProperties[AppContextProperties["APIVersionSequence"] = 6] = "APIVersionSequence"; + AppContextProperties[AppContextProperties["AppCapabilities"] = 7] = "AppCapabilities"; + AppContextProperties[AppContextProperties["APPUILocale"] = 8] = "APPUILocale"; + AppContextProperties[AppContextProperties["AppDataLocale"] = 9] = "AppDataLocale"; + AppContextProperties[AppContextProperties["BindingCount"] = 10] = "BindingCount"; + AppContextProperties[AppContextProperties["DocumentUrl"] = 11] = "DocumentUrl"; + AppContextProperties[AppContextProperties["ActivationMode"] = 12] = "ActivationMode"; + AppContextProperties[AppContextProperties["ControlIntegrationLevel"] = 13] = "ControlIntegrationLevel"; + AppContextProperties[AppContextProperties["SolutionToken"] = 14] = "SolutionToken"; + AppContextProperties[AppContextProperties["APISetVersion"] = 15] = "APISetVersion"; + AppContextProperties[AppContextProperties["CorrelationId"] = 16] = "CorrelationId"; + AppContextProperties[AppContextProperties["InstanceId"] = 17] = "InstanceId"; + AppContextProperties[AppContextProperties["TouchEnabled"] = 18] = "TouchEnabled"; + AppContextProperties[AppContextProperties["CommerceAllowed"] = 19] = "CommerceAllowed"; + AppContextProperties[AppContextProperties["RequirementMatrix"] = 20] = "RequirementMatrix"; + })(OSFWebkit.AppContextProperties || (OSFWebkit.AppContextProperties = {})); + var AppContextProperties = OSFWebkit.AppContextProperties; + (function (MethodId) { + MethodId[MethodId["Execute"] = 1] = "Execute"; + MethodId[MethodId["RegisterEvent"] = 2] = "RegisterEvent"; + MethodId[MethodId["UnregisterEvent"] = 3] = "UnregisterEvent"; + MethodId[MethodId["WriteSettings"] = 4] = "WriteSettings"; + MethodId[MethodId["GetContext"] = 5] = "GetContext"; + })(OSFWebkit.MethodId || (OSFWebkit.MethodId = {})); + var MethodId = OSFWebkit.MethodId; + var WebkitHostController = (function () { + function WebkitHostController(hostScriptProxy) { + this.hostScriptProxy = hostScriptProxy; + } + WebkitHostController.prototype.execute = function (id, params, callback) { + var args = params; + if (args == null) { + args = []; + } + var hostParams = { + id: id, + apiArgs: args + }; + var agaveResponseCallback = function (payload) { + var safeArraySource = payload; + if (OSF.OUtil.isArray(payload) && payload.length >= 2) { + var hrStatus = payload[0]; + + safeArraySource = payload[1]; + } + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.Execute, hostParams, agaveResponseCallback); + }; + WebkitHostController.prototype.registerEvent = function (id, targetId, handler, callback) { + var agaveEventHandlerCallback = function (payload) { + var safeArraySource = payload; + var eventId = 0; + if (OSF.OUtil.isArray(payload) && payload.length >= 2) { + safeArraySource = payload[0]; + eventId = payload[1]; + } + if (handler) { + handler(eventId, new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + var agaveResponseCallback = function (payload) { + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(payload)); + } + }; + this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.RegisterEvent, id, targetId, agaveEventHandlerCallback, agaveResponseCallback); + }; + WebkitHostController.prototype.unregisterEvent = function (id, targetId, callback) { + var agaveResponseCallback = function (response) { + callback(new OSFWebkit.WebkitSafeArray(response)); + }; + this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.UnregisterEvent, id, targetId, agaveResponseCallback); + }; + return WebkitHostController; + })(); + OSFWebkit.WebkitHostController = WebkitHostController; +})(OSFWebkit || (OSFWebkit = {})); +OSF.Webkit = OSFWebkit; +OSF.ClientHostController = new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger()); +OSF.DDA.ClientSettingsManager = { + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + var onComplete = function onComplete(status, response) { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + try { + hostDelegateMethod(args.hostCallArgs, args.onCalling, onComplete); + } catch (ex) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response = { name: Strings.OfficeOM.L_InternalError, message: ex }; + onComplete(status, response); + } + }; + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onComplete) { + var keys = []; + var values = []; + if (onCalling) { + onCalling(); + } + + var initializationHelper = OSF._OfficeAppFactory.getInitializationHelper(); + var onReceivedContext = function onReceivedContext(appContext) { + if (onComplete) { + onComplete(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, appContext.get_settings()); + } + }; + initializationHelper.getAppContext(null, onReceivedContext); + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onComplete) { + var hostParams = {}; + var keys = []; + var values = []; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + hostParams["keys"] = keys; + hostParams["values"] = values; + if (onCalling) { + onCalling(); + } + var onWriteCompleted = function onWriteCompleted(status) { + if (onComplete) { + onComplete(status[0], null); + } + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.WriteSettings, hostParams, onWriteCompleted); + } +}; +OSF.InitializationHelper.prototype.initializeSettings = function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) { + var serializedSettings = appContext.get_settings(); + var settings = this.deserializeSettings(serializedSettings, refreshSupported); + return settings; +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var getInvocationCallback = function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(appContext) { + var returnedContext; + var appContextProperties = OSF.Webkit.AppContextProperties; + var appType = appContext[appContextProperties.AppType]; + var appTypeSupported = false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry] == appType) { + appTypeSupported = true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type " + appType; + } + var hostSettings = appContext[appContextProperties.Settings]; + var serializedSettings = {}; + var keys = hostSettings[0]; + var values = hostSettings[1]; + for (var index = 0; index < keys.length; index++) { + serializedSettings[keys[index]] = values[index]; + } + var id = appContext[appContextProperties.SolutionReferenceId]; + var version = appContext[appContextProperties.MajorVersion]; + var clientMode = appContext[appContextProperties.AppCapabilities]; + var UILocale = appContext[appContextProperties.APPUILocale]; + var dataLocale = appContext[appContextProperties.AppDataLocale]; + var docUrl = appContext[appContextProperties.DocumentUrl]; + var reason = appContext[appContextProperties.ActivationMode]; + var osfControlType = appContext[appContextProperties.ControlIntegrationLevel]; + var eToken = appContext[appContextProperties.SolutionToken]; + eToken = eToken ? eToken.toString() : ""; + var correlationId = appContext[appContextProperties.CorrelationId]; + var appInstanceId = appContext[appContextProperties.InstanceId]; + var touchEnabled = appContext[appContextProperties.TouchEnabled]; + var commerceAllowed = appContext[appContextProperties.CommerceAllowed]; + var minorVersion = appContext[appContextProperties.MinorVersion]; + var requirementMatrix = appContext[appContextProperties.RequirementMatrix]; + returnedContext = new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, serializedSettings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.GetContext, [], getInvocationCallback); +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); + +Microsoft.Office.WebExtension.BindingType = { + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties = { + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise = function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id = bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t = typeof onError; + if (t != "undefined" && t != "function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback = onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype = { + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me = this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status == Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade = function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches = []; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding = function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding = function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et = Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches = docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id] = new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch = bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId = function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_" + OSF.OUtil.getUniqueId() + "_" + new Date().getTime(); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding = function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id = bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows = bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols = bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders = bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding = new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding = new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp = function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject = OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject = OSF.DDA.TableBinding; + } + binding = new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding = new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id = callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); + +OSF.DDA.MatrixBinding = function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) { + OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Matrix + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + } + }); +}; +OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: 0 }, + { name: OSF.DDA.BindingProperties.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 } + ], + invertible: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: OSF.DDA.BindingProperties.RowCount, value: 0 }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddColumnsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties = { + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding = function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.DDA.TextBinding = function OSF_DDA_TextBinding(id, docInstance) { + OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperty(this, "type", { + value: Microsoft.Office.WebExtension.BindingType.Text + }); +}; +OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.PromptText, + value: { + "types": ["string"], + "calculate": function () { + return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.SampleData, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: function (bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: 2 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs = function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + BindingSelectionChanged: "bindingSelectionChanged", + BindingDataChanged: "bindingDataChanged" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" }); +OSF.DDA.BindingSelectionChangedEventArgs = function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged + }, + "binding": { + value: bindingInstance + } + }); + for (var prop in subset) { + OSF.OUtil.defineEnumerableProperty(this, prop, { + value: subset[prop] + }); + } +}; +OSF.DDA.BindingDataChangedEventArgs = function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingDataChanged + }, + "binding": { + value: bindingInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }] +}); + +Microsoft.Office.WebExtension.GoToType = { + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode = { + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index = { + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 } + ] +}); +OSF.DDA.FilePropertiesDescriptor = { + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties = function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); + + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + + +OSF.DDA.ExcelTableBinding = function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) { + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.ClearFormatsAsync, + am.SetTableOptionsAsync, + am.SetFormatsAsync + ]); + OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding); + +(function () { + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + privateStateCallbacks: [] + }); + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var Parameters = Microsoft.Office.WebExtension.Parameters; + + if (callArgs[Parameters.StartRow] == 0 && callArgs[Parameters.StartColumn] == 0 && OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length === 0 && OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length === 0) { + delete callArgs[Parameters.StartRow]; + delete callArgs[Parameters.StartColumn]; + delete callArgs[Parameters.CellFormat]; + delete callArgs[Parameters.TableOptions]; + } + if (callArgs[Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] != 0) || (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] != 0) || callArgs[Parameters.CellFormat] || callArgs[Parameters.TableOptions])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: function (obj) { + return obj.id; + } + } + ] + }); + OSF.DDA.BindingPromise.prototype.setTableOptionsAsync = function OSF_DDA_BindingPromise$setTableOptionsAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setTableOptionsAsync.apply(binding, args); + }); + return this; + }, OSF.DDA.BindingPromise.prototype.setFormatsAsync = function OSF_DDA_BindingPromise$setFormatsAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setFormatsAsync.apply(binding, args); + }); + return this; + }, OSF.DDA.BindingPromise.prototype.clearFormatsAsync = function OSF_DDA_BindingPromise$clearFormatsAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.clearFormatsAsync.apply(binding, args); + }); + return this; + }; +})(); +(function () { + function getObjectId(obj) { + return obj.id; + } + OSF.DDA.AsyncMethodNames.addNames({ + ClearFormatsAsync: "clearFormatsAsync", + SetTableOptionsAsync: "setTableOptionsAsync", + SetFormatsAsync: "setFormatsAsync" + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.TableOptions, + "defaultValue": [] + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetFormatsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CellFormat, + "defaultValue": [] + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + + + +Microsoft.Office.WebExtension.Table = { + All: 0, + Data: 1, + Headers: 2 +}; +(function () { + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearFormatsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] + }); + + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 1 } + ] + }); + + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetFormatsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 1 } + ] + }); + + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 } + ] + }); + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 } + ] + }); + var tableOptionProperties = { + headerRow: 0, + bandedRows: 1, + firstColumn: 2, + lastColumn: 3, + bandedColumns: 4, + filterButton: 5, + style: 6, + totalRow: 7 + }; + var cellProperties = { + row: 0, + column: 1 + }; + var formatProperties = { + alignHorizontal: { text: "alignHorizontal", type: 1 }, + alignVertical: { text: "alignVertical", type: 2 }, + backgroundColor: { text: "backgroundColor", type: 101 }, + borderStyle: { text: "borderStyle", type: 201 }, + borderColor: { text: "borderColor", type: 202 }, + borderTopStyle: { text: "borderTopStyle", type: 203 }, + borderTopColor: { text: "borderTopColor", type: 204 }, + borderBottomStyle: { text: "borderBottomStyle", type: 205 }, + borderBottomColor: { text: "borderBottomColor", type: 206 }, + borderLeftStyle: { text: "borderLeftStyle", type: 207 }, + borderLeftColor: { text: "borderLeftColor", type: 208 }, + borderRightStyle: { text: "borderRightStyle", type: 209 }, + borderRightColor: { text: "borderRightColor", type: 210 }, + borderOutlineStyle: { text: "borderOutlineStyle", type: 211 }, + borderOutlineColor: { text: "borderOutlineColor", type: 212 }, + borderInlineStyle: { text: "borderInlineStyle", type: 213 }, + borderInlineColor: { text: "borderInlineColor", type: 214 }, + fontFamily: { text: "fontFamily", type: 301 }, + fontStyle: { text: "fontStyle", type: 302 }, + fontSize: { text: "fontSize", type: 303 }, + fontUnderlineStyle: { text: "fontUnderlineStyle", type: 304 }, + fontColor: { text: "fontColor", type: 305 }, + fontDirection: { text: "fontDirection", type: 306 }, + fontStrikethrough: { text: "fontStrikethrough", type: 307 }, + fontSuperscript: { text: "fontSuperscript", type: 308 }, + fontSubscript: { text: "fontSubscript", type: 309 }, + fontNormal: { text: "fontNormal", type: 310 }, + indentLeft: { text: "indentLeft", type: 401 }, + indentRight: { text: "indentRight", type: 402 }, + numberFormat: { text: "numberFormat", type: 501 }, + width: { text: "width", type: 701 }, + height: { text: "height", type: 702 }, + wrapping: { text: "wrapping", type: 703 } + }; + var borderStyleSet = [ + { name: "none", value: 0 }, + { name: "thin", value: 1 }, + { name: "medium", value: 2 }, + { name: "dashed", value: 3 }, + { name: "dotted", value: 4 }, + { name: "thick", value: 5 }, + { name: "double", value: 6 }, + { name: "hair", value: 7 }, + { name: "medium dashed", value: 8 }, + { name: "dash dot", value: 9 }, + { name: "medium dash dot", value: 10 }, + { name: "dash dot dot", value: 11 }, + { name: "medium dash dot dot", value: 12 }, + { name: "slant dash dot", value: 13 } + ]; + var colorSet = [ + { name: "none", value: 0 }, + { name: "black", value: 1 }, + { name: "blue", value: 2 }, + { name: "gray", value: 3 }, + { name: "green", value: 4 }, + { name: "orange", value: 5 }, + { name: "pink", value: 6 }, + { name: "purple", value: 7 }, + { name: "red", value: 8 }, + { name: "teal", value: 9 }, + { name: "turquoise", value: 10 }, + { name: "violet", value: 11 }, + { name: "white", value: 12 }, + { name: "yellow", value: 13 }, + { name: "automatic", value: 14 } + ]; + var ns = OSF.DDA.SafeArray.Delegate.ParameterMap; + ns.define({ + type: formatProperties.alignHorizontal.text, + toHost: [ + { name: "general", value: 0 }, + { name: "left", value: 1 }, + { name: "center", value: 2 }, + { name: "right", value: 3 }, + { name: "fill", value: 4 }, + { name: "justify", value: 5 }, + { name: "center across selection", value: 6 }, + { name: "distributed", value: 7 } + ] }); + ns.define({ + type: formatProperties.alignVertical.text, + toHost: [ + { name: "top", value: 0 }, + { name: "center", value: 1 }, + { name: "bottom", value: 2 }, + { name: "justify", value: 3 }, + { name: "distributed", value: 4 } + ] }); + ns.define({ + type: formatProperties.backgroundColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderTopStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderTopColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderBottomStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderBottomColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderLeftStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderLeftColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderRightStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderRightColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderOutlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderOutlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderInlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderInlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontStyle.text, + toHost: [ + { name: "regular", value: 0 }, + { name: "italic", value: 1 }, + { name: "bold", value: 2 }, + { name: "bold italic", value: 3 } + ] }); + ns.define({ + type: formatProperties.fontUnderlineStyle.text, + toHost: [ + { name: "none", value: 0 }, + { name: "single", value: 1 }, + { name: "double", value: 2 }, + { name: "single accounting", value: 3 }, + { name: "double accounting", value: 4 } + ] }); + ns.define({ + type: formatProperties.fontColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontDirection.text, + toHost: [ + { name: "context", value: 0 }, + { name: "left-to-right", value: 1 }, + { name: "right-to-left", value: 2 } + ] }); + ns.define({ + type: formatProperties.width.text, + toHost: [ + { name: "auto fit", value: -1 } + ] }); + ns.define({ + type: formatProperties.height.text, + toHost: [ + { name: "auto fit", value: -1 } + ] }); + ns.define({ + type: Microsoft.Office.WebExtension.Parameters.TableOptions, + toHost: [ + { name: "headerRow", value: 0 }, + { name: "bandedRows", value: 1 }, + { name: "firstColumn", value: 2 }, + { name: "lastColumn", value: 3 }, + { name: "bandedColumns", value: 4 }, + { name: "filterButton", value: 5 }, + { name: "style", value: 6 }, + { name: "totalRow", value: 7 } + ] }); + ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat] = { + toHost: function (data) { + for (var entry in data) { + if (data[entry].format) { + data[entry].format = ns.doMapValues(data[entry].format, "toHost"); + } + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat, { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) { + var textCells = "cells"; + var textFormat = "format"; + var posCells = 0; + var posFormat = 1; + var ret = []; + for (var index in cellFormats) { + var cfOld = cellFormats[index]; + var cfNew = []; + if (typeof (cfOld[textCells]) !== 'undefined') { + var cellsOld = cfOld[textCells]; + var cellsNew; + if (typeof cfOld[textCells] === "object") { + cellsNew = []; + for (var entry in cellsOld) { + if (typeof (cellProperties[entry]) !== 'undefined') { + cellsNew[cellProperties[entry]] = cellsOld[entry]; + } + } + } else { + cellsNew = cellsOld; + } + cfNew[posCells] = cellsNew; + } + if (cfOld[textFormat]) { + var formatOld = cfOld[textFormat]; + var formatNew = []; + for (var entry2 in formatOld) { + if (typeof (formatProperties[entry2]) !== 'undefined') { + formatNew.push([ + formatProperties[entry2].type, + formatOld[entry2] + ]); + } + } + cfNew[posFormat] = formatNew; + } + ret[index] = cfNew; + } + return ret; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) { + return hostArgs; + } + }); + ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions, { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) { + var ret = []; + for (var entry in tableOptions) { + if (typeof (tableOptionProperties[entry]) !== 'undefined') { + ret[tableOptionProperties[entry]] = tableOptions[entry]; + } + } + return ret; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) { + return hostArgs; + } + }); +})(); +OSF.DDA.ExcelDocument = function OSF_DDA_ExcelDocument(officeAppContext, settings) { + var bf = new OSF.DDA.BindingFacade(this); + OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]); + OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(appContext, false)); + appReady(); +}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-ios-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-ios-16.00.js new file mode 100644 index 000000000..60771e936 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-ios-16.00.js @@ -0,0 +1,11 @@ +/* Excel iOS specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b0&&b.push(c)}}}catch(i){}return b}var c=[],b={};b[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,b=1;return {toHost:function(a){if(typeof a!="string"&&a[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=a[OSF.DDA.TableDataProperties.TableRows];d[b]=a[OSF.DDA.TableDataProperties.TableHeaders];a=d}return a},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=a(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=a(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=a(d[b])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,b);this.unpack=function(c,a){var d;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c)){var e=(a||typeof a==="unknown")&&a.toArray;d=e?a.toArray():a||{}}else if(this.isDynamicType(c))d=b[c].fromHost(a);else d=a;return d}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(a){function c(a){var b=a;if(OSF.OUtil.isArray(a))for(var f=b.length,d=0;d2){c=[];for(var g=1;g=a.MESSAGE_TIME_DELTA){f();b.lastMessageTimestamp=d}else{b.lastMessageTimestamp+=a.MESSAGE_TIME_DELTA;setTimeout(function(){f()},b.lastMessageTimestamp-d)}return e};a.prototype.generateCorrelationId=function(){++this.callingIndex;return this.conversationId+this.callingIndex};a.getCurrentTimeMS=function(){return (new Date).getTime()};a.MESSAGE_TIME_DELTA=10;return a}();b.WebkitScriptMessaging=c})(a.ScriptMessaging||(a.ScriptMessaging={}));var b=a.ScriptMessaging})(OSFWebkit||(OSFWebkit={}));OSF.ScriptMessaging=OSFWebkit.ScriptMessaging;var OSFWebkit;(function(a){a.MessageHandlerName="Agave";(function(a){var u="RequirementMatrix",t="CommerceAllowed",s="TouchEnabled",r="InstanceId",q="CorrelationId",p="APISetVersion",o="SolutionToken",n="ControlIntegrationLevel",m="ActivationMode",l="DocumentUrl",k="BindingCount",j="AppDataLocale",i="APPUILocale",h="AppCapabilities",g="APIVersionSequence",f="RevisionVersion",e="MinorVersion",d="MajorVersion",c="SolutionReferenceId",b="Settings";a[a[b]=0]=b;a[a[c]=1]=c;a[a["AppType"]=2]="AppType";a[a[d]=3]=d;a[a[e]=4]=e;a[a[f]=5]=f;a[a[g]=6]=g;a[a[h]=7]=h;a[a[i]=8]=i;a[a[j]=9]=j;a[a[k]=10]=k;a[a[l]=11]=l;a[a[m]=12]=m;a[a[n]=13]=n;a[a[o]=14]=o;a[a[p]=15]=p;a[a[q]=16]=q;a[a[r]=17]=r;a[a[s]=18]=s;a[a[t]=19]=t;a[a[u]=20]=u})(a.AppContextProperties||(a.AppContextProperties={}));var c=a.AppContextProperties;(function(a){var e="GetContext",d="WriteSettings",c="UnregisterEvent",b="RegisterEvent";a[a["Execute"]=1]="Execute";a[a[b]=2]=b;a[a[c]=3]=c;a[a[d]=4]=d;a[a[e]=5]=e})(a.MethodId||(a.MethodId={}));var d=a.MethodId,b=function(){function b(a){this.hostScriptProxy=a}b.prototype.execute=function(g,f,c){var b=f;if(b==null)b=[];var e={id:g,apiArgs:b},d=function(b){var d=b;if(OSF.OUtil.isArray(b)&&b.length>=2){var e=b[0];d=b[1]}c&&c(new a.WebkitSafeArray(d))};this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.Execute,e,d)};b.prototype.registerEvent=function(g,f,c,b){var d=function(b){var d=b,e=0;if(OSF.OUtil.isArray(b)&&b.length>=2){d=b[0];e=b[1]}c&&c(e,new a.WebkitSafeArray(d))},e=function(c){b&&b(new a.WebkitSafeArray(c))};this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.RegisterEvent,g,f,d,e)};b.prototype.unregisterEvent=function(e,d,c){var b=function(b){c(new a.WebkitSafeArray(b))};this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.UnregisterEvent,e,d,b)};return b}();a.WebkitHostController=b})(OSFWebkit||(OSFWebkit={}));OSF.Webkit=OSFWebkit;OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger());OSF.DDA.ClientSettingsManager={getSettingsExecuteMethod:function(a){return function(b){var e,d,c=function(c,a){b.onReceiving&&b.onReceiving();b.onComplete&&b.onComplete(c,a)};try{a(b.hostCallArgs,b.onCalling,c)}catch(f){e=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;d={name:Strings.OfficeOM.L_InternalError,message:f};c(e,d)}}},read:function(b,a){var f=[],e=[];b&&b();var c=OSF._OfficeAppFactory.getInitializationHelper(),d=function(b){a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,b.get_settings())};c.getAppContext(null,d)},write:function(b,i,d,c){var a={},f=[],e=[];for(var g in b){f.push(g);e.push(b[g])}a["keys"]=f;a["values"]=e;d&&d();var h=function(a){c&&c(a[0],null)};OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.WriteSettings,a,h)}};OSF.InitializationHelper.prototype.initializeSettings=function(c,b){var a=c.get_settings(),d=this.deserializeSettings(a,b);return d};OSF.InitializationHelper.prototype.getAppContext=function(c,b){var a=function(c){var f,a=OSF.Webkit.AppContextProperties,g=c[a.AppType],i=false;for(var u in OSF.AppName)if(OSF.AppName[u]==g){i=true;break}if(!i)throw"Unsupported client type "+g;for(var j=c[a.Settings],h={},k=j[0],z=j[1],e=0;e40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(a){this._eventHandlers={};for(var c in a){var b=a[c];this._eventHandlers[b]=[]}};OSF.EventDispatch.prototype={getSupportedEvents:function(){var a=[];for(var b in this._eventHandlers)a.push(b);return a},supportsEvent:function(c){var a=false;for(var b in this._eventHandlers)if(c==b){a=true;break}return a},hasEventHandler:function(b,c){var a=this._eventHandlers[b];if(a&&a.length>0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SettingsManager.SerializedSettings},{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType};OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.BindingPromise=function(b,a){this._id=b;OSF.OUtil.defineEnumerableProperty(this,"onFail",{"get":function(){return a},"set":function(c){var b=typeof c;if(b!="undefined"&&b!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,b);a=c}})};OSF.DDA.BindingPromise.prototype={_fetch:function(b){var a=this;if(a.binding)b&&b(a.binding);else if(!a._binding){var c=a;Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(a._id,function(a){if(a.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded){OSF.OUtil.defineEnumerableProperty(c,"binding",{value:a.value});b&&b(c.binding)}else c.onFail&&c.onFail(a)})}return a},getDataAsync:function(){var a=arguments;this._fetch(function(b){b.getDataAsync.apply(b,a)});return this},setDataAsync:function(){var a=arguments;this._fetch(function(b){b.setDataAsync.apply(b,a)});return this},addHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.addHandlerAsync.apply(b,a)});return this},removeHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.removeHandlerAsync.apply(b,a)});return this}};OSF.DDA.BindingFacade=function(b){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:b});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddFromSelectionAsync,a.AddFromNamedItemAsync,a.GetAllAsync,a.GetByIdAsync,a.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{document:{value:a},id:{value:b}})};OSF.DDA.Binding=function(a,c){OSF.OUtil.defineEnumerableProperties(this,{document:{value:c},id:{value:a}});var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDataAsync,d.SetDataAsync]);var e=Microsoft.Office.WebExtension.EventType,b=c.bindings._eventDispatches;if(!b[a])b[a]=new OSF.EventDispatch([e.BindingSelectionChanged,e.BindingDataChanged]);var f=b[a];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.generateBindingId=function(){return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureBinding=function(a,c){var d=a[OSF.DDA.BindingProperties.Id],g=a[OSF.DDA.BindingProperties.RowCount],f=a[OSF.DDA.BindingProperties.ColumnCount],h=a[OSF.DDA.BindingProperties.HasHeaders],b;switch(a[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:b=new OSF.DDA.TextBinding(d,c);break;case Microsoft.Office.WebExtension.BindingType.Matrix:b=new OSF.DDA.MatrixBinding(d,c,g,f);break;case Microsoft.Office.WebExtension.BindingType.Table:var i=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument},e;if(i()&&OSF.DDA.ExcelTableBinding)e=OSF.DDA.ExcelTableBinding;else e=OSF.DDA.TableBinding;b=new e(d,c,g,f,h);break;default:b=new OSF.DDA.UnknownBinding(d,c)}return b};OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"});(function(){var d="number",c="object",b="string",a=null;function e(a){return OSF.DDA.OMFactory.manufactureBinding(a,Microsoft.Office.WebExtension.context.document)}function f(a){return a.id}function g(c,e,d){var b=c[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&b&&(b[OSF.DDA.TableDataProperties.TableRows]!=undefined||b[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))b=OSF.DDA.OMFactory.manufactureTableData(b);b=OSF.DDA.DataCoercion.coerceData(b,d[Microsoft.Office.WebExtension.Parameters.CoercionType]);return b==undefined?a:b}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return true}}],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.BindingList],e)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(d,b,a){var c=a[Microsoft.Office.WebExtension.Parameters.Id];delete b._eventDispatches[c]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(b,a){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(a.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&a[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&a[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn];delete a[Microsoft.Office.WebExtension.Parameters.RowCount];delete a[Microsoft.Office.WebExtension.Parameters.ColumnCount]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]||a[Microsoft.Office.WebExtension.Parameters.RowCount]||a[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}],onSucceeded:g});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[b,c,d,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}]})})();OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.MatrixBinding=function(d,c,b,a){OSF.DDA.MatrixBinding.uber.constructor.call(this,d,c);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:b?b:0},columnCount:{value:a?a:0}})};OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:0},{name:OSF.DDA.BindingProperties.Type,value:1},{name:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,value:2}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:0},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:1},{name:Microsoft.Office.WebExtension.BindingType.Table,value:2}],invertible:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:0},{name:Microsoft.Office.WebExtension.Parameters.Id,value:1},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:2},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:2},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:3},{name:OSF.DDA.PropertyDescriptors.Subset,value:4}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.Data,value:2},{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,fromHost:[{name:OSF.DDA.BindingProperties.RowCount,value:0},{name:OSF.DDA.BindingProperties.ColumnCount,value:1},{name:OSF.DDA.BindingProperties.HasHeaders,value:2}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,toHost:[{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:0},{name:OSF.DDA.SafeArray.UniqueArguments.Run,value:1}],canonical:true,isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Offset,toHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:0},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:1}],canonical:true,isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Run,toHost:[{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:0},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:1}],canonical:true,isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{TableDataProperties:"TableDataProperties"});OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.DDA.TableBinding=function(f,e,d,c,b){OSF.DDA.TableBinding.uber.constructor.call(this,f,e);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:d?d:0},columnCount:{value:c?c:0},hasHeaders:{value:b?b:false}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddRowsAsync,a.AddColumnsAsync,a.DeleteAllDataValuesAsync])};OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddRowsAsync:"addRowsAsync",AddColumnsAsync:"addColumnsAsync",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync"});(function(){function a(a){return a.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]})})();OSF.DDA.TextBinding=function(b,a){OSF.DDA.TextBinding.uber.constructor.call(this,b,a);OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})};OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddFromPromptAsync:"addFromPromptAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromPromptAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:{types:["string"],calculate:function(){return Strings.OfficeOM.L_AddBindingFromPromptDefaultText}}},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:function(a){return OSF.DDA.OMFactory.manufactureBinding(a,Microsoft.Office.WebExtension.context.document)}});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:1},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:2}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"});OSF.DDA.DocumentSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:a}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{BindingSelectionChangedEvent:"BindingSelectionChangedEvent"});OSF.DDA.BindingSelectionChangedEventArgs=function(c,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:c}});for(var b in a)OSF.OUtil.defineEnumerableProperty(this,b,{value:a[b]})};OSF.DDA.BindingDataChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:a}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0},{name:OSF.DDA.PropertyDescriptors.Subset,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType,{OnlyVisible:"onlyVisible"});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.OnlyVisible,value:1}]});Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"};Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"};Microsoft.Office.WebExtension.Index={First:"first",Last:"last",Next:"next",Previous:"previous"};OSF.DDA.AsyncMethodNames.addNames({GoToByIdAsync:"goToByIdAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GoToByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string","number"]},{name:Microsoft.Office.WebExtension.Parameters.GoToType,"enum":Microsoft.Office.WebExtension.GoToType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:{"enum":Microsoft.Office.WebExtension.SelectionMode,defaultValue:Microsoft.Office.WebExtension.SelectionMode.Default}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:0},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:1},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:2},{name:Microsoft.Office.WebExtension.GoToType.Index,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:0},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:1},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:1},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:2}]});OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"});Microsoft.Office.WebExtension.FileProperties=function(a){OSF.OUtil.defineEnumerableProperties(this,{url:{value:a[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(a){return new Microsoft.Office.WebExtension.FileProperties(a)}});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:OSF.DDA.FilePropertiesDescriptor.Url,value:0}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.ExcelTableBinding=function(f,b,e,d,c){var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.ClearFormatsAsync,a.SetTableOptionsAsync,a.SetFormatsAsync]);OSF.DDA.ExcelTableBinding.uber.constructor.call(this,f,b,e,d,c);OSF.OUtil.finalizeProperties(this)};OSF.OUtil.extend(OSF.DDA.ExcelTableBinding,OSF.DDA.TableBinding);(function(){var b="number",a="object",c="string";OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[c,a,b,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:[a],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:[a],defaultValue:[]}}],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[c,a,b,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[a,c],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[a],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[b],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[b],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:[a],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:[a],defaultValue:[]}}],checkCallArgs:function(a,c){var b=Microsoft.Office.WebExtension.Parameters;if(a[b.StartRow]==0&&a[b.StartColumn]==0&&OSF.OUtil.isArray(a[b.CellFormat])&&a[b.CellFormat].length===0&&OSF.OUtil.isArray(a[b.TableOptions])&&a[b.TableOptions].length===0){delete a[b.StartRow];delete a[b.StartColumn];delete a[b.CellFormat];delete a[b.TableOptions]}if(a[b.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(c.type)&&(a[b.StartRow]&&a[b.StartRow]!=0||a[b.StartColumn]&&a[b.StartColumn]!=0||a[b.CellFormat]||a[b.TableOptions]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:function(a){return a.id}}]});OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function(){var a=arguments;this._fetch(function(b){b.setTableOptionsAsync.apply(b,a)});return this},OSF.DDA.BindingPromise.prototype.setFormatsAsync=function(){var a=arguments;this._fetch(function(b){b.setFormatsAsync.apply(b,a)});return this},OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function(){var a=arguments;this._fetch(function(b){b.clearFormatsAsync.apply(b,a)});return this}})();(function(){function a(a){return a.id}OSF.DDA.AsyncMethodNames.addNames({ClearFormatsAsync:"clearFormatsAsync",SetTableOptionsAsync:"setTableOptionsAsync",SetFormatsAsync:"setFormatsAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ClearFormatsAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TableOptions,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetFormatsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CellFormat,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]})})();Microsoft.Office.WebExtension.Table={All:0,Data:1,Headers:2};(function(){var d="undefined",j="auto fit",i="distributed",f="none";OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearFormatsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetFormatsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:2},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.Data,value:2},{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:3},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:4},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:5}]});var g={headerRow:0,bandedRows:1,firstColumn:2,lastColumn:3,bandedColumns:4,filterButton:5,style:6,totalRow:7},h={row:0,column:1},b={alignHorizontal:{text:"alignHorizontal",type:1},alignVertical:{text:"alignVertical",type:2},backgroundColor:{text:"backgroundColor",type:101},borderStyle:{text:"borderStyle",type:201},borderColor:{text:"borderColor",type:202},borderTopStyle:{text:"borderTopStyle",type:203},borderTopColor:{text:"borderTopColor",type:204},borderBottomStyle:{text:"borderBottomStyle",type:205},borderBottomColor:{text:"borderBottomColor",type:206},borderLeftStyle:{text:"borderLeftStyle",type:207},borderLeftColor:{text:"borderLeftColor",type:208},borderRightStyle:{text:"borderRightStyle",type:209},borderRightColor:{text:"borderRightColor",type:210},borderOutlineStyle:{text:"borderOutlineStyle",type:211},borderOutlineColor:{text:"borderOutlineColor",type:212},borderInlineStyle:{text:"borderInlineStyle",type:213},borderInlineColor:{text:"borderInlineColor",type:214},fontFamily:{text:"fontFamily",type:301},fontStyle:{text:"fontStyle",type:302},fontSize:{text:"fontSize",type:303},fontUnderlineStyle:{text:"fontUnderlineStyle",type:304},fontColor:{text:"fontColor",type:305},fontDirection:{text:"fontDirection",type:306},fontStrikethrough:{text:"fontStrikethrough",type:307},fontSuperscript:{text:"fontSuperscript",type:308},fontSubscript:{text:"fontSubscript",type:309},fontNormal:{text:"fontNormal",type:310},indentLeft:{text:"indentLeft",type:401},indentRight:{text:"indentRight",type:402},numberFormat:{text:"numberFormat",type:501},width:{text:"width",type:701},height:{text:"height",type:702},wrapping:{text:"wrapping",type:703}},e=[{name:f,value:0},{name:"thin",value:1},{name:"medium",value:2},{name:"dashed",value:3},{name:"dotted",value:4},{name:"thick",value:5},{name:"double",value:6},{name:"hair",value:7},{name:"medium dashed",value:8},{name:"dash dot",value:9},{name:"medium dash dot",value:10},{name:"dash dot dot",value:11},{name:"medium dash dot dot",value:12},{name:"slant dash dot",value:13}],c=[{name:f,value:0},{name:"black",value:1},{name:"blue",value:2},{name:"gray",value:3},{name:"green",value:4},{name:"orange",value:5},{name:"pink",value:6},{name:"purple",value:7},{name:"red",value:8},{name:"teal",value:9},{name:"turquoise",value:10},{name:"violet",value:11},{name:"white",value:12},{name:"yellow",value:13},{name:"automatic",value:14}],a=OSF.DDA.SafeArray.Delegate.ParameterMap;a.define({type:b.alignHorizontal.text,toHost:[{name:"general",value:0},{name:"left",value:1},{name:"center",value:2},{name:"right",value:3},{name:"fill",value:4},{name:"justify",value:5},{name:"center across selection",value:6},{name:i,value:7}]});a.define({type:b.alignVertical.text,toHost:[{name:"top",value:0},{name:"center",value:1},{name:"bottom",value:2},{name:"justify",value:3},{name:i,value:4}]});a.define({type:b.backgroundColor.text,toHost:c});a.define({type:b.borderStyle.text,toHost:e});a.define({type:b.borderColor.text,toHost:c});a.define({type:b.borderTopStyle.text,toHost:e});a.define({type:b.borderTopColor.text,toHost:c});a.define({type:b.borderBottomStyle.text,toHost:e});a.define({type:b.borderBottomColor.text,toHost:c});a.define({type:b.borderLeftStyle.text,toHost:e});a.define({type:b.borderLeftColor.text,toHost:c});a.define({type:b.borderRightStyle.text,toHost:e});a.define({type:b.borderRightColor.text,toHost:c});a.define({type:b.borderOutlineStyle.text,toHost:e});a.define({type:b.borderOutlineColor.text,toHost:c});a.define({type:b.borderInlineStyle.text,toHost:e});a.define({type:b.borderInlineColor.text,toHost:c});a.define({type:b.fontStyle.text,toHost:[{name:"regular",value:0},{name:"italic",value:1},{name:"bold",value:2},{name:"bold italic",value:3}]});a.define({type:b.fontUnderlineStyle.text,toHost:[{name:f,value:0},{name:"single",value:1},{name:"double",value:2},{name:"single accounting",value:3},{name:"double accounting",value:4}]});a.define({type:b.fontColor.text,toHost:c});a.define({type:b.fontDirection.text,toHost:[{name:"context",value:0},{name:"left-to-right",value:1},{name:"right-to-left",value:2}]});a.define({type:b.width.text,toHost:[{name:j,value:-1}]});a.define({type:b.height.text,toHost:[{name:j,value:-1}]});a.define({type:Microsoft.Office.WebExtension.Parameters.TableOptions,toHost:[{name:"headerRow",value:0},{name:"bandedRows",value:1},{name:"firstColumn",value:2},{name:"lastColumn",value:3},{name:"bandedColumns",value:4},{name:"filterButton",value:5},{name:"style",value:6},{name:"totalRow",value:7}]});a.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={toHost:function(b){for(var c in b)if(b[c].format)b[c].format=a.doMapValues(b[c].format,"toHost");return b},fromHost:function(a){return a}};a.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat,{toHost:function(k){var e="cells",l="format",r=0,q=1,p=[];for(var o in k){var a=k[o],i=[];if(typeof a[e]!==d){var f=a[e],c;if(typeof a[e]==="object"){c=[];for(var j in f)if(typeof h[j]!==d)c[h[j]]=f[j]}else c=f;i[r]=c}if(a[l]){var n=a[l],m=[];for(var g in n)typeof b[g]!==d&&m.push([b[g].type,n[g]]);i[q]=m}p[o]=i}return p},fromHost:function(a){return a}});a.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions,{toHost:function(b){var c=[];for(var a in b)if(typeof g[a]!==d)c[g[a]]=b[a];return c},fromHost:function(a){return a}})})();OSF.DDA.ExcelDocument=function(c,d){var a=this,b=new OSF.DDA.BindingFacade(a);OSF.DDA.DispIdHost.addAsyncMethods(b,[OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);OSF.DDA.DispIdHost.addAsyncMethods(a,[OSF.DDA.AsyncMethodNames.GoToByIdAsync]);OSF.DDA.DispIdHost.addAsyncMethods(a,[OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);OSF.DDA.ExcelDocument.uber.constructor.call(a,c,b,d);OSF.OUtil.finalizeProperties(a)};OSF.OUtil.extend(OSF.DDA.ExcelDocument,OSF.DDA.JsomDocument);OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(a,b){OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);a.doc=new OSF.DDA.ExcelDocument(a,this._initializeSettings(a,false));b()} \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-web-16.00.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-web-16.00.debug.js new file mode 100644 index 000000000..1049257bd --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-web-16.00.debug.js @@ -0,0 +1,13215 @@ +/* Excel web application specific API library */ +/* Version: 16.0.6216.3006 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/* +* @overview es6-promise - a tiny implementation of Promises/A+. +* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) +* @license Licensed under MIT license +* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE +* @version 2.3.0 +*/ + +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var OfficeExt; +(function (OfficeExt) { + var MicrosoftAjaxFactory=(function () { + function MicrosoftAjaxFactory() { + } + MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function () { + if (typeof (Sys) !=='undefined' && typeof (Type) !=='undefined' && Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" && Type.registerNamespace && typeof (Type.registerNamespace)==="function" && Type.registerClass && typeof (Type.registerClass)==="function" && typeof (Function._validateParams)==="function") { + return true; + } else { + return false; + } + }; + MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OSF.OUtil.loadScript(msAjaxCDNPath, callback); + }; + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", { + get: function () { + if (this._msAjaxError==null && this.isMsAjaxLoaded()) { + this._msAjaxError=Error; + } + return this._msAjaxError; + }, + set: function (errorClass) { + this._msAjaxError=errorClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", { + get: function () { + if (this._msAjaxSerializer==null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer; + } + return this._msAjaxSerializer; + }, + set: function (serializerClass) { + this._msAjaxSerializer=serializerClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", { + get: function () { + if (this._msAjaxString==null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer=String; + } + return this._msAjaxString; + }, + set: function (stringClass) { + this._msAjaxString=stringClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", { + get: function () { + if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) { + this._msAjaxDebug=Sys.Debug; + } + return this._msAjaxDebug; + }, + set: function (debugClass) { + this._msAjaxDebug=debugClass; + }, + enumerable: true, + configurable: true + }); + return MicrosoftAjaxFactory; + })(); + OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory; +})(OfficeExt || (OfficeExt={})); +var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory(); +var OSF=OSF || {}; +var OfficeExt; +(function (OfficeExt) { + var SafeStorage=(function () { + function SafeStorage(_internalStorage) { + this._internalStorage=_internalStorage; + } + SafeStorage.prototype.getItem=function (key) { + try { + return this._internalStorage && this._internalStorage.getItem(key); + } catch (e) { + return null; + } + }; + SafeStorage.prototype.setItem=function (key, data) { + try { + this._internalStorage && this._internalStorage.setItem(key, data); + } catch (e) { + } + }; + SafeStorage.prototype.clear=function () { + try { + this._internalStorage && this._internalStorage.clear(); + } catch (e) { + } + }; + SafeStorage.prototype.removeItem=function (key) { + try { + this._internalStorage && this._internalStorage.removeItem(key); + } catch (e) { + } + }; + SafeStorage.prototype.getKeysWithPrefix=function (keyPrefix) { + var keyList=[]; + try { + var len=this._internalStorage && this._internalStorage.length || 0; + for (var i=0; i < len; i++) { + var key=this._internalStorage.key(i); + if (key.indexOf(keyPrefix)===0) { + keyList.push(key); + } + } + } catch (e) { + } + return keyList; + }; + return SafeStorage; + })(); + OfficeExt.SafeStorage=SafeStorage; +})(OfficeExt || (OfficeExt={})); +OSF.OUtil=(function () { + var _uniqueId=-1; + var _xdmInfoKey='&_xdm_Info='; + var _serializerVersionKey='&_serializer_version='; + var _xdmSessionKeyPrefix='_xdm_'; + var _serializerVersionKeyPrefix='_serializer_version='; + var _fragmentSeparator='#'; + var _loadedScripts={}; + var _defaultScriptLoadingTimeout=30000; + var _safeSessionStorage=null; + var _safeLocalStorage=null; + + var _rndentropy=new Date().getTime(); + function _random() { + var nextrand=0x7fffffff * (Math.random()); + nextrand ^=_rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10))); + + return nextrand.toString(16); + } + ; + function _getSessionStorage() { + if (!_safeSessionStorage) { + try { + var sessionStorage=window.sessionStorage; + } catch (ex) { + sessionStorage=null; + } + _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage); + } + return _safeSessionStorage; + } + ; + return { + set_entropy: function OSF_OUtil$set_entropy(entropy) { + if (typeof entropy=="string") { + for (var i=0; i < entropy.length; i+=4) { + var temp=0; + for (var j=0; j < 4 && i+j < entropy.length; j++) { + temp=(temp << 8)+entropy.charCodeAt(i+j); + } + _rndentropy ^=temp; + } + } else if (typeof entropy=="number") { + _rndentropy ^=entropy; + } else { + _rndentropy ^=0x7fffffff * Math.random(); + } + _rndentropy &=0x7fffffff; + }, + extend: function OSF_OUtil$extend(child, parent) { + var F=function () { + }; + F.prototype=parent.prototype; + child.prototype=new F(); + child.prototype.constructor=child; + child.uber=parent.prototype; + if (parent.prototype.constructor===Object.prototype.constructor) { + parent.prototype.constructor=parent; + } + }, + setNamespace: function OSF_OUtil$setNamespace(name, parent) { + if (parent && name && !parent[name]) { + parent[name]={}; + } + }, + unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) { + if (parent && name && parent[name]) { + delete parent[name]; + } + }, + loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) { + if (url && callback) { + var doc=window.document; + var _loadedScriptEntry=_loadedScripts[url]; + if (!_loadedScriptEntry) { + var script=doc.createElement("script"); + script.type="text/javascript"; + _loadedScriptEntry={ loaded: false, pendingCallbacks: [callback], timer: null }; + _loadedScripts[url]=_loadedScriptEntry; + var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback() { + if (_loadedScriptEntry.timer !=null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + _loadedScriptEntry.loaded=true; + var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length; + for (var i=0; i < pendingCallbackCount; i++) { + var currentCallback=_loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + var onLoadError=function OSF_OUtil_loadScript$onLoadError() { + delete _loadedScripts[url]; + if (_loadedScriptEntry.timer !=null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length; + for (var i=0; i < pendingCallbackCount; i++) { + var currentCallback=_loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + if (script.readyState) { + script.onreadystatechange=function () { + if (script.readyState=="loaded" || script.readyState=="complete") { + script.onreadystatechange=null; + onLoadCallback(); + } + }; + } else { + script.onload=onLoadCallback; + } + script.onerror=onLoadError; + + timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout; + _loadedScriptEntry.timer=setTimeout(onLoadError, timeoutInMs); + script.src=url; + doc.getElementsByTagName("head")[0].appendChild(script); + } else if (_loadedScriptEntry.loaded) { + callback(); + } else { + _loadedScriptEntry.pendingCallbacks.push(callback); + } + } + }, + loadCSS: function OSF_OUtil$loadCSS(url) { + if (url) { + var doc=window.document; + var link=doc.createElement("link"); + link.type="text/css"; + link.rel="stylesheet"; + link.href=url; + doc.getElementsByTagName("head")[0].appendChild(link); + } + }, + parseEnum: function OSF_OUtil$parseEnum(str, enumObject) { + var parsed=enumObject[str.trim()]; + if (typeof (parsed)=='undefined') { + OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str); + throw OsfMsAjaxFactory.msAjaxError.argument("str"); + } + return parsed; + }, + delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() { + var obj={ calc: arguments[0] }; + return function () { + if (obj.calc) { + obj.val=obj.calc.apply(this, arguments); + delete obj.calc; + } + return obj.val; + }; + }, + getUniqueId: function OSF_OUtil$getUniqueId() { + _uniqueId=_uniqueId+1; + return _uniqueId.toString(); + }, + formatString: function OSF_OUtil$formatString() { + var args=arguments; + var source=args[0]; + return source.replace(/{(\d+)}/gm, function (match, number) { + var index=parseInt(number, 10)+1; + return args[index]===undefined ? '{'+number+'}' : args[index]; + }); + }, + generateConversationId: function OSF_OUtil$generateConversationId() { + return [_random(), _random(), (new Date()).getTime().toString()].join('_'); + }, + getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame) { + var frameName=_xdmSessionKeyPrefix+cacheKey+this.generateConversationId(); + frame.setAttribute("name", frameName); + return this.generateConversationId(); + }, + addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) { + return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue); + }, + addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) { + return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion); + }, + addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue) { + url=url.trim() || ''; + var urlParts=url.split(_fragmentSeparator); + var urlWithoutFragment=urlParts.shift(); + var fragment=urlParts.join(_fragmentSeparator); + return [urlWithoutFragment, _fragmentSeparator, fragment, keyName, infoValue].join(''); + }, + parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) { + return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) { + return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, skipSessionStorage, fragment); + }, + parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) { + return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) { + return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, skipSessionStorage, fragment)); + }, + parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment) { + var fragmentParts=fragment.split(infoKey); + var xdmInfoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage=_getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart=window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd==-1) { + sessionKeyEnd=window.name.length; + } + var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue=osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString=window.location.search; + var conversationId=null; + if (searchString) { + var index=searchString.indexOf("&"); + + conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') { + conversationId=conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId=decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items=strInfo.split("$"); + if (typeof items[1]=="undefined") { + items=strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl=''; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items=OSF.OUtil.getInfoItems(xdmInfoValue); + if (items !=undefined && items.length >=3) { + conversationUrl=items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e=Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e=Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !=='undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor=descriptor || {}; + for (var nd in attributes) { + var attribute=attributes[nd]; + if (descriptor[attribute]==undefined) { + descriptor[attribute]=true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors=descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor=descriptor || {}; + var props=Object.getOwnPropertyNames(obj); + var propsLength=props.length; + for (var i=0; i < propsLength; i++) { + var prop=props[i]; + var desc=Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable=descriptor.writable || false; + } + desc.configurable=descriptor.configurable || false; + desc.enumerable=descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret=[]; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key==item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value==list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add=list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key]=value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2]=newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj)==="[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj)==="[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj)==="[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on"+eventName, listener); + } else { + element["on"+eventName]=listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on"+eventName, listener); + } else { + element["on"+eventName]=null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp=new XMLHttpRequest(); + xmlhttp.onreadystatechange=function () { + if (xmlhttp.readyState==4) { + if (xmlhttp.status==200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/="; + var output=[]; + var temp=[]; + var index=0; + var c1, c2, c3, a, b, c; + var i; + var length=input.length; + do { + c1=input.charCodeAt(index++); + c2=input.charCodeAt(index++); + c3=input.charCodeAt(index++); + i=0; + a=c1 & 255; + b=c1 >> 8; + c=c2 & 255; + temp[i++]=a >> 2; + temp[i++]=((a & 3) << 4) | (b >> 4); + temp[i++]=((b & 15) << 2) | (c >> 6); + temp[i++]=c & 63; + if (!isNaN(c2)) { + a=c2 >> 8; + b=c3 & 255; + c=c3 >> 8; + temp[i++]=a >> 2; + temp[i++]=((a & 3) << 4) | (b >> 4); + temp[i++]=((b & 15) << 2) | (c >> 6); + temp[i++]=c & 63; + } + if (isNaN(c2)) { + temp[i - 1]=64; + } else if (isNaN(c3)) { + temp[i - 2]=64; + temp[i - 1]=64; + } + for (var t=0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage=window.localStorage; + } catch (ex) { + localStorage=null; + } + _safeLocalStorage=new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick=function (e) { + handler(); + }; + element.ontouchend=function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e=Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj=sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property]=sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid=(function () { + var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result=""; + var tick=(new Date()).getTime(); + var index=0; + + for (; index < 32 && tick > 0; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[tick % 16]; + tick=Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF=OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName={ + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker={ + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker={ + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction={ + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants={ + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id=id; + this._appName=appName; + this._appVersion=appVersion; + this._appUILocale=appUILocale; + this._dataLocale=dataLocale; + this._docUrl=docUrl; + this._clientMode=clientMode; + this._settings=settings; + this._reason=reason; + this._osfControlType=osfControlType; + this._eToken=eToken; + this._correlationId=correlationId; + this._appInstanceId=appInstanceId; + this._touchEnabled=touchEnabled; + this._commerceAllowed=commerceAllowed; + this._appMinorVersion=appMinorVersion; + this._requirementMatrix=requirementMatrix; + this.get_id=function get_id() { + return this._id; + }; + this.get_appName=function get_appName() { + return this._appName; + }; + this.get_appVersion=function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale=function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale=function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl=function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode=function get_clientMode() { + return this._clientMode; + }; + this.get_bindings=function get_bindings() { + return this._bindings; + }; + this.get_settings=function get_settings() { + return this._settings; + }; + this.get_reason=function get_reason() { + return this._reason; + }; + this.get_osfControlType=function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken=function get_eToken() { + return this._eToken; + }; + this.get_correlationId=function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId=function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled=function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed=function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion=function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementMatrix=function get_requirementMatrix() { + return this._requirementMatrix; + }; +}; +OSF.OsfControlType={ + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode={ + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason={ + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat={ + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType={ + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters={ + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + ImageLeft: "imageLeft", + ImageTop: "imageTop", + ImageWidth: "imageWidth", + ImageHeight: "imageHeight", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode={ + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors={ + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors={}; +OSF.DDA.ListDescriptors={}; + +OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId+"_"+eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId={ + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId={ + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager=(function () { + var _errorMappings={}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode]=errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix=(function () { + function RequirementMatrix(_setMap) { + this.isSetSupported=function _isSetSupported(name, minVersion) { + if (name==undefined) { + return false; + } + if (minVersion==undefined) { + minVersion=0; + } + var setSupportArray=this._setMap; + var sets=setSupportArray._sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion=sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >=minVersion; + } else { + return false; + } + }; + this._setMap=_setMap; + } + return RequirementMatrix; + })(); + Requirement.RequirementMatrix=RequirementMatrix; + var DefaultSetRequirement=(function () { + function DefaultSetRequirement(setMap) { + this._sets=setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement=DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement=(function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement=(function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement=(function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement=(function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement=(function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement=(function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement=(function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement=(function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement=(function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement=(function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement=(function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement=(function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement=(function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement=(function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement=(function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory=(function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda=function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix=undefined; + if (appContext.get_requirementMatrix() !=undefined && typeof (JSON) !=="undefined") { + var matrixItem=JSON.parse(appContext.get_requirementMatrix()); + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion=appContext.get_appMinorVersion(); + var appMinorVersionString=""; + if (appMinorVersion < 10) { + appMinorVersionString="0"+appMinorVersion; + } else { + appMinorVersionString=""+appMinorVersion; + } + + var appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString; + var appLocator=appContext.get_appName()+"-"+appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) { + defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix=function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600="16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600="32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600="256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600="1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600="4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix={}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement={})); + var Requirement=OfficeExt.Requirement; +})(OfficeExt || (OfficeExt={})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode={ + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode={ + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager=(function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut=false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice=window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office=Microsoft.Office.WebExtension; + _useShortcut=true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office=_userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut=false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str=="string") { + var index=str.indexOf("#"); + if (index !=-1) { + var op=str.substring(0, index); + var target=str.substring(index+1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise=new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType=typeof errorCallback; + if (callbackType=="function") { + var callArgs={}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail=errorCallback; + return promise; + } +}; + +OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName=appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context=OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License=function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties={ + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus={ + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode={ + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties={ + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames={}; +OSF.DDA.AsyncMethodNames.addNames=function (methodNames) { + for (var entry in methodNames) { + var am={}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry]=am; + } +}; +OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount=requiredParameters.length; + var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param=params[name]; + var arg=args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs=[]; + var index; + for (index=0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret={}; + for (index=0; index < requiredCount; index++) { + var param=requiredParameters[index]; + var arg=requiredArgs[index]; + if (param.verify) { + var isValid=param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name]=arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount+2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i=userArgs.length - 1; i >=requiredCount; i--) { + var argument=userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options=argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback=argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options=options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value=undefined; + var option=supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value=option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !==undefined) { + value=option.defaultValue; + } + options[optionName]=value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs={}; + for (var r in required) { + callArgs[r]=required[r]; + } + for (var o in options) { + callArgs[o]=options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s]=privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs=checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload=onSucceeded(response, caller, callArgs); + } else { + payload=response; + } + } else { + if (onFailed) { + payload=onFailed(status, response); + } else { + payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs=function (suppliedArgs) { + var options, parameterCallback; + + for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) { + var argument=suppliedArgs[i]; + switch (typeof argument) { + case "object": + options=argument; + break; + case "function": + parameterCallback=argument; + break; + } + } + options=options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory=(function () { + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls={}; +OSF.DDA.AsyncMethodCalls.define=function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error=function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs={}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload; + } else { + errorArgs={}; + payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType=(function () { + var listTypes={}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t]=prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap=function (specialProcessor, mappings) { + var toHostMap="toHost"; + var fromHostMap="fromHost"; + + var self="self"; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={ + toHost: function (data) { + if (data !=null && data.rows !==undefined) { + var tableData={}; + tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers; + data=tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret=preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage=preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image=[]; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image=dynamicTypes[entry][mapping](preimage); + } else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) { + image=mapValues(preimage, mapping); + } else { + var maps=mappings[entry]; + if (maps) { + var map=maps[mapping]; + if (map) { + image=map[preimage]; + if (image===undefined) { + image=preimage; + } + } + } else { + image=preimage; + } + } + ret[entry]=image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg=generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg=imageSet[param]; + } + if (arg !=undefined) { + if (!ret) { + ret={}; + } + var index=parameters[param]; + + if (index==self) { + index=param; + } + ret[index]=specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted={}; + } + for (var param in parameters) { + var index=parameters[param]; + var value; + + if (index==self) { + value=source; + } else { + value=source[index]; + } + if (value===null || value===undefined) { + extracted[param]=undefined; + } else { + value=specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map=mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param]=extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map={}; + var entryDescriptor=OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor]=self; + for (var item in value) { + value[item]=extractArguments(value[item], map); + } + } + extracted[param]=value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters=mappings[mapName][mapping]; + var image; + if (mapping=="toHost") { + var imageSet=mapValues(preimage, mapping); + image=generateArguments(imageSet, parameters); + } else if (mapping=="fromHost") { + var argumentSet=extractArguments(preimage, parameters); + image=mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings={}; + } + this.addMapping=function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost=description.map; + fromHost={}; + for (var preimage in toHost) { + var image=toHost[preimage]; + + if (image==self) { + image=preimage; + } + fromHost[image]=preimage; + } + } else { + toHost=description.toHost; + fromHost=description.fromHost; + } + var pair=mappings[mapName]; + if (pair) { + var currMap=pair[toHostMap]; + for (var th in currMap) + toHost[th]=currMap[th]; + currMap=pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh]=currMap[fh]; + } else { + pair=mappings[mapName]={}; + } + pair[toHostMap]=toHost; + pair[fromHostMap]=fromHost; + }; + this.toHost=function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost=function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self=self; + this.addComplexType=function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType=function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType=function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes=dynamicTypes; + this.doMapValues=function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) { + this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt]=handler; + }; + this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn=[]; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn=pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) { + var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor); + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + parameterMap.define=function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + + if (definition.invertible) { + args.map=toHost; + } else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods={ + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates={ + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap={}; + var jsom=OSF.DDA.AsyncMethodNames; + var did=OSF.DDA.MethodDispId; + + var methodMap={ + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id]=methodMap[method]; + } + } + + jsom=Microsoft.Office.WebExtension.EventType; + did=OSF.DDA.EventDispId; + var eventMap={ + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]]=eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex=="number") { + if (!callArgs) { + callArgs=asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName=method.id; + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId=dispIdMap[methodName]; + var delegate=getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs=parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs=callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs=parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs=hostResponseArgs; + } + } else { + responseArgs=hostResponseArgs; + } + var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added=eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args=parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler===null) { + removeSuccess=eventDispatch.clearEventHandlers(eventType); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess=eventDispatch.removeEventHandler(eventType, handler); + status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method=asyncMethodNames[entry]; + var name=method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Common", Microsoft.Office); +OSF.SerializerVersion={ + MsAjax: 0, + Browser: 1 +}; + +(function (window) { + "use strict"; + var stringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"', 'g'), trueFalseNullRegEx=new RegExp('\\b(true|false|null)\\b', 'g'), numbersRegEx=new RegExp('-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?', 'g'), badBracketsRegEx=new RegExp('[^{:,\\[\\s](?=\\s*\\[)'), badRemainderRegEx=new RegExp('[^\\s\\[\\]{}:,]'), jsonErrorMsg="Cannot deserialize. The data does not correspond to valid JSON."; + function addHandler(element, eventName, handler) { + if (element.addEventListener) { + element.addEventListener(eventName, handler, false); + } else if (element.attachEvent) { + element.attachEvent("on"+eventName, handler); + } + } + function getAjaxSerializer() { + if (OsfMsAjaxFactory.msAjaxSerializer) { + return OsfMsAjaxFactory.msAjaxSerializer; + } + return null; + } + function deserialize(data, secure, oldDeserialize) { + var transformed; + if (!secure) { + return oldDeserialize(data); + } + if (window.JSON && window.JSON.parse) { + return window.JSON.parse(data); + } + + transformed=data.replace(stringRegEx, "[]"); + + transformed=transformed.replace(trueFalseNullRegEx, "[]"); + + transformed=transformed.replace(numbersRegEx, "[]"); + + if (badBracketsRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + if (badRemainderRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + try { + eval("("+data+")"); + } catch (e) { + throw jsonErrorMsg; + } + } + function patchDeserializer() { + var serializer=getAjaxSerializer(), oldDeserialize; + if (serializer===null || typeof (serializer.deserialize) !=="function") { + return false; + } + if (serializer.__patchVersion >=1) { + return true; + } + + oldDeserialize=serializer.deserialize; + + serializer.deserialize=function (data, secure) { + return deserialize(data, true, oldDeserialize); + }; + serializer.__patchVersion=1; + return true; + } + if (!patchDeserializer()) { + addHandler(window, "load", function () { + patchDeserializer(); + }); + } +}(window)); + +Microsoft.Office.Common.InvokeType={ + "async": 0, + "sync": 1, + "asyncRegisterEvent": 2, + "asyncUnregisterEvent": 3, + "syncRegisterEvent": 4, + "syncUnregisterEvent": 5 +}; + +Microsoft.Office.Common.InvokeResultCode={ + "noError": 0, + "errorInRequest": -1, + "errorHandlingRequest": -2, + "errorInResponse": -3, + "errorHandlingResponse": -4, + "errorHandlingRequestAccessDenied": -5, + "errorHandlingMethodCallTimedout": -6 +}; + +Microsoft.Office.Common.MessageType={ + "request": 0, + "response": 1 +}; + +Microsoft.Office.Common.ActionType={ + "invoke": 0, + "registerEvent": 1, + "unregisterEvent": 2 }; + +Microsoft.Office.Common.ResponseType={ + "forCalling": 0, + "forEventing": 1 +}; + +Microsoft.Office.Common.MethodObject=function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) { + this._method=method; + + this._invokeType=invokeType; + + this._blockingOthers=blockingOthers; +}; +Microsoft.Office.Common.MethodObject.prototype={ + getMethod: function Microsoft_Office_Common_MethodObject$getMethod() { + return this._method; + }, + getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() { + return this._invokeType; + }, + getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() { + return this._blockingOthers; + } +}; + +Microsoft.Office.Common.EventMethodObject=function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) { + this._registerMethodObject=registerMethodObject; + + this._unregisterMethodObject=unregisterMethodObject; +}; +Microsoft.Office.Common.EventMethodObject.prototype={ + getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() { + return this._registerMethodObject; + }, + getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() { + return this._unregisterMethodObject; + } +}; + +Microsoft.Office.Common.ServiceEndPoint=function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) { + var e=Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + + this._methodObjectList={}; + + this._eventHandlerProxyList={}; + + this._Id=serviceEndPointId; + + this._conversations={}; + + this._policyManager=null; + + this._appDomains={}; +}; +Microsoft.Office.Common.ServiceEndPoint.prototype={ + registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) { + var e=Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false }, + { name: "method", type: Function, mayBeNull: false }, + { name: "invokeType", type: Number, mayBeNull: false }, + { name: "blockingOthers", type: Boolean, mayBeNull: false } + ]); + if (e) + throw e; + if (invokeType !==Microsoft.Office.Common.InvokeType.async && invokeType !==Microsoft.Office.Common.InvokeType.sync) { + throw OsfMsAjaxFactory.msAjaxError.argument("invokeType"); + } + var methodObject=new Microsoft.Office.Common.MethodObject(method, invokeType, blockingOthers); + this._methodObjectList[methodName]=methodObject; + }, + unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) { + var e=Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._methodObjectList[methodName]; + }, + registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) { + var e=Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, Microsoft.Office.Common.InvokeType.syncRegisterEvent, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, Microsoft.Office.Common.InvokeType.syncUnregisterEvent, false)); + this._methodObjectList[eventName]=methodObject; + }, + registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) { + var e=Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "registerMethodInvokeType", type: Number, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethodInvokeType", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, registerMethodInvokeType, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, unregisterMethodInvokeType, false)); + this._methodObjectList[eventName]=methodObject; + }, + unregisterEvent: function (eventName) { + var e=Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + this.unregisterMethod(eventName); + }, + registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId, conversationUrl, appDomains, serializerVersion) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "conversationUrl", type: String, mayBeNull: false, optional: true }, + { name: "appDomains", type: Object, mayBeNull: true, optional: true }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + ; + if (appDomains) { + if (!(appDomains instanceof Array)) { + throw OsfMsAjaxFactory.msAjaxError.argument("appDomains"); + } + this._appDomains[conversationId]=appDomains; + } + this._conversations[conversationId]={ url: conversationUrl, serializerVersion: serializerVersion }; + }, + unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._conversations[conversationId]; + }, + setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) { + var e=Function._validateParams(arguments, [ + { name: "policyManager", type: Object, mayBeNull: false } + ]); + if (e) + throw e; + + if (!policyManager.checkPermission) { + throw OsfMsAjaxFactory.msAjaxError.argument("policyManager"); + } + this._policyManager=policyManager; + }, + getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() { + return this._policyManager; + } +}; + +Microsoft.Office.Common.ClientEndPoint=function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "targetWindow", mayBeNull: false }, + { name: "targetUrl", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + if (!targetWindow.postMessage) { + throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow"); + } + + this._conversationId=conversationId; + + this._targetWindow=targetWindow; + + this._targetUrl=targetUrl; + + this._callingIndex=0; + + this._callbackList={}; + + this._eventHandlerList={}; + if (serializerVersion !=null) { + this._serializerVersion=serializerVersion; + } else { + this._serializerVersion=OSF.SerializerVersion.MsAjax; + } +}; +Microsoft.Office.Common.ClientEndPoint.prototype={ + invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) { + var e=Function._validateParams(arguments, [ + { name: "targetMethodName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "param", mayBeNull: true } + ]); + if (e) + throw e; + + var correlationId=this._callingIndex++; + + var now=new Date(); + var callbackEntry={ "callback": callback, "createdOn": now.getTime() }; + + if (param && typeof param==="object" && typeof param.__timeout__==="number") { + callbackEntry.timeout=param.__timeout__; + delete param.__timeout__; + } + this._callbackList[correlationId]=callbackEntry; + try { + var callRequest=new Microsoft.Office.Common.Request(targetMethodName, Microsoft.Office.Common.ActionType.invoke, this._conversationId, correlationId, param); + + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !==null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } finally { + delete this._callbackList[correlationId]; + } + } + }, + registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) { + var e=Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "eventHandler", type: Function, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId=this._callingIndex++; + + var now=new Date(); + this._callbackList[correlationId]={ "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest=new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.registerEvent, this._conversationId, correlationId, data); + + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + + this._eventHandlerList[targetEventName]=eventHandler; + } catch (ex) { + try { + if (callback !==null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } + }, + unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) { + var e=Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId=this._callingIndex++; + + var now=new Date(); + this._callbackList[correlationId]={ "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest=new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.unregisterEvent, this._conversationId, correlationId, data); + + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !==null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } finally { + delete this._eventHandlerList[targetEventName]; + } + } +}; + +Microsoft.Office.Common.XdmCommunicationManager=(function () { + var _invokerQueue=[]; + + var _lastMessageProcessTime=null; + + var _messageProcessingTimer=null; + + var _processInterval=10; + + var _blockingFlag=false; + + var _methodTimeoutTimer=null; + + var _methodTimeoutProcessInterval=2000; + + var _methodTimeoutDefault=65000; + var _methodTimeout=_methodTimeoutDefault; + var _serviceEndPoints={}; + var _clientEndPoints={}; + var _initialized=false; + + function _lookupServiceEndPoint(conversationId) { + for (var id in _serviceEndPoints) { + if (_serviceEndPoints[id]._conversations[conversationId]) { + return _serviceEndPoints[id]; + } + } + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + ; + + function _lookupClientEndPoint(conversationId) { + var clientEndPoint=_clientEndPoints[conversationId]; + if (!clientEndPoint) { + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + return clientEndPoint; + } + ; + + function _lookupMethodObject(serviceEndPoint, messageObject) { + var methodOrEventMethodObject=serviceEndPoint._methodObjectList[messageObject._actionName]; + if (!methodOrEventMethodObject) { + OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+messageObject._actionName); + throw OsfMsAjaxFactory.msAjaxError.argument("messageObject"); + } + var methodObject=null; + if (messageObject._actionType===Microsoft.Office.Common.ActionType.invoke) { + methodObject=methodOrEventMethodObject; + } else if (messageObject._actionType===Microsoft.Office.Common.ActionType.registerEvent) { + methodObject=methodOrEventMethodObject.getRegisterMethodObject(); + } else { + methodObject=methodOrEventMethodObject.getUnregisterMethodObject(); + } + return methodObject; + } + ; + + function _enqueInvoker(invoker) { + _invokerQueue.push(invoker); + } + ; + + function _dequeInvoker() { + if (_messageProcessingTimer !==null) { + if (!_blockingFlag) { + if (_invokerQueue.length > 0) { + var invoker=_invokerQueue.shift(); + _executeCommand(invoker); + } else { + clearInterval(_messageProcessingTimer); + _messageProcessingTimer=null; + } + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + function _executeCommand(invoker) { + _blockingFlag=invoker.getInvokeBlockingFlag(); + + invoker.invoke(); + _lastMessageProcessTime=(new Date()).getTime(); + } + ; + + function _checkMethodTimeout() { + if (_methodTimeoutTimer) { + var clientEndPoint; + var methodCallsNotTimedout=0; + var now=new Date(); + var timeoutValue; + for (var conversationId in _clientEndPoints) { + clientEndPoint=_clientEndPoints[conversationId]; + for (var correlationId in clientEndPoint._callbackList) { + var callbackEntry=clientEndPoint._callbackList[correlationId]; + + timeoutValue=callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout; + if (timeoutValue >=0 && Math.abs(now.getTime() - callbackEntry.createdOn) >=timeoutValue) { + try { + if (callbackEntry.callback) { + callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout, null); + } + } finally { + delete clientEndPoint._callbackList[correlationId]; + } + } else { + methodCallsNotTimedout++; + } + ; + } + } + if (methodCallsNotTimedout===0) { + clearInterval(_methodTimeoutTimer); + _methodTimeoutTimer=null; + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + + function _postCallbackHandler() { + _blockingFlag=false; + } + ; + + function _registerListener(listener) { + if (window.addEventListener) { + window.addEventListener("message", listener, false); + } else if ((navigator.userAgent.indexOf("MSIE") > -1) && window.attachEvent) { + window.attachEvent("onmessage", listener); + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."); + throw OsfMsAjaxFactory.msAjaxError.argument("Browser"); + } + } + ; + + function _checkOrigin(url, origin) { + var res=false; + + if (url===true) { + return true; + } + if (!url || !origin || !url.length || !origin.length) { + return res; + } + var url_parser, org_parser; + url_parser=document.createElement('a'); + org_parser=document.createElement('a'); + url_parser.href=url; + org_parser.href=origin; + res=_urlCompare(url_parser, org_parser); + delete url_parser, org_parser; + return res; + } + + function _checkOriginWithAppDomains(allowed_domains, origin) { + var res=false; + if (!origin || !origin.length || !(allowed_domains) || !(allowed_domains instanceof Array) || !allowed_domains.length) { + return res; + } + var org_parser=document.createElement('a'); + var app_domain_parser=document.createElement('a'); + org_parser.href=origin; + for (var i=0; i < allowed_domains.length && !res; i++) { + if (allowed_domains[i].indexOf("://") !==-1) { + app_domain_parser.href=allowed_domains[i]; + res=_urlCompare(org_parser, app_domain_parser); + } + } + delete org_parser, app_domain_parser; + return res; + } + + function _urlCompare(url_parser1, url_parser2) { + return ((url_parser1.hostname==url_parser2.hostname) && (url_parser1.protocol==url_parser2.protocol) && (url_parser1.port==url_parser2.port)); + } + + function _receive(e) { + if (e.data !='') { + var messageObject; + var serializerVersion=OSF.SerializerVersion.MsAjax; + var serializedMessage=e.data; + + try { + messageObject=Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, OSF.SerializerVersion.Browser); + serializerVersion=messageObject._serializerVersion !=null ? messageObject._serializerVersion : serializerVersion; + } catch (ex) { + } + if (serializerVersion !=OSF.SerializerVersion.Browser) { + try { + messageObject=Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, serializerVersion); + } catch (ex) { + return; + } + } + if (typeof (messageObject._messageType)=='undefined') { + return; + } + + if (messageObject._messageType===Microsoft.Office.Common.MessageType.request) { + var requesterUrl=(e.origin==null || e.origin=="null") ? messageObject._origin : e.origin; + try { + var serviceEndPoint=_lookupServiceEndPoint(messageObject._conversationId); + ; + var conversation=serviceEndPoint._conversations[messageObject._conversationId]; + serializerVersion=conversation.serializerVersion !=null ? conversation.serializerVersion : serializerVersion; + ; + if (!_checkOrigin(conversation.url, e.origin) && !_checkOriginWithAppDomains(serviceEndPoint._appDomains[messageObject._conversationId], e.origin)) { + throw "Failed origin check"; + } + var policyManager=serviceEndPoint.getPolicyManager(); + if (policyManager && !policyManager.checkPermission(messageObject._conversationId, messageObject._actionName, messageObject._data)) { + throw "Access Denied"; + } + var methodObject=_lookupMethodObject(serviceEndPoint, messageObject); + + var invokeCompleteCallback=new Microsoft.Office.Common.InvokeCompleteCallback(e.source, requesterUrl, messageObject._actionName, messageObject._conversationId, messageObject._correlationId, _postCallbackHandler, serializerVersion); + + var invoker=new Microsoft.Office.Common.Invoker(methodObject, messageObject._data, invokeCompleteCallback, serviceEndPoint._eventHandlerProxyList, messageObject._conversationId, messageObject._actionName, serializerVersion); + var shouldEnque=true; + + if (_messageProcessingTimer==null) { + if ((_lastMessageProcessTime==null || (new Date()).getTime() - _lastMessageProcessTime > _processInterval) && !_blockingFlag) { + _executeCommand(invoker); + shouldEnque=false; + } else { + _messageProcessingTimer=setInterval(_dequeInvoker, _processInterval); + } + } + if (shouldEnque) { + _enqueInvoker(invoker); + } + } catch (ex) { + var errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest; + if (ex=="Access Denied") { + errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied; + } + var callResponse=new Microsoft.Office.Common.Response(messageObject._actionName, messageObject._conversationId, messageObject._correlationId, errorCode, Microsoft.Office.Common.ResponseType.forCalling, ex); + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(callResponse, serializerVersion); + if (e.source && e.source.postMessage) { + e.source.postMessage(envelopedResult, requesterUrl); + } + } + } else if (messageObject._messageType===Microsoft.Office.Common.MessageType.response) { + var clientEndPoint=_lookupClientEndPoint(messageObject._conversationId); + clientEndPoint._serializerVersion=serializerVersion; + ; + if (!_checkOrigin(clientEndPoint._targetUrl, e.origin)) { + throw "Failed orgin check"; + } + if (messageObject._responseType===Microsoft.Office.Common.ResponseType.forCalling) { + var callbackEntry=clientEndPoint._callbackList[messageObject._correlationId]; + if (callbackEntry) { + try { + if (callbackEntry.callback) + callbackEntry.callback(messageObject._errorCode, messageObject._data); + } finally { + delete clientEndPoint._callbackList[messageObject._correlationId]; + } + } + } else { + var eventhandler=clientEndPoint._eventHandlerList[messageObject._actionName]; + if (eventhandler !==undefined && eventhandler !==null) { + eventhandler(messageObject._data); + } + } + } else { + return; + } + } + } + ; + + function _initialize() { + if (!_initialized) { + _registerListener(_receive); + _initialized=true; + } + } + ; + + return { + connect: function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl, serializerVersion) { + var clientEndPoint=_clientEndPoints[conversationId]; + if (!clientEndPoint) { + _initialize(); + clientEndPoint=new Microsoft.Office.Common.ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion); + _clientEndPoints[conversationId]=clientEndPoint; + } + return clientEndPoint; + }, + getClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _clientEndPoints[conversationId]; + }, + createServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) { + _initialize(); + var serviceEndPoint=new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId); + _serviceEndPoints[serviceEndPointId]=serviceEndPoint; + return serviceEndPoint; + }, + getServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) { + var e=Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _serviceEndPoints[serviceEndPointId]; + }, + deleteClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete _clientEndPoints[conversationId]; + }, + _setMethodTimeout: function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) { + var e=Function._validateParams(arguments, [ + { name: "methodTimeout", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + _methodTimeout=(methodTimeout <=0) ? _methodTimeoutDefault : methodTimeout; + }, + _startMethodTimeoutTimer: function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() { + if (!_methodTimeoutTimer) { + _methodTimeoutTimer=setInterval(_checkMethodTimeout, _methodTimeoutProcessInterval); + } + } + }; +})(); + +Microsoft.Office.Common.Message=function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) { + var e=Function._validateParams(arguments, [ + { name: "messageType", type: Number, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._messageType=messageType; + + this._actionName=actionName; + + this._conversationId=conversationId; + + this._correlationId=correlationId; + + this._origin=window.location.href; + + if (typeof data=="undefined") { + this._data=null; + } else { + this._data=data; + } +}; +Microsoft.Office.Common.Message.prototype={ + getActionName: function Microsoft_Office_Common_Message$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_Message$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() { + return this._correlationId; + }, + getOrigin: function Microsoft_Office_Common_Message$getOrigin() { + return this._origin; + }, + getData: function Microsoft_Office_Common_Message$getData() { + return this._data; + }, + getMessageType: function Microsoft_Office_Common_Message$getMessageType() { + return this._messageType; + } +}; + +Microsoft.Office.Common.Request=function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) { + Microsoft.Office.Common.Request.uber.constructor.call(this, Microsoft.Office.Common.MessageType.request, actionName, conversationId, correlationId, data); + this._actionType=actionType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Request, Microsoft.Office.Common.Message); +Microsoft.Office.Common.Request.prototype.getActionType=function Microsoft_Office_Common_Request$getActionType() { + return this._actionType; +}; + +Microsoft.Office.Common.Response=function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) { + Microsoft.Office.Common.Response.uber.constructor.call(this, Microsoft.Office.Common.MessageType.response, actionName, conversationId, correlationId, data); + this._errorCode=errorCode; + this._responseType=responseType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Response, Microsoft.Office.Common.Message); + +Microsoft.Office.Common.Response.prototype.getErrorCode=function Microsoft_Office_Common_Response$getErrorCode() { + return this._errorCode; +}; + +Microsoft.Office.Common.Response.prototype.getResponseType=function Microsoft_Office_Common_Response$getResponseType() { + return this._responseType; +}; + +Microsoft.Office.Common.MessagePackager={ + envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject, serializerVersion) { + if (serializerVersion==OSF.SerializerVersion.Browser && (typeof (JSON) !=="undefined")) { + if (typeof (messageObject)==="object") { + messageObject._serializerVersion=serializerVersion; + } + return JSON.stringify(messageObject); + } else { + if (typeof (messageObject)==="object") { + messageObject._serializerVersion=OSF.SerializerVersion.MsAjax; + } + return OsfMsAjaxFactory.msAjaxSerializer.serialize(messageObject); + } + }, + unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject, serializerVersion) { + if (serializerVersion==OSF.SerializerVersion.Browser && (typeof (JSON) !=="undefined")) { + return JSON.parse(messageObject); + } else { + return OsfMsAjaxFactory.msAjaxSerializer.deserialize(messageObject, true); + } + } +}; + +Microsoft.Office.Common.ResponseSender=function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType, serializerVersion) { + var e=Function._validateParams(arguments, [ + { name: "requesterWindow", mayBeNull: false }, + { name: "requesterUrl", type: String, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "responsetype", type: Number, maybeNull: false }, + { name: "serializerVersion", type: Number, maybeNull: true, optional: true } + ]); + if (e) + throw e; + + this._requesterWindow=requesterWindow; + + this._requesterUrl=requesterUrl; + + this._actionName=actionName; + + this._conversationId=conversationId; + + this._correlationId=correlationId; + + this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError; + + this._responseType=responseType; + var me=this; + + this._send=function (result) { + try { + var response=new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + ; + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+ex.message); + } + }; +}; +Microsoft.Office.Common.ResponseSender.prototype={ + getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() { + return this._requesterWindow; + }, + getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() { + return this._requesterUrl; + }, + getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() { + return this._correlationId; + }, + getSend: function Microsoft_Office_Common_ResponseSender$getSend() { + return this._send; + }, + setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) { + this._invokeResultCode=resultCode; + } +}; + +Microsoft.Office.Common.InvokeCompleteCallback=function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler, serializerVersion) { + Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this, requesterWindow, requesterUrl, actionName, conversationId, correlationId, Microsoft.Office.Common.ResponseType.forCalling, serializerVersion); + + this._postCallbackHandler=postCallbackHandler; + var me=this; + + this._send=function (result) { + try { + var response=new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + + me._postCallbackHandler(); + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+ex.message); + } + }; +}; +OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback, Microsoft.Office.Common.ResponseSender); + +Microsoft.Office.Common.Invoker=function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName, serializerVersion) { + var e=Function._validateParams(arguments, [ + { name: "methodObject", mayBeNull: false }, + { name: "paramValue", mayBeNull: true }, + { name: "invokeCompleteCallback", mayBeNull: false }, + { name: "eventHandlerProxyList", mayBeNull: true }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "eventName", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._methodObject=methodObject; + + this._param=paramValue; + + this._invokeCompleteCallback=invokeCompleteCallback; + + this._eventHandlerProxyList=eventHandlerProxyList; + + this._conversationId=conversationId; + + this._eventName=eventName; + this._serializerVersion=serializerVersion; +}; +Microsoft.Office.Common.Invoker.prototype={ + invoke: function Microsoft_Office_Common_Invoker$invoke() { + try { + var result; + switch (this._methodObject.getInvokeType()) { + case Microsoft.Office.Common.InvokeType.async: + this._methodObject.getMethod()(this._param, this._invokeCompleteCallback.getSend()); + break; + case Microsoft.Office.Common.InvokeType.sync: + result=this._methodObject.getMethod()(this._param); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncRegisterEvent: + var eventHandlerProxy=this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + result=this._methodObject.getMethod()(eventHandlerProxy.getSend(), this._param); + + this._eventHandlerProxyList[this._conversationId+this._eventName]=eventHandlerProxy.getSend(); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncUnregisterEvent: + var eventHandler=this._eventHandlerProxyList[this._conversationId+this._eventName]; + + result=this._methodObject.getMethod()(eventHandler, this._param); + + delete this._eventHandlerProxyList[this._conversationId+this._eventName]; + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.asyncRegisterEvent: + var eventHandlerProxyAsync=this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(), this._invokeCompleteCallback.getSend(), this._param); + + this._eventHandlerProxyList[this._callerId+this._eventName]=eventHandlerProxyAsync.getSend(); + + break; + case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: + var eventHandlerAsync=this._eventHandlerProxyList[this._callerId+this._eventName]; + + this._methodObject.getMethod()(eventHandlerAsync, this._invokeCompleteCallback.getSend(), this._param); + + delete this._eventHandlerProxyList[this._callerId+this._eventName]; + + break; + default: + break; + } + } catch (ex) { + this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse); + this._invokeCompleteCallback.getSend()(ex); + } + }, + getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() { + return this._methodObject.getBlockingFlag(); + }, + _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) { + return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(), invokeCompleteObject.getRequesterUrl(), invokeCompleteObject.getActionName(), invokeCompleteObject.getConversationId(), invokeCompleteObject.getCorrelationId(), Microsoft.Office.Common.ResponseType.forEventing, this._serializerVersion); + } +}; + +OSF.OUtil.setNamespace("WAC", OSF.DDA); + +OSF.DDA.WAC.UniqueArguments={ + Data: "Data", + Properties: "Properties", + BindingRequest: "DdaBindingsMethod", + BindingResponse: "Bindings", + SingleBindingResponse: "singleBindingResponse", + GetData: "DdaGetBindingData", + AddRowsColumns: "DdaAddRowsColumns", + SetData: "DdaSetBindingData", + ClearFormats: "DdaClearBindingFormats", + SetFormats: "DdaSetBindingFormats", + SettingsRequest: "DdaSettingsMethod", + BindingEventSource: "ddaBinding", + ArrayData: "ArrayData" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.Delegate.SpecialProcessor=function OSF_DDA_WAC_Delegate_SpecialProcessor() { + var complexTypes=[ + OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + OSF.DDA.WAC.UniqueArguments.BindingRequest, + OSF.DDA.WAC.UniqueArguments.BindingResponse, + OSF.DDA.WAC.UniqueArguments.GetData, + OSF.DDA.WAC.UniqueArguments.AddRowsColumns, + OSF.DDA.WAC.UniqueArguments.SetData, + OSF.DDA.WAC.UniqueArguments.ClearFormats, + OSF.DDA.WAC.UniqueArguments.SetFormats, + OSF.DDA.WAC.UniqueArguments.SettingsRequest, + OSF.DDA.WAC.UniqueArguments.BindingEventSource + ]; + var dynamicTypes={}; + OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); +}; + +OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor(), []); +OSF.OUtil.setNamespace("WAC", OSF.DDA); +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.getDelegateMethods=function OSF_DDA_WAC_getDelegateMethods() { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync; + return delegateMethods; +}; +OSF.DDA.WAC.Delegate.version=1; +OSF.DDA.WAC.Delegate.executeAsync=function OSF_DDA_WAC_Delegate$executeAsync(args) { + if (!args.hostCallArgs) { + args.hostCallArgs={}; + } + args.hostCallArgs["DdaMethod"]={ + "ControlId": OSF._OfficeAppFactory.getId(), + "Version": OSF.DDA.WAC.Delegate.version, + "DispatchId": args.dispId + }; + + args.hostCallArgs["__timeout__"]=-1; + + if (args.onCalling) { + args.onCalling(); + } + var startTime=(new Date()).getTime(); + OSF.getClientEndPoint().invoke("executeMethod", function OSF_DDA_WAC_Delegate$OMFacade$OnResponse(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var error; + if (xdmStatus==Microsoft.Office.Common.InvokeResultCode.noError) { + OSF.DDA.WAC.Delegate.version=payload["Version"]; + error=payload["Error"]; + } else { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + error=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + error=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(error, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, null, Math.abs((new Date()).getTime() - startTime), error); + } + }, args.hostCallArgs); +}; +OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function OSF_DDA_WAC_Delegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_WAC_Delegate$OnAfterRegisterEvent(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var status; + if (xdmStatus !=Microsoft.Office.Common.InvokeResultCode.noError) { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } else { + if (payload) { + if (payload["Error"]) { + status=payload["Error"]; + } else { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } + } else { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.WAC.Delegate.registerEventAsync=function OSF_DDA_WAC_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), function OSF_DDA_WACOMFacade$OnEvent(payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.DDA.WAC.Delegate.unregisterEventAsync=function OSF_DDA_WAC_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.OUtil.setNamespace("WebApp", OSF); + +OSF.WebApp.AddHostInfoAndXdmInfo=function OSF_WebApp$AddHostInfoAndXdmInfo(url) { + if (OSF._OfficeAppFactory.getWindowLocationSearch && OSF._OfficeAppFactory.getWindowLocationHash) { + return url+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash(); + } else { + return url; + } +}; + +OSF.WebApp._UpdateLinksForHostAndXdmInfo=function OSF_WebApp$_UpdateLinksForHostAndXdmInfo() { + var links=document.querySelectorAll("a[data-officejs-navigate]"); + for (var i=0; i < links.length; i++) { + if (OSF.WebApp._isGoodUrl(links[i].href)) { + links[i].href=OSF.WebApp.AddHostInfoAndXdmInfo(links[i].href); + } + } + + var forms=document.querySelectorAll("form[data-officejs-navigate]"); + for (var i=0; i < forms.length; i++) { + var form=forms[i]; + if (OSF.WebApp._isGoodUrl(form.action)) { + form.action=OSF.WebApp.AddHostInfoAndXdmInfo(form.action); + } + } +}; + +OSF.WebApp._isGoodUrl=function OSF_WebApp$_isGoodUrl(url) { + if (typeof url=='undefined') + return false; + url=url.trim(); + var colonIndex=url.indexOf(':'); + var protocol=colonIndex > 0 ? url.substr(0, colonIndex) : null; + + var goodUrl=protocol !==null ? protocol.toLowerCase()==="http" || protocol.toLowerCase()==="https" : true; + + goodUrl=goodUrl && url !="#" && url !="/" && url !="" && url !=OSF._OfficeAppFactory.getWebAppState().webAppUrl; + return goodUrl; +}; + +OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo=hostInfo; + this._webAppState=webAppState; + this._context=context; + this._settings=settings; + this._hostFacade=hostFacade; + this._initializeSettings=function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) { + var settings; + var serializedSettings=appContext.get_settings(); + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings=typeof (JSON) !=="undefined" ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings=typeof (JSON) !=="undefined" ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings=new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings=new OSF.DDA.Settings(deserializedSettings); + } + return settings; + }; + + var windowOpen=function OSF_InitializationHelper$windowOpen(windowObj) { + var proxy=window.open; + windowObj.open=function (strUrl, strWindowName, strWindowFeatures) { + var windowObject=null; + try { + windowObject=proxy(strUrl, strWindowName, strWindowFeatures); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+ex); + } + } + if (!windowObject) { + var params={ + "strUrl": strUrl, + "strWindowName": strWindowName, + "strWindowFeatures": strWindowFeatures + }; + OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost", null, params); + } + return windowObject; + }; + }; + windowOpen(window); +}; +OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var getInvocationCallbackWebApp=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) { + var settings; + if (appContext._appName===OSF.AppName.ExcelWebApp) { + var serializedSettings=appContext._settings; + settings={}; + for (var index in serializedSettings) { + var setting=serializedSettings[index]; + settings[setting[0]]=setting[1]; + } + } else { + settings=appContext._settings; + } + if (errorCode===0 && appContext._id !=undefined && appContext._appName !=undefined && appContext._appVersion !=undefined && appContext._appUILocale !=undefined && appContext._dataLocale !=undefined && appContext._docUrl !=undefined && appContext._clientMode !=undefined && appContext._settings !=undefined && appContext._reason !=undefined) { + var appInstanceId=appContext._id; + + var touchEnabled=false; + + var commerceAllowed=true; + var minorVersion=0; + if (appContext._appMinorVersion !=undefined) { + minorVersion=appContext._appMinorVersion; + } + var requirementMatrix=undefined; + if (appContext._requirementMatrix !=undefined) { + requirementMatrix=appContext._requirementMatrix; + } + var returnedContext=new OSF.OfficeAppContext(appContext._id, appContext._appName, appContext._appVersion, appContext._appUILocale, appContext._dataLocale, appContext._docUrl, appContext._clientMode, settings, appContext._reason, appContext._osfControlType, appContext._eToken, appContext._correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + } else { + var errorMsg="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+errorCode+", exception: "+appContext; + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException(errorMsg); + } + throw errorMsg; + } + }; + try { + this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync", getInvocationCallbackWebApp, this._webAppState.id); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+ex+"]"); + } + throw ex; + } +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() { + try { + var me=this; + var xdmInfoValue=OSF.OUtil.parseXdmInfoWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + if (xdmInfoValue) { + var xdmItems=OSF.OUtil.getInfoItems(xdmInfoValue); + if (xdmItems !=undefined && xdmItems.length >=3) { + me._webAppState.conversationID=xdmItems[0]; + me._webAppState.id=xdmItems[1]; + me._webAppState.webAppUrl=xdmItems[2]; + } + } + me._webAppState.serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + me._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID, me._webAppState.wnd, me._webAppState.webAppUrl, me._webAppState.serializerVersion); + me._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id); + var notificationConversationId=me._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix; + me._webAppState.serviceEndPoint.registerConversation(notificationConversationId, me._webAppState.webAppUrl); + var focusFirstItem=function OSF_OfficeAppFactory_initialize$focusFirstItem() { + if (!me._webAppState.focused) { + me._webAppState.focused=true; + var list=document.querySelectorAll('input,a,button'); + for (var i=0; i < list.length; i++) { + var node=list[i]; + if (node instanceof HTMLElement) { + var element=node; + element.focus(); + break; + } + } + } + }; + var notifyAgave=function OSF__OfficeAppFactory_initialize$notifyAgave(actionId) { + switch (actionId) { + case OSF.AgaveHostAction.Select: + me._webAppState.focused=true; + break; + case OSF.AgaveHostAction.UnSelect: + me._webAppState.focused=false; + break; + case OSF.AgaveHostAction.CtrlF6In: + focusFirstItem(); + default: + OsfMsAjaxFactory.msAjaxDebug.trace("actionId "+actionId+" notifyAgave is wrong."); + break; + } + }; + me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave", notifyAgave, Microsoft.Office.Common.InvokeType.async, false); + OSF.OUtil.addEventListener(window, "focus", function () { + if (!me._webAppState.focused) { + me._webAppState.focused=true; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.Select]); + }); + OSF.OUtil.addEventListener(window, "blur", function () { + if (me._webAppState.focused) { + me._webAppState.focused=false; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.UnSelect]); + }); + + OSF.OUtil.addEventListener(window, "keydown", function (e) { + if (e.keyCode==117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue=false; + } + var actionId=OSF.AgaveHostAction.CtrlF6Exit; + if (e.shiftKey) { + actionId=OSF.AgaveHostAction.CtrlF6ExitShift; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, actionId]); + } + }); + + OSF.OUtil.addEventListener(window, "keypress", function (e) { + if (e.keyCode==117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue=false; + } + } + }); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+ex+"]"); + } + throw ex; + } +}; +OSF.getClientEndPoint=function OSF$getClientEndPoint() { + var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper(); + return initializationHelper._webAppState.clientEndPoint; +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData=(function () { + function BaseUsageData(table) { + this._table=table; + this._fields={}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields=function () { + }; + BaseUsageData.prototype.SetSerializedField=function (key, value) { + if (typeof (value) !=="undefined" && value !==null) { + this._serializedFields[key]=value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow=function () { + this._serializedFields={}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData=BaseUsageData; + var AppActivatedUsageData=(function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"]=value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData=AppActivatedUsageData; + var ScriptLoadUsageData=(function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData=ScriptLoadUsageData; + var AppClosedUsageData=(function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"]=value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData=AppClosedUsageData; + var APIUsageUsageData=(function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"]=value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData=APIUsageUsageData; + var AppInitializationUsageData=(function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"]=value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData=AppInitializationUsageData; +})(OSFLog || (OSFLog={})); + +var Logger; +(function (Logger) { + "use strict"; + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"]=0]="info"; + TraceLevel[TraceLevel["warning"]=1]="warning"; + TraceLevel[TraceLevel["error"]=2]="error"; + })(Logger.TraceLevel || (Logger.TraceLevel={})); + var TraceLevel=Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"]=0]="none"; + SendFlag[SendFlag["flush"]=1]="flush"; + })(Logger.SendFlag || (Logger.SendFlag={})); + var SendFlag=Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData=allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs=JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog=sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy=(function () { + function ULSEndpointProxy() { + var _this=this; + this.proxyFrame=null; + this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer=[]; + this.proxyFrameReady=false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog=function (log) { + if (this.proxyFrameReady===true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame=function () { + if (this.proxyFrame==null) { + this.proxyFrame=document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) { + var _this=this; + if (e.data==="ProxyFrameReadyToLog") { + this.proxyFrameReady=true; + for (var i=0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length=0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data==="ProxyFrameReadyToInit") { + var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr=JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger=Logger; + } + + Logger.ulsEndpoint=creatULSEndpoint(); +})(Logger || (Logger={})); + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId=OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId=""; + + ; + + var AppInfo=(function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event=(function () { + function Event(name, handler) { + this.name=name; + this.handler=handler; + } + return Event; + })(); + var AppStorage=(function () { + function AppStorage() { + this.clientIDKey="Office API client"; + this.logIdSetKey="Office App Log Id Set"; + } + AppStorage.prototype.getClientId=function () { + var clientId=this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <=0 || clientId.length > 40) { + clientId=OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog=function (logId, log) { + var logIdSet=this.getValue(this.logIdSetKey); + logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog=function (callback, clean) { + var logIdSet=this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids=logIdSet.split(";"); + for (var id in ids) { + var logId=ids[id]; + var log=this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + var value=""; + if (osfLocalStorage) { + value=osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue=function (key, value) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger=(function () { + function AppLogger() { + } + AppLogger.prototype.LogData=function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData=function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo=new AppInfo(); + appInfo.hostVersion=context.get_appVersion(); + appInfo.appId=context.get_id(); + appInfo.host=context.get_appName(); + appInfo.browser=window.navigator.userAgent; + appInfo.correlationId=context.get_correlationId(); + appInfo.clientId=(new AppStorage()).getClientId(); + var index=location.href.indexOf("?"); + appInfo.appURL=(index==-1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId=""; + appInfo.userId=""; + try { + xmlContent=decodeURIComponent(token); + parser=new DOMParser(); + xmlDoc=parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent=null; + xmlDoc=null; + parser=null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime=new Date(); + + var lastFocus=null; + + var focusTime=0; + var finished=false; + var adjustFocusTime=function () { + if (document.hasFocus()) { + if (lastFocus==null) { + lastFocus=new Date(); + } + } else if (lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + }; + var eventList=[]; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction=function () { + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length=0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished=true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize=initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data=new OSFLog.AppActivatedUsageData(); + data.SessionId=sessionId; + data.AppId=appInfo.appId; + data.AssetId=appInfo.assetId; + data.AppURL=appInfo.appURL; + data.UserId=appInfo.userId; + data.ClientId=appInfo.clientId; + data.Browser=appInfo.browser; + data.Host=appInfo.host; + data.HostVersion=appInfo.hostVersion; + data.CorrelationId=appInfo.correlationId; + data.AppSizeWidth=window.innerWidth; + data.AppSizeHeight=window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated=onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data=new OSFLog.ScriptLoadUsageData(); + data.CorrelationId=appCorrelationId; + data.SessionId=sessionId; + data.ScriptId=scriptId; + data.StartTime=msStartTime; + data.ResponseTime=msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone=onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data=new OSFLog.APIUsageUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.APIType=apiType; + data.APIID=id; + data.Parameters=parameters; + data.ResponseTime=msResponseTime; + data.ErrorType=errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone=onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters=null; + if (args) { + if (typeof args=="number") { + parameters=String(args); + } else if (typeof args==="object") { + for (var index in args) { + if (parameters !==null) { + parameters+=","; + } else { + parameters=""; + } + if (typeof args[index]=="number") { + parameters+=String(args[index]); + } + } + } else { + parameters=""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone=onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone=onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone=onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone=onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data=new OSFLog.AppClosedUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.FocusTime=focusTime; + data.OpenTime=openTime; + data.AppSizeFinalWidth=window.innerWidth; + data.AppSizeFinalHeight=window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed=onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId=correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data=new OSFLog.AppInitializationUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.SuccessCode=isException ? 1 : 0; + data.Message=message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException=logAppException; + OSF.AppTelemetry=OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry={})); + +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed", + Pdf: "pdf" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FileProperties: "FileProperties", + FileSliceProperties: "FileSliceProperties" +}); +OSF.DDA.FileProperties={ + Handle: "FileHandle", + FileSize: "FileSize", + SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize +}; +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], privateState); +}; + +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.AsyncMethodNames.addNames({ + GetDocumentCopyAsync: "getFileAsync", + GetDocumentCopyChunkAsync: "getSliceAsync", + ReleaseDocumentCopyAsync: "closeAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.FileType, + "enum": Microsoft.Office.WebExtension.FileType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SliceSize, + value: { + "types": ["number"], + "defaultValue": 4 * 1024 * 1024 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var sliceSize=callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]; + + if (sliceSize <=0 || sliceSize > (4 * 1024 * 1024)) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize; + } + return callArgs; + }, + onSucceeded: function (fileDescriptor, caller, callArgs) { + return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]); + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.SliceIndex, + "types": ["number"] + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + }, + { + name: OSF.DDA.FileProperties.SliceSize, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.SliceSize]; + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var index=callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]; + + if (index < 0 || index >=caller.sliceCount) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange; + } + + callArgs[OSF.DDA.FileSliceOffset]=parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString()); + return callArgs; + }, + onSucceeded: function (sliceDescriptor, caller, callArgs) { + var slice={}; + OSF.OUtil.defineEnumerableProperties(slice, { + "data": { + value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data] + }, + "index": { + value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex] + }, + "size": { + value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize] + } + }); + return slice; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync, + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + } + ] +}); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); +OSF.OUtil.setNamespace("File", OSF.DDA.Marshaling); + +var OSF_DDA_Marshaling_File_FilePropertiesKeys; +(function (OSF_DDA_Marshaling_File_FilePropertiesKeys) { + OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["Handle"]=0]="Handle"; + OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["FileSize"]=1]="FileSize"; +})(OSF_DDA_Marshaling_File_FilePropertiesKeys || (OSF_DDA_Marshaling_File_FilePropertiesKeys={})); +; +OSF.DDA.Marshaling.File.FilePropertiesKeys=OSF_DDA_Marshaling_File_FilePropertiesKeys; +var OSF_DDA_Marshaling_File_SlicePropertiesKeys; +(function (OSF_DDA_Marshaling_File_SlicePropertiesKeys) { + OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["Data"]=0]="Data"; + OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["SliceSize"]=1]="SliceSize"; +})(OSF_DDA_Marshaling_File_SlicePropertiesKeys || (OSF_DDA_Marshaling_File_SlicePropertiesKeys={})); +; +OSF.DDA.Marshaling.File.SlicePropertiesKeys=OSF_DDA_Marshaling_File_SlicePropertiesKeys; +var OSF_DDA_Marshaling_File_FileType; +(function (OSF_DDA_Marshaling_File_FileType) { + OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Text"]=0]="Text"; + OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Compressed"]=1]="Compressed"; + OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Pdf"]=2]="Pdf"; +})(OSF_DDA_Marshaling_File_FileType || (OSF_DDA_Marshaling_File_FileType={})); +; +OSF.DDA.Marshaling.File.FileType=OSF_DDA_Marshaling_File_FileType; +var OSF_DDA_Marshaling_File_ParameterKeys; +(function (OSF_DDA_Marshaling_File_ParameterKeys) { + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["FileType"]=0]="FileType"; + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceSize"]=1]="SliceSize"; + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["Handle"]=2]="Handle"; + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceIndex"]=3]="SliceIndex"; +})(OSF_DDA_Marshaling_File_ParameterKeys || (OSF_DDA_Marshaling_File_ParameterKeys={})); +; +OSF.DDA.Marshaling.File.ParameterKeys=OSF_DDA_Marshaling_File_ParameterKeys; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties); +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle }, + { name: OSF.DDA.FileProperties.FileSize, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data }, + { name: OSF.DDA.FileProperties.SliceSize, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: Microsoft.Office.WebExtension.FileType.Text, value: OSF.DDA.Marshaling.File.FileType.Text }, + { name: Microsoft.Office.WebExtension.FileType.Compressed, value: OSF.DDA.Marshaling.File.FileType.Compressed }, + { name: Microsoft.Office.WebExtension.FileType.Pdf, value: OSF.DDA.Marshaling.File.FileType.Pdf } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.FileType, value: OSF.DDA.Marshaling.File.ParameterKeys.FileType }, + { name: Microsoft.Office.WebExtension.Parameters.SliceSize, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceSize } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle }, + { name: Microsoft.Office.WebExtension.Parameters.SliceIndex, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle }] +}); + +Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data==null || data==undefined) { + return null; + } + try { + for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data=[data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers=fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ? [] : fixData(value); + } + } + }); + this.headers=headers; + this.rows=rows; +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; + +Microsoft.Office.WebExtension.CoercionType={ + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim=0; + for (var index=0; index < obj.length; index++) { + dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim+1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data==null || data==undefined) + return null; + var sourceType=null; + var runtimeType=typeof data; + if (data.rows !==undefined) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType !=destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length==1 && matrix[0].length==1) + return ""+matrix[0][0]; + var val=""; + for (var i=0; i < matrix.length; i++) { + val+=matrix[i].join("\t")+"\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret=text.split("\n"); + for (var i=0; i < ret.length; i++) + ret[i]=ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers=""; + if (table.headers !=null) { + headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n"; + } + + var rows=OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows=="") { + headers=headers.substring(0, headers.length - 1); + } + return headers+rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix=table.rows; + if (table.headers !=null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value=null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value==null) { + value=OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType==undefined) { + sourceType=OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) { + data=OSF.DDA.OMFactory.manufactureTableData(data); + } + data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data==undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageLeft, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageTop, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageWidth, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageHeight, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.GetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: "ValueFormat" }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: "FilterType" }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" }, + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.SettingsManager={ + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret={}; + for (var key in settingsCollection) { + var value=settingsCollection[key]; + try { + if (JSON) { + value=JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value=Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key]=value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret={}; + serializedSettings=serializedSettings || {}; + for (var key in serializedSettings) { + var value=serializedSettings[key]; + try { + if (JSON) { + value=JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) { + d=new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key]=value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings=function OSF_DDA_Settings(settings) { + settings=settings || {}; + + var cacheSessionSettings=function (settings) { + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting=settings[name]; + return typeof (setting)==='undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name]=value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType={}; + +OSF.EventDispatch=function OSF_EventDispatch(eventTypes) { + this._eventHandlers={}; + for (var entry in eventTypes) { + var eventType=eventTypes[entry]; + this._eventHandlers[eventType]=[]; + } +}; +OSF.EventDispatch.prototype={ + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events=[]; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported=false; + for (var eventName in this._eventHandlers) { + if (event==eventName) { + isSupported=true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h]===handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler !="function") { + return false; + } + var handlers=this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index=0; index < handlers.length; index++) { + if (handlers[index]===handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType]=[]; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type==undefined) + return false; + var eventType=eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers=this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args=new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args=new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args=new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args=new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args=new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); +OSF.DDA.WAC.SettingsTranslator=(function () { + var keyIndex=0; + var valueIndex=1; + return { + read: function OSF_DDA_WAC_SettingsTranslator$read(payload) { + if (payload.Settings) { + var serializedSettings={}; + var settingsPayload=payload.Settings; + for (var index in settingsPayload) { + var setting=settingsPayload[index]; + serializedSettings[setting[keyIndex]]=setting[valueIndex]; + } + return serializedSettings; + } else if (typeof window["OSFPPTWAC"] !="undefined") { + return payload; + } else { + var serializedSettings={}; + return serializedSettings; + } + }, + write: function OSF_DDA_WAC_SettingsTranslator$write(serializedSettings) { + var settingsPayload=[]; + for (var key in serializedSettings) { + var setting=[]; + setting[keyIndex]=key; + setting[valueIndex]=serializedSettings[key]; + settingsPayload.push(setting); + } + return settingsPayload; + } + }; +})(); +OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings, { + toHost: OSF.DDA.WAC.SettingsTranslator.write, + fromHost: OSF.DDA.WAC.SettingsTranslator.read +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SettingsRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: "OverwriteIfStale" }, + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ], + invertible: true +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SettingsRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); + +Microsoft.Office.WebExtension.BindingType={ + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties={ + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id=bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t=typeof onError; + if (t !="undefined" && t !="function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback=onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype={ + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me=this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches=[]; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et=Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches=docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id]=new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch=bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime(); +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id=bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding=new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp=function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject=OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject=OSF.DDA.TableBinding; + } + binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding=new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) { + data=OSF.DDA.OMFactory.manufactureTableData(data); + } + data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data==undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties={ + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.BindingRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: "ItemName" }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: "BindingType" }, + { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: "PromptText" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.SampleData, value: "SampleData" }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: "FailOnCollision" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 2 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 3 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 1 } + ], + invertible: true +}); +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: "Name" }, + { name: OSF.DDA.BindingProperties.Type, value: "BindingType" }, + { name: OSF.DDA.BindingProperties.RowCount, value: "RowCount" }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: "ColCount" }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: "HasHeaders" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddRowsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddColumnsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.Subset, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" }, + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" } + ] +}); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); + +OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) { + OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Matrix + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + } + }); +}; +OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding); + +OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) { + OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperty(this, "type", { + value: Microsoft.Office.WebExtension.BindingType.Text + }); +}; +OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.PromptText, + value: { + "types": ["string"], + "calculate": function () { + return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.SampleData, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: function (bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + BindingSelectionChanged: "bindingSelectionChanged", + BindingDataChanged: "bindingDataChanged" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" }); +OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged + }, + "binding": { + value: bindingInstance + } + }); + for (var prop in subset) { + OSF.OUtil.defineEnumerableProperty(this, prop, { + value: subset[prop] + }); + } +}; +OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingDataChanged + }, + "binding": { + value: bindingInstance + } + }); +}; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.BindingSelectionChangedEvent); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: OSF.DDA.PropertyDescriptors.Subset } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource } + ] +}); +OSF.DDA.FilePropertiesDescriptor={ + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +var OSF_DDA_Marshaling_FilePropertiesKeys; +(function (OSF_DDA_Marshaling_FilePropertiesKeys) { + OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Properties"]=0]="Properties"; + + OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Url"]=1]="Url"; +})(OSF_DDA_Marshaling_FilePropertiesKeys || (OSF_DDA_Marshaling_FilePropertiesKeys={})); +; +OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: OSF.DDA.Marshaling.FilePropertiesKeys.Url } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.Marshaling.FilePropertiesKeys.Properties } + ] +}); + +Microsoft.Office.WebExtension.GoToType={ + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode={ + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index={ + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +OSF.DDA.Marshaling.NavigationKeys={ + NavigationRequest: "DdaGoToByIdMethod", + Id: "Id", + GoToType: "GoToType", + SelectionMode: "SelectionMode" +}; + +var OSF_DDA_Marshaling_GoToType; +(function (OSF_DDA_Marshaling_GoToType) { + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Binding"]=0]="Binding"; + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["NamedItem"]=1]="NamedItem"; + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Slide"]=2]="Slide"; + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Index"]=3]="Index"; +})(OSF_DDA_Marshaling_GoToType || (OSF_DDA_Marshaling_GoToType={})); +; +OSF.DDA.Marshaling.GoToType=OSF_DDA_Marshaling_GoToType; + +var OSF_DDA_Marshaling_SelectionMode; +(function (OSF_DDA_Marshaling_SelectionMode) { + OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Default"]=0]="Default"; + OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Selected"]=1]="Selected"; + OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["None"]=2]="None"; +})(OSF_DDA_Marshaling_SelectionMode || (OSF_DDA_Marshaling_SelectionMode={})); +; +OSF.DDA.Marshaling.SelectionMode=OSF_DDA_Marshaling_SelectionMode; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.Marshaling.NavigationKeys.NavigationRequest); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.NavigationKeys.Id }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: OSF.DDA.Marshaling.NavigationKeys.GoToType }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: OSF.DDA.Marshaling.NavigationKeys.SelectionMode } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: OSF.DDA.Marshaling.GoToType.Binding }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: OSF.DDA.Marshaling.GoToType.NamedItem }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: OSF.DDA.Marshaling.GoToType.Slide }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: OSF.DDA.Marshaling.GoToType.Index } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: OSF.DDA.Marshaling.SelectionMode.Default }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: OSF.DDA.Marshaling.SelectionMode.Selected }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: OSF.DDA.Marshaling.SelectionMode.None } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.ClearFormatsAsync, + am.SetTableOptionsAsync, + am.SetFormatsAsync + ]); + OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding); + +(function () { + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + privateStateCallbacks: [] + }); + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var Parameters=Microsoft.Office.WebExtension.Parameters; + + if (callArgs[Parameters.StartRow]==0 && callArgs[Parameters.StartColumn]==0 && OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 && OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) { + delete callArgs[Parameters.StartRow]; + delete callArgs[Parameters.StartColumn]; + delete callArgs[Parameters.CellFormat]; + delete callArgs[Parameters.TableOptions]; + } + if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) || (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) || callArgs[Parameters.CellFormat] || callArgs[Parameters.TableOptions])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: function (obj) { + return obj.id; + } + } + ] + }); + OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.setTableOptionsAsync.apply(binding, args); + }); + return this; + }, OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.setFormatsAsync.apply(binding, args); + }); + return this; + }, OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.clearFormatsAsync.apply(binding, args); + }); + return this; + }; +})(); +(function () { + function getObjectId(obj) { + return obj.id; + } + OSF.DDA.AsyncMethodNames.addNames({ + ClearFormatsAsync: "clearFormatsAsync", + SetTableOptionsAsync: "setTableOptionsAsync", + SetFormatsAsync: "setFormatsAsync" + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.TableOptions, + "defaultValue": [] + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetFormatsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CellFormat, + "defaultValue": [] + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +OSF.DDA.Marshaling.FormatKeys={ + Id: "BindingId", + CellFormat: "CellFormat", + TableOptions: "TableOptions" +}; + +var OSF_DDA_Marshaling_TableOptionProperties; +(function (OSF_DDA_Marshaling_TableOptionProperties) { + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["headerRow"]=0]="headerRow"; + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["bandedRows"]=1]="bandedRows"; + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["firstColumn"]=2]="firstColumn"; + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["lastColumn"]=3]="lastColumn"; + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["bandedColumns"]=4]="bandedColumns"; + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["filterButton"]=5]="filterButton"; + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["style"]=6]="style"; + OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["totalRow"]=7]="totalRow"; +})(OSF_DDA_Marshaling_TableOptionProperties || (OSF_DDA_Marshaling_TableOptionProperties={})); +; +OSF.DDA.Marshaling.TableOptionProperties=OSF_DDA_Marshaling_TableOptionProperties; + +var OSF_DDA_Marshaling_CellProperties; +(function (OSF_DDA_Marshaling_CellProperties) { + OSF_DDA_Marshaling_CellProperties[OSF_DDA_Marshaling_CellProperties["row"]=0]="row"; + OSF_DDA_Marshaling_CellProperties[OSF_DDA_Marshaling_CellProperties["column"]=1]="column"; +})(OSF_DDA_Marshaling_CellProperties || (OSF_DDA_Marshaling_CellProperties={})); +; +OSF.DDA.Marshaling.CellProperties=OSF_DDA_Marshaling_CellProperties; + +var OSF_DDA_Marshaling_CellFormatProperties; +(function (OSF_DDA_Marshaling_CellFormatProperties) { + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["alignHorizontal"]=1]="alignHorizontal"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["alignVertical"]=2]="alignVertical"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["backgroundColor"]=101]="backgroundColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderStyle"]=201]="borderStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderColor"]=202]="borderColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderTopStyle"]=203]="borderTopStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderTopColor"]=204]="borderTopColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderBottomStyle"]=205]="borderBottomStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderBottomColor"]=206]="borderBottomColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderLeftStyle"]=207]="borderLeftStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderLeftColor"]=208]="borderLeftColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderRightStyle"]=209]="borderRightStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderRightColor"]=210]="borderRightColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderOutlineStyle"]=211]="borderOutlineStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderOutlineColor"]=212]="borderOutlineColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderInlineStyle"]=213]="borderInlineStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderInlineColor"]=214]="borderInlineColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontFamily"]=301]="fontFamily"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontStyle"]=302]="fontStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSize"]=303]="fontSize"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontUnderlineStyle"]=304]="fontUnderlineStyle"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontColor"]=305]="fontColor"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontDirection"]=306]="fontDirection"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontStrikethrough"]=307]="fontStrikethrough"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSuperscript"]=308]="fontSuperscript"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSubscript"]=309]="fontSubscript"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontNormal"]=310]="fontNormal"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["indentLeft"]=401]="indentLeft"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["indentRight"]=402]="indentRight"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["numberFormat"]=501]="numberFormat"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["width"]=701]="width"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["height"]=702]="height"; + OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["wrapping"]=703]="wrapping"; +})(OSF_DDA_Marshaling_CellFormatProperties || (OSF_DDA_Marshaling_CellFormatProperties={})); +; +OSF.DDA.Marshaling.CellFormatProperties=OSF_DDA_Marshaling_CellFormatProperties; + +var OSF_DDA_Marshaling_BorderStyleType; +(function (OSF_DDA_Marshaling_BorderStyleType) { + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["none"]=0]="none"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["thin"]=1]="thin"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["medium"]=2]="medium"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashed"]=3]="dashed"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dotted"]=4]="dotted"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["thick"]=5]="thick"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["double"]=6]="double"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["hair"]=7]="hair"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashed"]=8]="mediumDashed"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashDot"]=9]="dashDot"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashDot"]=10]="mediumDashDot"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashDotDot"]=11]="dashDotDot"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashDotDot"]=12]="mediumDashDotDot"; + OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["slantDashDot"]=13]="slantDashDot"; +})(OSF_DDA_Marshaling_BorderStyleType || (OSF_DDA_Marshaling_BorderStyleType={})); +; +OSF.DDA.Marshaling.BorderStyleType=OSF_DDA_Marshaling_BorderStyleType; + +var OSF_DDA_Marshaling_ColorType; +(function (OSF_DDA_Marshaling_ColorType) { + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["none"]=0]="none"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["black"]=1]="black"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["blue"]=2]="blue"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["gray"]=3]="gray"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["green"]=4]="green"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["orange"]=5]="orange"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["pink"]=6]="pink"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["purple"]=7]="purple"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["red"]=8]="red"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["teal"]=9]="teal"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["turquoise"]=10]="turquoise"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["violet"]=11]="violet"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["white"]=12]="white"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["yellow"]=13]="yellow"; + OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["automatic"]=14]="automatic"; +})(OSF_DDA_Marshaling_ColorType || (OSF_DDA_Marshaling_ColorType={})); +; +OSF.DDA.Marshaling.ColorType=OSF_DDA_Marshaling_ColorType; + +var OSF_DDA_Marshaling_AlignHorizontalType; +(function (OSF_DDA_Marshaling_AlignHorizontalType) { + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["general"]=0]="general"; + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["left"]=1]="left"; + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["center"]=2]="center"; + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["right"]=3]="right"; + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["fill"]=4]="fill"; + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["justify"]=5]="justify"; + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["centerAcrossSelection"]=6]="centerAcrossSelection"; + OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["distributed"]=7]="distributed"; +})(OSF_DDA_Marshaling_AlignHorizontalType || (OSF_DDA_Marshaling_AlignHorizontalType={})); +; +OSF.DDA.Marshaling.AlignHorizontalType=OSF_DDA_Marshaling_AlignHorizontalType; + +var OSF_DDA_Marshaling_AlignVerticalType; +(function (OSF_DDA_Marshaling_AlignVerticalType) { + OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["top"]=0]="top"; + OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["center"]=1]="center"; + OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["bottom"]=2]="bottom"; + OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["justify"]=3]="justify"; + OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["distributed"]=4]="distributed"; +})(OSF_DDA_Marshaling_AlignVerticalType || (OSF_DDA_Marshaling_AlignVerticalType={})); +; +OSF.DDA.Marshaling.AlignVerticalType=OSF_DDA_Marshaling_AlignVerticalType; + +var OSF_DDA_Marshaling_FontStyleType; +(function (OSF_DDA_Marshaling_FontStyleType) { + OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["regular"]=0]="regular"; + OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["italic"]=1]="italic"; + OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["bold"]=2]="bold"; + OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["boldItalic"]=3]="boldItalic"; +})(OSF_DDA_Marshaling_FontStyleType || (OSF_DDA_Marshaling_FontStyleType={})); +; +OSF.DDA.Marshaling.FontStyleType=OSF_DDA_Marshaling_FontStyleType; + +var OSF_DDA_Marshaling_FontUnderlineStyleType; +(function (OSF_DDA_Marshaling_FontUnderlineStyleType) { + OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["none"]=0]="none"; + OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["single"]=1]="single"; + OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["double"]=2]="double"; + OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["singleAccounting"]=3]="singleAccounting"; + OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["doubleAccounting"]=4]="doubleAccounting"; +})(OSF_DDA_Marshaling_FontUnderlineStyleType || (OSF_DDA_Marshaling_FontUnderlineStyleType={})); +; +OSF.DDA.Marshaling.FontUnderlineStyleType=OSF_DDA_Marshaling_FontUnderlineStyleType; + +var OSF_DDA_Marshaling_FontDirectionType; +(function (OSF_DDA_Marshaling_FontDirectionType) { + OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["context"]=0]="context"; + OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["leftToRight"]=1]="leftToRight"; + OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["rightToLeft"]=2]="rightToLeft"; +})(OSF_DDA_Marshaling_FontDirectionType || (OSF_DDA_Marshaling_FontDirectionType={})); +; +OSF.DDA.Marshaling.FontDirectionType=OSF_DDA_Marshaling_FontDirectionType; + +var OSF_DDA_Marshaling_WidthType; +(function (OSF_DDA_Marshaling_WidthType) { + OSF_DDA_Marshaling_WidthType[OSF_DDA_Marshaling_WidthType["autoFit"]=-1]="autoFit"; +})(OSF_DDA_Marshaling_WidthType || (OSF_DDA_Marshaling_WidthType={})); +; +OSF.DDA.Marshaling.WidthType=OSF_DDA_Marshaling_WidthType; + +var OSF_DDA_Marshaling_HeightType; +(function (OSF_DDA_Marshaling_HeightType) { + OSF_DDA_Marshaling_HeightType[OSF_DDA_Marshaling_HeightType["autoFit"]=-1]="autoFit"; +})(OSF_DDA_Marshaling_HeightType || (OSF_DDA_Marshaling_HeightType={})); +; +OSF.DDA.Marshaling.HeightType=OSF_DDA_Marshaling_HeightType; + +var AgaveFormatAPI; +(function (AgaveFormatAPI) { + + var alignHorizontalType=OSF.DDA.Marshaling.AlignHorizontalType; + var alignVerticalType=OSF.DDA.Marshaling.AlignVerticalType; + var borderStyleType=OSF.DDA.Marshaling.BorderStyleType; + var cellFormatProperties=OSF.DDA.Marshaling.CellFormatProperties; + var cellProperties=OSF.DDA.Marshaling.CellProperties; + var colorType=OSF.DDA.Marshaling.ColorType; + var fontDirectionType=OSF.DDA.Marshaling.FontDirectionType; + var fontStyleType=OSF.DDA.Marshaling.FontStyleType; + var fontUnderlineStyleType=OSF.DDA.Marshaling.FontUnderlineStyleType; + var heightType=OSF.DDA.Marshaling.HeightType; + var hostKeys=OSF.DDA.Marshaling.FormatKeys; + var hostParameters=Microsoft.Office.WebExtension.Parameters; + var ns=OSF.DDA.WAC.Delegate.ParameterMap; + var tableOptionProperties=OSF.DDA.Marshaling.TableOptionProperties; + var widthType=OSF.DDA.Marshaling.WidthType; + + Microsoft.Office.WebExtension.Table={ + All: 0, + Data: 1, + Headers: 2 + }; + + ns.define({ + type: OSF.DDA.WAC.UniqueArguments.ClearFormats, + toHost: [ + { name: hostParameters.Id, value: hostKeys.Id } + ] + }); + ns.define({ + type: OSF.DDA.MethodDispId.dispidClearFormatsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.ClearFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] + }); + + ns.define({ + type: OSF.DDA.WAC.UniqueArguments.SetFormats, + toHost: [ + { name: hostParameters.Id, value: hostKeys.Id }, + { name: hostParameters.CellFormat, value: hostKeys.CellFormat }, + { name: hostParameters.TableOptions, value: hostKeys.TableOptions } + ] + }); + ns.define({ + type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] + }); + ns.define({ + type: OSF.DDA.MethodDispId.dispidSetFormatsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] + }); + + ns.define({ + type: OSF.DDA.WAC.UniqueArguments.SetData, + toHost: [ + { name: hostParameters.Id, value: hostKeys.Id }, + { name: hostParameters.CoercionType, value: "CoerceType" }, + { name: hostParameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }, + { name: hostParameters.Rows, value: "Rows" }, + { name: hostParameters.Columns, value: "Columns" }, + { name: hostParameters.StartRow, value: "StartRow" }, + { name: hostParameters.StartColumn, value: "StartCol" }, + { name: hostParameters.CellFormat, value: hostKeys.CellFormat }, + { name: hostParameters.TableOptions, value: hostKeys.TableOptions } + ] + }); + ns.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] + }); + ns.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] + }); + + var formatProperties={ + alignHorizontal: { text: "alignHorizontal", type: cellFormatProperties.alignHorizontal }, + alignVertical: { text: "alignVertical", type: cellFormatProperties.alignVertical }, + backgroundColor: { text: "backgroundColor", type: cellFormatProperties.backgroundColor }, + borderStyle: { text: "borderStyle", type: cellFormatProperties.borderStyle }, + borderColor: { text: "borderColor", type: cellFormatProperties.borderColor }, + borderTopStyle: { text: "borderTopStyle", type: cellFormatProperties.borderTopStyle }, + borderTopColor: { text: "borderTopColor", type: cellFormatProperties.borderTopColor }, + borderBottomStyle: { text: "borderBottomStyle", type: cellFormatProperties.borderBottomStyle }, + borderBottomColor: { text: "borderBottomColor", type: cellFormatProperties.borderBottomColor }, + borderLeftStyle: { text: "borderLeftStyle", type: cellFormatProperties.borderLeftStyle }, + borderLeftColor: { text: "borderLeftColor", type: cellFormatProperties.borderLeftColor }, + borderRightStyle: { text: "borderRightStyle", type: cellFormatProperties.borderRightStyle }, + borderRightColor: { text: "borderRightColor", type: cellFormatProperties.borderRightColor }, + borderOutlineStyle: { text: "borderOutlineStyle", type: cellFormatProperties.borderOutlineStyle }, + borderOutlineColor: { text: "borderOutlineColor", type: cellFormatProperties.borderOutlineColor }, + borderInlineStyle: { text: "borderInlineStyle", type: cellFormatProperties.borderInlineStyle }, + borderInlineColor: { text: "borderInlineColor", type: cellFormatProperties.borderInlineColor }, + fontFamily: { text: "fontFamily", type: cellFormatProperties.fontFamily }, + fontStyle: { text: "fontStyle", type: cellFormatProperties.fontStyle }, + fontSize: { text: "fontSize", type: cellFormatProperties.fontSize }, + fontUnderlineStyle: { text: "fontUnderlineStyle", type: cellFormatProperties.fontUnderlineStyle }, + fontColor: { text: "fontColor", type: cellFormatProperties.fontColor }, + fontDirection: { text: "fontDirection", type: cellFormatProperties.fontDirection }, + fontStrikethrough: { text: "fontStrikethrough", type: cellFormatProperties.fontStrikethrough }, + fontSuperscript: { text: "fontSuperscript", type: cellFormatProperties.fontSuperscript }, + fontSubscript: { text: "fontSubscript", type: cellFormatProperties.fontSubscript }, + fontNormal: { text: "fontNormal", type: cellFormatProperties.fontNormal }, + indentLeft: { text: "indentLeft", type: cellFormatProperties.indentLeft }, + indentRight: { text: "indentRight", type: cellFormatProperties.indentRight }, + numberFormat: { text: "numberFormat", type: cellFormatProperties.numberFormat }, + width: { text: "width", type: cellFormatProperties.width }, + height: { text: "height", type: cellFormatProperties.height }, + wrapping: { text: "wrapping", type: cellFormatProperties.wrapping } + }; + + var borderStyleSet=[ + { name: "none", value: borderStyleType.none }, + { name: "thin", value: borderStyleType.thin }, + { name: "medium", value: borderStyleType.medium }, + { name: "dashed", value: borderStyleType.dashed }, + { name: "dotted", value: borderStyleType.dotted }, + { name: "thick", value: borderStyleType.thick }, + { name: "double", value: borderStyleType.double }, + { name: "hair", value: borderStyleType.hair }, + { name: "medium dashed", value: borderStyleType.mediumDashed }, + { name: "dash dot", value: borderStyleType.dashDot }, + { name: "medium dash dot", value: borderStyleType.mediumDashDot }, + { name: "dash dot dot", value: borderStyleType.dashDotDot }, + { name: "medium dash dot dot", value: borderStyleType.mediumDashDotDot }, + { name: "slant dash dot", value: borderStyleType.slantDashDot } + ]; + + var colorSet=[ + { name: "none", value: colorType.none }, + { name: "black", value: colorType.black }, + { name: "blue", value: colorType.blue }, + { name: "gray", value: colorType.gray }, + { name: "green", value: colorType.green }, + { name: "orange", value: colorType.orange }, + { name: "pink", value: colorType.pink }, + { name: "purple", value: colorType.purple }, + { name: "red", value: colorType.red }, + { name: "teal", value: colorType.teal }, + { name: "turquoise", value: colorType.turquoise }, + { name: "violet", value: colorType.violet }, + { name: "white", value: colorType.white }, + { name: "yellow", value: colorType.yellow }, + { name: "automatic", value: colorType.automatic } + ]; + ns.define({ + type: formatProperties.alignHorizontal.text, + toHost: [ + { name: "general", value: alignHorizontalType.general }, + { name: "left", value: alignHorizontalType.left }, + { name: "center", value: alignHorizontalType.center }, + { name: "right", value: alignHorizontalType.right }, + { name: "fill", value: alignHorizontalType.fill }, + { name: "justify", value: alignHorizontalType.justify }, + { name: "center across selection", value: alignHorizontalType.centerAcrossSelection }, + { name: "distributed", value: alignHorizontalType.distributed } + ] + }); + ns.define({ + type: formatProperties.alignVertical.text, + toHost: [ + { name: "top", value: alignVerticalType.top }, + { name: "center", value: alignVerticalType.center }, + { name: "bottom", value: alignVerticalType.bottom }, + { name: "justify", value: alignVerticalType.justify }, + { name: "distributed", value: alignVerticalType.distributed } + ] + }); + ns.define({ + type: formatProperties.backgroundColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderTopStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderTopColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderBottomStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderBottomColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderLeftStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderLeftColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderRightStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderRightColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderOutlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderOutlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderInlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderInlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontStyle.text, + toHost: [ + { name: "regular", value: fontStyleType.regular }, + { name: "italic", value: fontStyleType.italic }, + { name: "bold", value: fontStyleType.bold }, + { name: "bold italic", value: fontStyleType.boldItalic } + ] + }); + ns.define({ + type: formatProperties.fontUnderlineStyle.text, + toHost: [ + { name: "none", value: fontUnderlineStyleType.none }, + { name: "single", value: fontUnderlineStyleType.single }, + { name: "double", value: fontUnderlineStyleType.double }, + { name: "single accounting", value: fontUnderlineStyleType.singleAccounting }, + { name: "double accounting", value: fontUnderlineStyleType.doubleAccounting } + ] + }); + ns.define({ + type: formatProperties.fontColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontDirection.text, + toHost: [ + { name: "context", value: fontDirectionType.context }, + { name: "left-to-right", value: fontDirectionType.leftToRight }, + { name: "right-to-left", value: fontDirectionType.rightToLeft } + ] + }); + ns.define({ + type: formatProperties.width.text, + toHost: [ + { name: "auto fit", value: widthType.autoFit } + ] + }); + ns.define({ + type: formatProperties.height.text, + toHost: [ + { name: "auto fit", value: heightType.autoFit } + ] + }); + ns.define({ + type: hostParameters.TableOptions, + toHost: [ + { name: "headerRow", value: tableOptionProperties.headerRow }, + { name: "bandedRows", value: tableOptionProperties.bandedRows }, + { name: "firstColumn", value: tableOptionProperties.firstColumn }, + { name: "lastColumn", value: tableOptionProperties.lastColumn }, + { name: "bandedColumns", value: tableOptionProperties.bandedCoumns }, + { name: "filterButton", value: tableOptionProperties.filterButton }, + { name: "style", value: tableOptionProperties.style }, + { name: "totalRow", value: tableOptionProperties.totalRow } + ] + }); + ns.dynamicTypes[hostParameters.CellFormat]={ + toHost: function (data) { + for (var entry in data) { + if (data[entry].format) { + data[entry].format=ns.doMapValues(data[entry].format, "toHost"); + } + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + ns.setDynamicType(hostParameters.CellFormat, { + toHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) { + var textCells="cells"; + var textFormat="format"; + var posCells=0; + var posFormat=1; + var ret=[]; + for (var index in cellFormats) { + var cfOld=cellFormats[index]; + var cfNew=[]; + if (typeof (cfOld[textCells]) !=="undefined") { + var cellsOld=cfOld[textCells]; + var cellsNew; + if (typeof cfOld[textCells]==="object") { + cellsNew=[]; + for (var entry in cellsOld) { + if (typeof (cellProperties[entry]) !=="undefined") { + cellsNew[cellProperties[entry]]=cellsOld[entry]; + } + } + } else { + cellsNew=cellsOld; + } + cfNew[posCells]=cellsNew; + } + if (cfOld[textFormat]) { + var formatOld=cfOld[textFormat]; + var formatNew=[]; + for (var entry2 in formatOld) { + if (typeof (formatProperties[entry2]) !=="undefined") { + formatNew.push([ + formatProperties[entry2].type, + formatOld[entry2] + ]); + } + } + cfNew[posFormat]=formatNew; + } + ret[index]=cfNew; + } + return ret; + }, + fromHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) { + return hostArgs; + } + }); + ns.setDynamicType(hostParameters.TableOptions, { + toHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) { + var ret=[]; + for (var entry in tableOptions) { + if (typeof (tableOptionProperties[entry]) !="undefined") { + ret[tableOptionProperties[entry]]=tableOptions[entry]; + } + } + return ret; + }, + fromHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) { + return hostArgs; + } + }); + alignHorizontalType=null; + alignVerticalType=null; + borderStyleType=null; + cellFormatProperties=null; + colorType=null; + fontDirectionType=null; + fontStyleType=null; + fontUnderlineStyleType=null; + heightType=null; + hostKeys=null; + widthType=null; +})(AgaveFormatAPI || (AgaveFormatAPI={})); +OSF.DDA.AsyncMethodNames.addNames({ + ExecuteRichApiRequestAsync: "executeRichApiRequestAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.Data, + types: ["object"] + } + ], + supportedOptions: [] +}); +OSF.OUtil.setNamespace("RichApi", OSF.DDA); +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.ArrayData } + ], + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" }); + +var OfficeExt; +(function (OfficeExt) { + (function (AppCommand) { + var AppCommandManager=(function () { + function AppCommandManager() { + var _this=this; + this._pseudoDocument=null; + this._eventDispatch=null; + this._processAppCommandInvocation=function (args) { + var verifyResult=_this._verifyManifestCallback(args.callbackName); + if (verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + _this._invokeAppCommandCompletedMethod(args.appCommandId, verifyResult.errorCode, ""); + return; + } + var eventObj=_this._constructEventObjectForCallback(args); + if (eventObj) { + window.setTimeout(function () { + verifyResult.callback(eventObj); + }, 0); + } else { + _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError, ""); + } + }; + } + AppCommandManager.initializeOsfDda=function () { + OSF.DDA.AsyncMethodNames.addNames({ + AppCommandInvocationCompletedAsync: "appCommandInvocationCompletedAsync" + }); + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Status, + "types": ["number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string"] + } + ] + }); + + OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { + AppCommandInvokedEvent: "AppCommandInvokedEvent" + }); + OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + AppCommandInvoked: "appCommandInvoked" + }); + + OSF.OUtil.setNamespace("AppCommand", OSF.DDA); + OSF.DDA.AppCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs; + }; + + AppCommandManager.prototype.initializeAndChangeOnce=function (callback) { + AppCommand.registerDdaFacade(); + this._pseudoDocument={}; + + OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument, [ + OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync + ]); + + this._eventDispatch=new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.AppCommandInvoked + ]); + var onRegisterCompleted=function (result) { + if (callback) { + if (result.status=="succeeded") { + callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } else { + callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } + } + }; + OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument, this._eventDispatch); + this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked, this._processAppCommandInvocation, onRegisterCompleted); + }; + + AppCommandManager.prototype._verifyManifestCallback=function (callbackName) { + var defaultResult={ callback: null, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback }; + callbackName=callbackName.trim(); + try { + var callList=callbackName.split("."); + var parentObject=window; + for (var i=0; i < callList.length - 1; i++) { + if (parentObject[callList[i]] && typeof parentObject[callList[i]]=="object") { + parentObject=parentObject[callList[i]]; + } else { + return defaultResult; + } + } + var callbackFunc=parentObject[callList[callList.length - 1]]; + if (typeof callbackFunc !="function") { + return defaultResult; + } + } catch (e) { + return defaultResult; + } + return { callback: callbackFunc, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess }; + }; + + AppCommandManager.prototype._invokeAppCommandCompletedMethod=function (appCommandId, resultCode, data) { + this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId, resultCode, data); + }; + + AppCommandManager.prototype._constructEventObjectForCallback=function (args) { + var _this=this; + var eventObj=new AppCommandCallbackEventArgs(); + try { + var jsonData=JSON.parse(args.eventObjStr); + + this._translateEventObjectInternal(jsonData, eventObj); + + Object.defineProperty(eventObj, 'completed', { + value: function () { + var jsonString=JSON.stringify(eventObj); + _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, jsonString); + }, + enumerable: true + }); + } catch (e) { + eventObj=null; + } + return eventObj; + }; + + AppCommandManager.prototype._translateEventObjectInternal=function (input, output) { + for (var key in input) { + if (!input.hasOwnProperty(key)) + continue; + var inputChild=input[key]; + if (typeof inputChild=="object" && inputChild !=null) { + OSF.OUtil.defineEnumerableProperty(output, key, { + value: {} + }); + this._translateEventObjectInternal(inputChild, output[key]); + } else { + Object.defineProperty(output, key, { + value: inputChild, + enumerable: true, + writable: true + }); + } + } + }; + + AppCommandManager.prototype._constructObjectByTemplate=function (template, input) { + var output={}; + if (!template || !input) + return output; + for (var key in template) { + if (template.hasOwnProperty(key)) { + output[key]=null; + if (input[key] !=null) { + var templateChild=template[key]; + var inputChild=input[key]; + var inputChildType=typeof inputChild; + if (typeof templateChild=="object" && templateChild !=null) { + output[key]=this._constructObjectByTemplate(templateChild, inputChild); + } else if (inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean") { + output[key]=inputChild; + } + } + } + } + return output; + }; + + AppCommandManager.instance=function () { + if (AppCommandManager._instance==null) { + AppCommandManager._instance=new AppCommandManager(); + } + return AppCommandManager._instance; + }; + AppCommandManager._instance=null; + return AppCommandManager; + })(); + AppCommand.AppCommandManager=AppCommandManager; + + var AppCommandInvokedEventArgs=(function () { + function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr) { + this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked; + this.appCommandId=appCommandId; + this.callbackName=callbackName; + this.eventObjStr=eventObjStr; + } + AppCommandInvokedEventArgs.create=function (eventProperties) { + return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId], eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName], eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr]); + }; + return AppCommandInvokedEventArgs; + })(); + AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs; + + var AppCommandCallbackEventArgs=(function () { + function AppCommandCallbackEventArgs() { + } + return AppCommandCallbackEventArgs; + })(); + AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs; + + AppCommand.AppCommandInvokedEventEnums={ + AppCommandId: "appCommandId", + CallbackName: "callbackName", + EventObjStr: "eventObjStr" + }; + })(OfficeExt.AppCommand || (OfficeExt.AppCommand={})); + var AppCommand=OfficeExt.AppCommand; +})(OfficeExt || (OfficeExt={})); + +OfficeExt.AppCommand.AppCommandManager.initializeOsfDda(); +var OfficeExt; +(function (OfficeExt) { + (function (AppCommand) { + function registerDdaFacade() { + if (OSF.DDA.WAC) { + var parameterMap=OSF.DDA.WAC.Delegate.ParameterMap; + + parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Id }, + { name: Microsoft.Office.WebExtension.Parameters.Status, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Status }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Data } + ] + }); + + parameterMap.define({ + type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, value: parameterMap.self } + ] + }); + + parameterMap.addComplexType(OSF.DDA.EventDescriptors.AppCommandInvokedEvent); + parameterMap.define({ + type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, + fromHost: [ + { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.AppCommandId }, + { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.CallbackName }, + { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.EventObjStr } + ] + }); + } + } + AppCommand.registerDdaFacade=registerDdaFacade; + })(OfficeExt.AppCommand || (OfficeExt.AppCommand={})); + var AppCommand=OfficeExt.AppCommand; +})(OfficeExt || (OfficeExt={})); + +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); +OSF.OUtil.setNamespace("AppCommand", OSF.DDA.Marshaling); +var OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys; +(function (OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys) { + OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["AppCommandId"]=0]="AppCommandId"; + OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["CallbackName"]=1]="CallbackName"; + OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["EventObjStr"]=2]="EventObjStr"; +})(OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys || (OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys={})); +; +OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys=OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys; +var OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys; +(function (OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys) { + OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Id"]=0]="Id"; + OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Status"]=1]="Status"; + OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Data"]=2]="Data"; +})(OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys || (OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys={})); +; +OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys=OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys; + +OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(Microsoft.Office.WebExtension.Parameters.Data, (function () { + var tableRows="Rows"; + var tableHeaders="Headers"; + return { + toHost: function OSF_DDA_XLS_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData={}; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } else if (OSF.DDA.DataCoercion.determineCoercionType(data)==Microsoft.Office.WebExtension.CoercionType.Text) { + data=[[data]]; + } + return data; + }, + fromHost: function OSF_DDA_XLS_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs[tableRows] !=undefined) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=hostArgs[tableRows]; + ret[OSF.DDA.TableDataProperties.TableHeaders]=hostArgs[tableHeaders]; + } else { + ret=hostArgs; + } + return ret; + } + }; +})()); +OSF.DDA.ExcelDocument=function Microsoft_Office_WebExtension_ExcelDocument(officeAppContext, settings) { + var bf=new OSF.DDA.BindingFacade(this); + OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync]); + OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings); + if (this.mode==OSF.ClientMode.ReadOnly) { + this.url=document.URL; + } + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(appContext, true)); + OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]); + appReady(); +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + OSF.WebApp._UpdateLinksForHostAndXdmInfo(); + var license=new OSF.DDA.License(appContext.get_eToken()); + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license)); + var getDelegateMethods=OSF.DDA.WAC.getDelegateMethods; + var parameterMap=OSF.DDA.WAC.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); + + var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance(); + appCommandHandler.initializeAndChangeOnce(); +}; +OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { + return appContext.get_reason(); +}; + +var OfficeExtension; +(function (OfficeExtension) { + var Action=(function () { + function Action(actionInfo, isWriteOperation) { + this.m_actionInfo=actionInfo; + this.m_isWriteOperation=isWriteOperation; + } + Object.defineProperty(Action.prototype, "actionInfo", { + get: function () { + return this.m_actionInfo; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Action.prototype, "isWriteOperation", { + get: function () { + return this.m_isWriteOperation; + }, + enumerable: true, + configurable: true + }); + return Action; + })(); + OfficeExtension.Action=Action; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ActionFactory=(function () { + function ActionFactory() { + } + ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 4 , + Name: propertyName, + ObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var args=[value]; + var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args); + OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths); + var ret=new OfficeExtension.Action(actionInfo, true); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths); + return ret; + }; + ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 3 , + Name: methodName, + ObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args); + OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths); + var isWriteOperation=operationType !=1 ; + var ret=new OfficeExtension.Action(actionInfo, isWriteOperation); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths); + return ret; + }; + ActionFactory.createQueryAction=function (context, parent, queryOption) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 2 , + Name: "", + ObjectPathId: parent._objectPath.objectPathInfo.Id, + }; + actionInfo.QueryInfo=queryOption; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + return ret; + }; + ActionFactory.createInstantiateAction=function (context, obj) { + OfficeExtension.Utility.validateObjectPath(obj); + var actionInfo={ + Id: context._nextId(), + ActionType: 1 , + Name: "", + ObjectPathId: obj._objectPath.objectPathInfo.Id + }; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(obj._objectPath); + context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj)); + return ret; + }; + ActionFactory.createTraceAction=function (context, message) { + var actionInfo={ + Id: context._nextId(), + ActionType: 5 , + Name: "Trace", + ObjectPathId: 0 + }; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addTrace(actionInfo.Id, message); + return ret; + }; + return ActionFactory; + })(); + OfficeExtension.ActionFactory=ActionFactory; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientObject=(function () { + function ClientObject(context, objectPath) { + OfficeExtension.Utility.checkArgumentNull(context, "context"); + this.m_context=context; + this.m_objectPath=objectPath; + if (this.m_objectPath) { + if (!context._processingResult) { + OfficeExtension.ActionFactory.createInstantiateAction(context, this); + if ((context._autoCleanup) && (this._KeepReference)) { + context.trackedObjects._autoAdd(this); + } + } + } + } + Object.defineProperty(ClientObject.prototype, "context", { + get: function () { + return this.m_context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientObject.prototype, "_objectPath", { + get: function () { + return this.m_objectPath; + }, + set: function (value) { + this.m_objectPath=value; + }, + enumerable: true, + configurable: true + }); + ClientObject.prototype._handleResult=function (value) { + }; + return ClientObject; + })(); + OfficeExtension.ClientObject=ClientObject; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientRequest=(function () { + function ClientRequest(context) { + this.m_context=context; + this.m_actions=[]; + this.m_actionResultHandler={}; + this.m_referencedObjectPaths={}; + this.m_flags=0 ; + this.m_traceInfos={}; + } + Object.defineProperty(ClientRequest.prototype, "flags", { + get: function () { + return this.m_flags; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientRequest.prototype, "traceInfos", { + get: function () { + return this.m_traceInfos; + }, + enumerable: true, + configurable: true + }); + ClientRequest.prototype.addAction=function (action) { + if (action.isWriteOperation) { + this.m_flags=this.m_flags | 1 ; + } + this.m_actions.push(action); + }; + Object.defineProperty(ClientRequest.prototype, "hasActions", { + get: function () { + return this.m_actions.length > 0; + }, + enumerable: true, + configurable: true + }); + ClientRequest.prototype.addTrace=function (actionId, message) { + this.m_traceInfos[actionId]=message; + }; + ClientRequest.prototype.addReferencedObjectPath=function (objectPath) { + if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) { + return; + } + if (!objectPath.isValid) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath)); + } + while (objectPath) { + if (objectPath.isWriteOperation) { + this.m_flags=this.m_flags | 1 ; + } + this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath; + if (objectPath.objectPathInfo.ObjectPathType==3 ) { + this.addReferencedObjectPaths(objectPath.argumentObjectPaths); + } + objectPath=objectPath.parentObjectPath; + } + }; + ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) { + if (objectPaths) { + for (var i=0; i < objectPaths.length; i++) { + this.addReferencedObjectPath(objectPaths[i]); + } + } + }; + ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) { + this.m_actionResultHandler[action.actionInfo.Id]=resultHandler; + }; + ClientRequest.prototype.buildRequestMessageBody=function () { + var objectPaths={}; + for (var i in this.m_referencedObjectPaths) { + objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo; + } + var actions=[]; + for (var index=0; index < this.m_actions.length; index++) { + actions.push(this.m_actions[index].actionInfo); + } + var ret={ + Actions: actions, + ObjectPaths: objectPaths + }; + return ret; + }; + ClientRequest.prototype.processResponse=function (msg) { + if (msg && msg.Results) { + for (var i=0; i < msg.Results.length; i++) { + var actionResult=msg.Results[i]; + var handler=this.m_actionResultHandler[actionResult.ActionId]; + if (handler) { + handler._handleResult(actionResult.Value); + } + } + } + }; + ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () { + for (var i in this.m_referencedObjectPaths) { + if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) { + this.m_referencedObjectPaths[i].isValid=false; + } + } + }; + return ClientRequest; + })(); + OfficeExtension.ClientRequest=ClientRequest; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientRequestContext=(function () { + function ClientRequestContext(url) { + this.m_nextId=0; + this.m_url=url; + if (OfficeExtension.Utility.isNullOrEmptyString(this.m_url)) { + this.m_url=OfficeExtension.Constants.localDocument; + } + this._processingResult=false; + this._customData=OfficeExtension.Constants.iterativeExecutor; + this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor(); + this.sync=this.sync.bind(this); + } + Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", { + get: function () { + if (this.m_pendingRequest==null) { + this.m_pendingRequest=new OfficeExtension.ClientRequest(this); + } + return this.m_pendingRequest; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", { + get: function () { + if (!this.m_trackedObjects) { + this.m_trackedObjects=new OfficeExtension.TrackedObjects(this); + } + return this.m_trackedObjects; + }, + enumerable: true, + configurable: true + }); + ClientRequestContext.prototype.load=function (clientObj, option) { + OfficeExtension.Utility.validateContext(this, clientObj); + var queryOption={}; + if (typeof (option)=="string") { + var select=option; + queryOption.Select=this.parseSelectExpand(select); + } + else if (Array.isArray(option)) { + queryOption.Select=option; + } + else if (typeof (option)=="object") { + var loadOption=option; + if (typeof (loadOption.select)=="string") { + queryOption.Select=this.parseSelectExpand(loadOption.select); + } + else if (Array.isArray(loadOption.select)) { + queryOption.Select=loadOption.select; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select"); + } + if (typeof (loadOption.expand)=="string") { + queryOption.Expand=this.parseSelectExpand(loadOption.expand); + } + else if (Array.isArray(loadOption.expand)) { + queryOption.Expand=loadOption.expand; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand"); + } + if (typeof (loadOption.top)=="number") { + queryOption.Top=loadOption.top; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top"); + } + if (typeof (loadOption.skip)=="number") { + queryOption.Skip=loadOption.skip; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip"); + } + } + else if (!OfficeExtension.Utility.isNullOrUndefined(option)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option"); + } + var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption); + this._pendingRequest.addActionResultHandler(action, clientObj); + }; + ClientRequestContext.prototype.trace=function (message) { + OfficeExtension.ActionFactory.createTraceAction(this, message); + }; + ClientRequestContext.prototype.parseSelectExpand=function (select) { + var args=[]; + if (!OfficeExtension.Utility.isNullOrEmptyString(select)) { + var propertyNames=select.split(","); + for (var i=0; i < propertyNames.length; i++) { + var propertyName=propertyNames[i]; + propertyName=propertyName.trim(); + args.push(propertyName); + } + } + return args; + }; + ClientRequestContext.prototype.syncPrivate=function (doneCallback, failCallback) { + var req=this._pendingRequest; + if (!req.hasActions) { + doneCallback(); + return; + } + this.m_pendingRequest=null; + var msgBody=req.buildRequestMessageBody(); + var requestFlags=req.flags; + var requestExecutor=this._requestExecutor; + if (!requestExecutor) { + requestExecutor=new OfficeExtension.OfficeJsRequestExecutor(); + } + var requestExecutorRequestMessage={ + Url: this.m_url, + Headers: null, + Body: msgBody + }; + req.invalidatePendingInvalidObjectPaths(); + var thisObj=this; + requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage, function (response) { + var error; + var traceMessages=new Array(); + if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) { + error=new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {}); + } + else if (response.Body && response.Body.Error) { + error=new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, { + errorLocation: response.Body.Error.Location + }); + } + if (response.Body && response.Body.TraceIds) { + var traceMessageMap=req.traceInfos; + for (var i=0; i < response.Body.TraceIds.length; i++) { + var traceId=response.Body.TraceIds[i]; + var message=traceMessageMap[traceId]; + traceMessages.push(message); + } + } + if (error) { + failCallback(error); + return; + } + else { + thisObj._processingResult=true; + try { + req.processResponse(response.Body); + } + finally { + thisObj._processingResult=false; + } + doneCallback(); + return; + } + }); + }; + ClientRequestContext.prototype.sync=function (passThroughValue) { + var _this=this; + OfficeExtension._EnsurePromise(); + return new OfficeExtension['Promise'](function (resolve, reject) { + _this.syncPrivate(function () { + resolve(passThroughValue); + }, function (error) { + reject(error); + }); + }); + }; + ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) { + if (numCleanupAttempts===void 0) { numCleanupAttempts=3; } + if (retryDelay===void 0) { retryDelay=5000; } + OfficeExtension._EnsurePromise(); + var starterPromise=new OfficeExtension['Promise'](function (resolve, reject) { + resolve(); + }); + var ctx; + var succeeded=false; + var resultOrError; + return starterPromise.then(function () { + ctx=ctxInitializer(); + ctx._autoCleanup=true; + var batchResult=batch(ctx); + if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise); + } + return batchResult; + }).then(function (batchResult) { + return ctx.sync(batchResult); + }).then(function (result) { + succeeded=true; + resultOrError=result; + }).catch(function (error) { + resultOrError=error; + }).then(function () { + var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList(); + ctx._autoCleanup=false; + for (var key in itemsToRemove) { + itemsToRemove[key]._objectPath.isValid=false; + } + var cleanupCounter=0; + attemptCleanup(); + function attemptCleanup() { + cleanupCounter++; + for (var key in itemsToRemove) { + ctx.trackedObjects.remove(itemsToRemove[key]); + } + ctx.sync().then(function () { + if (onCleanupSuccess) { + onCleanupSuccess(cleanupCounter); + } + }).catch(function () { + if (onCleanupFailure) { + onCleanupFailure(cleanupCounter); + } + if (cleanupCounter < numCleanupAttempts) { + setTimeout(function () { + attemptCleanup(); + }, retryDelay); + } + }); + } + }).then(function () { + if (succeeded) { + return resultOrError; + } + else { + throw resultOrError; + } + }); + }; + ClientRequestContext.prototype._nextId=function () { + return++this.m_nextId; + }; + return ClientRequestContext; + })(); + OfficeExtension.ClientRequestContext=ClientRequestContext; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (ClientRequestFlags) { + ClientRequestFlags[ClientRequestFlags["None"]=0]="None"; + ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation"; + })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={})); + var ClientRequestFlags=OfficeExtension.ClientRequestFlags; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientResult=(function () { + function ClientResult() { + } + Object.defineProperty(ClientResult.prototype, "value", { + get: function () { + return this.m_value; + }, + enumerable: true, + configurable: true + }); + ClientResult.prototype._handleResult=function (value) { + this.m_value=value; + }; + return ClientResult; + })(); + OfficeExtension.ClientResult=ClientResult; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var Constants=(function () { + function Constants() { + } + Constants.getItemAt="GetItemAt"; + Constants.id="Id"; + Constants.idPrivate="_Id"; + Constants.index="_Index"; + Constants.items="_Items"; + Constants.iterativeExecutor="IterativeExecutor"; + Constants.localDocument="http://document.localhost/"; + Constants.localDocumentApiPrefix="http://document.localhost/_api/"; + Constants.referenceId="_ReferenceId"; + return Constants; + })(); + OfficeExtension.Constants=Constants; +})(OfficeExtension || (OfficeExtension={})); +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var OfficeExtension; +(function (OfficeExtension) { + var _Internal; + (function (_Internal) { + var RuntimeError=(function (_super) { + __extends(RuntimeError, _super); + function RuntimeError(code, message, traceMessages, debugInfo) { + _super.call(this, message); + this.name="OfficeExtension.Error"; + this.code=code; + this.message=message; + this.traceMessages=traceMessages; + this.debugInfo=debugInfo; + } + RuntimeError.prototype.toString=function () { + return this.code+': '+this.message; + }; + return RuntimeError; + })(Error); + _Internal.RuntimeError=RuntimeError; + })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={})); + OfficeExtension.Error=OfficeExtension._Internal.RuntimeError; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ErrorCodes=(function () { + function ErrorCodes() { + } + ErrorCodes.accessDenied="AccessDenied"; + ErrorCodes.generalException="GeneralException"; + ErrorCodes.activityLimitReached="ActivityLimitReached"; + return ErrorCodes; + })(); + OfficeExtension.ErrorCodes=ErrorCodes; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var InstantiateActionResultHandler=(function () { + function InstantiateActionResultHandler(clientObject) { + this.m_clientObject=clientObject; + } + InstantiateActionResultHandler.prototype._handleResult=function (value) { + OfficeExtension.Utility.fixObjectPathIfNecessary(this.m_clientObject, value); + if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this.m_clientObject._initReferenceId) { + this.m_clientObject._initReferenceId(value[OfficeExtension.Constants.referenceId]); + } + }; + return InstantiateActionResultHandler; + })(); + OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (RichApiRequestMessageIndex) { + RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags"; + })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={})); + var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex; + (function (RichApiResponseMessageIndex) { + RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode"; + RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers"; + RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body"; + })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={})); + var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex; + ; + (function (ActionType) { + ActionType[ActionType["Instantiate"]=1]="Instantiate"; + ActionType[ActionType["Query"]=2]="Query"; + ActionType[ActionType["Method"]=3]="Method"; + ActionType[ActionType["SetProperty"]=4]="SetProperty"; + ActionType[ActionType["Trace"]=5]="Trace"; + })(OfficeExtension.ActionType || (OfficeExtension.ActionType={})); + var ActionType=OfficeExtension.ActionType; + (function (ObjectPathType) { + ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject"; + ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject"; + ObjectPathType[ObjectPathType["Method"]=3]="Method"; + ObjectPathType[ObjectPathType["Property"]=4]="Property"; + ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer"; + ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId"; + })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={})); + var ObjectPathType=OfficeExtension.ObjectPathType; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ObjectPath=(function () { + function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) { + this.m_objectPathInfo=objectPathInfo; + this.m_parentObjectPath=parentObjectPath; + this.m_isWriteOperation=false; + this.m_isCollection=isCollection; + this.m_isInvalidAfterRequest=isInvalidAfterRequest; + this.m_isValid=true; + } + Object.defineProperty(ObjectPath.prototype, "objectPathInfo", { + get: function () { + return this.m_objectPathInfo; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isWriteOperation", { + get: function () { + return this.m_isWriteOperation; + }, + set: function (value) { + this.m_isWriteOperation=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isCollection", { + get: function () { + return this.m_isCollection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", { + get: function () { + return this.m_isInvalidAfterRequest; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "parentObjectPath", { + get: function () { + return this.m_parentObjectPath; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", { + get: function () { + return this.m_argumentObjectPaths; + }, + set: function (value) { + this.m_argumentObjectPaths=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isValid", { + get: function () { + return this.m_isValid; + }, + set: function (value) { + this.m_isValid=value; + }, + enumerable: true, + configurable: true + }); + ObjectPath.prototype.updateUsingObjectData=function (value) { + var referenceId=value[OfficeExtension.Constants.referenceId]; + if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) { + this.m_isInvalidAfterRequest=false; + this.m_isValid=true; + this.m_objectPathInfo.ObjectPathType=6 ; + this.m_objectPathInfo.Name=referenceId; + this.m_objectPathInfo.ArgumentInfo={}; + this.m_parentObjectPath=null; + this.m_argumentObjectPaths=null; + return; + } + if (this.parentObjectPath && this.parentObjectPath.isCollection) { + var id=value[OfficeExtension.Constants.id]; + if (OfficeExtension.Utility.isNullOrUndefined(id)) { + id=value[OfficeExtension.Constants.idPrivate]; + } + if (!OfficeExtension.Utility.isNullOrUndefined(id)) { + this.m_isInvalidAfterRequest=false; + this.m_isValid=true; + this.m_objectPathInfo.ObjectPathType=5 ; + this.m_objectPathInfo.Name=""; + this.m_objectPathInfo.ArgumentInfo={}; + this.m_objectPathInfo.ArgumentInfo.Arguments=[id]; + this.m_argumentObjectPaths=null; + return; + } + } + }; + return ObjectPath; + })(); + OfficeExtension.ObjectPath=ObjectPath; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ObjectPathFactory=(function () { + function ObjectPathFactory() { + } + ObjectPathFactory.createGlobalObjectObjectPath=function (context) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false); + }; + ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false); + }; + ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 4 , + Name: propertyName, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + }; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest); + }; + ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=args; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parentObjectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=args; + return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false); + }; + ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 3 , + Name: methodName, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args); + var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest); + ret.argumentObjectPaths=argumentObjectPaths; + ret.isWriteOperation=(operationType !=1 ); + return ret; + }; + ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) { + var id=childItem[OfficeExtension.Constants.id]; + if (OfficeExtension.Utility.isNullOrUndefined(id)) { + id=childItem[OfficeExtension.Constants.idPrivate]; + } + var objectPathInfo=objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=[id]; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) { + var indexFromServer=childItem[OfficeExtension.Constants.index]; + if (indexFromServer) { + index=indexFromServer; + } + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 3 , + Name: OfficeExtension.Constants.getItemAt, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=[index]; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createReferenceIdObjectPath=function (context, referenceId) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 6 , Name: referenceId }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false); + }; + return ObjectPathFactory; + })(); + OfficeExtension.ObjectPathFactory=ObjectPathFactory; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var OfficeJsRequestExecutor=(function () { + function OfficeJsRequestExecutor() { + } + OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage, callback) { + var requestMessageText=JSON.stringify(requestMessage.Body); + OfficeExtension.Utility.log("Request:"); + OfficeExtension.Utility.log(requestMessageText); + var messageSafearray=OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", null, requestMessageText); + OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) { + OfficeExtension.Utility.log("Response:"); + OfficeExtension.Utility.log(JSON.stringify(result)); + var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null }; + if (result.status=="succeeded") { + var bodyText=OfficeExtension.RichApiMessageUtility.getResponseBody(result); + response.Body=JSON.parse(bodyText); + response.Headers=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result); + callback(response); + } + else { + response.ErrorCode=OfficeExtension.ErrorCodes.generalException; + if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability) { + response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied; + } + else if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached) { + response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached; + } + response.ErrorMessage=result.error.message; + callback(response); + } + }); + }; + OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability=7000; + OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached=5102; + return OfficeJsRequestExecutor; + })(); + OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var OfficeXHRSettings=(function () { + function OfficeXHRSettings() { + } + return OfficeXHRSettings; + })(); + OfficeExtension.OfficeXHRSettings=OfficeXHRSettings; + function resetXHRFactory(oldFactory) { + OfficeXHR.settings.oldxhr=oldFactory; + return officeXHRFactory; + } + OfficeExtension.resetXHRFactory=resetXHRFactory; + function officeXHRFactory() { + return new OfficeXHR; + } + OfficeExtension.officeXHRFactory=officeXHRFactory; + var OfficeXHR=(function () { + function OfficeXHR() { + } + OfficeXHR.prototype.open=function (method, url) { + this.m_method=method; + this.m_url=url; + if (this.m_url.toLowerCase().indexOf(OfficeExtension.Constants.localDocumentApiPrefix)==0) { + this.m_url=this.m_url.substr(OfficeExtension.Constants.localDocumentApiPrefix.length); + } + else { + this.m_innerXhr=OfficeXHR.settings.oldxhr(); + var thisObj=this; + this.m_innerXhr.onreadystatechange=function () { + thisObj.innerXhrOnreadystatechage(); + }; + this.m_innerXhr.open(method, this.m_url); + } + }; + OfficeXHR.prototype.abort=function () { + if (this.m_innerXhr) { + this.m_innerXhr.abort(); + } + }; + OfficeXHR.prototype.send=function (body) { + if (this.m_innerXhr) { + this.m_innerXhr.send(body); + } + else { + var thisObj=this; + var requestFlags=0 ; + if (!OfficeExtension.Utility.isReadonlyRestRequest(this.m_method)) { + requestFlags=1 ; + } + var execFunction=OfficeXHR.settings.executeRichApiRequestAsync; + if (!execFunction) { + execFunction=OSF.DDA.RichApi.executeRichApiRequestAsync; + } + execFunction(OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray('', requestFlags, this.m_method, this.m_url, this.m_requestHeaders, body), function (asyncResult) { + thisObj.officeContextRequestCallback(asyncResult); + }); + } + }; + OfficeXHR.prototype.setRequestHeader=function (header, value) { + if (this.m_innerXhr) { + this.m_innerXhr.setRequestHeader(header, value); + } + else { + if (!this.m_requestHeaders) { + this.m_requestHeaders={}; + } + this.m_requestHeaders[header]=value; + } + }; + OfficeXHR.prototype.getResponseHeader=function (header) { + if (this.m_responseHeaders) { + return this.m_responseHeaders[header.toUpperCase()]; + } + return null; + }; + OfficeXHR.prototype.getAllResponseHeaders=function () { + return this.m_allResponseHeaders; + }; + OfficeXHR.prototype.overrideMimeType=function (mimeType) { + if (this.m_innerXhr) { + this.m_innerXhr.overrideMimeType(mimeType); + } + }; + OfficeXHR.prototype.innerXhrOnreadystatechage=function () { + this.readyState=this.m_innerXhr.readyState; + if (this.readyState==OfficeXHR.DONE) { + this.status=this.m_innerXhr.status; + this.statusText=this.m_innerXhr.statusText; + this.responseText=this.m_innerXhr.responseText; + this.response=this.m_innerXhr.response; + this.responseType=this.m_innerXhr.responseType; + this.setAllResponseHeaders(this.m_innerXhr.getAllResponseHeaders()); + } + if (this.onreadystatechange) { + this.onreadystatechange(); + } + }; + OfficeXHR.prototype.officeContextRequestCallback=function (result) { + this.readyState=OfficeXHR.DONE; + if (result.status=="succeeded") { + this.status=OfficeExtension.RichApiMessageUtility.getResponseStatusCode(result); + this.m_responseHeaders=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result); + console.debug("ResponseHeaders="+JSON.stringify(this.m_responseHeaders)); + this.responseText=OfficeExtension.RichApiMessageUtility.getResponseBody(result); + console.debug("ResponseText="+this.responseText); + this.response=this.responseText; + } + else { + this.status=500; + this.statusText="Internal Error"; + } + if (this.onreadystatechange) { + this.onreadystatechange(); + } + }; + OfficeXHR.prototype.setAllResponseHeaders=function (allResponseHeaders) { + this.m_allResponseHeaders=allResponseHeaders; + this.m_responseHeaders={}; + if (this.m_allResponseHeaders !=null) { + var regex=new RegExp("\r?\n"); + var entries=this.m_allResponseHeaders.split(regex); + for (var i=0; i < entries.length; i++) { + var entry=entries[i]; + if (entry !=null) { + var index=entry.indexOf(':'); + if (index > 0) { + var key=entry.substr(0, index); + var value=entry.substr(index+1); + key=OfficeExtension.Utility.trim(key); + value=OfficeExtension.Utility.trim(value); + this.m_responseHeaders[key.toUpperCase()]=value; + } + } + } + } + }; + OfficeXHR.UNSENT=0; + OfficeXHR.OPENED=1; + OfficeXHR.DONE=4; + OfficeXHR.settings=new OfficeXHRSettings(); + return OfficeXHR; + })(); + OfficeExtension.OfficeXHR=OfficeXHR; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + function _EnsurePromise() { + if (!OfficeExtension["Promise"]) { + PromiseImpl.Init(); + } + } + OfficeExtension._EnsurePromise=_EnsurePromise; + var PromiseImpl; + (function (PromiseImpl) { + function Init() { + (function () { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x==='function' || (typeof x==='object' && x !==null); + } + function lib$es6$promise$utils$$isFunction(x) { + return typeof x==='function'; + } + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x==='object' && x !==null; + } + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray=function (x) { + return Object.prototype.toString.call(x)==='[object Array]'; + }; + } + else { + lib$es6$promise$utils$$_isArray=Array.isArray; + } + var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len=0; + var lib$es6$promise$asap$$toString={}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + var lib$es6$promise$asap$$asap=function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg; + lib$es6$promise$asap$$len+=2; + if (lib$es6$promise$asap$$len===2) { + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } + else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + }; + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn=scheduleFn; + } + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap=asapFn; + } + var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]'; + var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined'; + function lib$es6$promise$asap$$useNextTick() { + var nextTick=process.nextTick; + var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/); + if (Array.isArray(version) && version[1]==='0' && version[2]==='10') { + nextTick=setImmediate; + } + return function () { + nextTick(lib$es6$promise$asap$$flush); + }; + } + function lib$es6$promise$asap$$useVertxTimer() { + return function () { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + function lib$es6$promise$asap$$useMutationObserver() { + var iterations=0; + var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node=document.createTextNode(''); + observer.observe(node, { characterData: true }); + return function () { + node.data=(iterations=++iterations % 2); + }; + } + function lib$es6$promise$asap$$useMessageChannel() { + var channel=new MessageChannel(); + channel.port1.onmessage=lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + function lib$es6$promise$asap$$useSetTimeout() { + return function () { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + var lib$es6$promise$asap$$queue=new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i=0; i < lib$es6$promise$asap$$len; i+=2) { + var callback=lib$es6$promise$asap$$queue[i]; + var arg=lib$es6$promise$asap$$queue[i+1]; + callback(arg); + lib$es6$promise$asap$$queue[i]=undefined; + lib$es6$promise$asap$$queue[i+1]=undefined; + } + lib$es6$promise$asap$$len=0; + } + function lib$es6$promise$asap$$attemptVertex() { + try { + var r=require; + var vertx=r('vertx'); + lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } + catch (e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + var lib$es6$promise$asap$$scheduleFlush; + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick(); + } + else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver(); + } + else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel(); + } + else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex(); + } + else { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout(); + } + function lib$es6$promise$$internal$$noop() { + } + var lib$es6$promise$$internal$$PENDING=void 0; + var lib$es6$promise$$internal$$FULFILLED=1; + var lib$es6$promise$$internal$$REJECTED=2; + var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject(); + function lib$es6$promise$$internal$$selfFullfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } + catch (error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error=error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } + catch (e) { + return e; + } + } + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function (promise) { + var sealed=false; + var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) { + if (sealed) { + return; + } + sealed=true; + if (thenable !==value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed=true; + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: '+(promise._label || ' unknown promise')); + if (!sealed && error) { + sealed=true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state===lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } + else if (thenable._state===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } + else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function (reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor===promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } + else { + var then=lib$es6$promise$$internal$$getThen(maybeThenable); + if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } + else if (then===undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } + else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise===value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment()); + } + else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } + else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + lib$es6$promise$$internal$$publish(promise); + } + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + return; + } + promise._result=value; + promise._state=lib$es6$promise$$internal$$FULFILLED; + if (promise._subscribers.length !==0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + return; + } + promise._state=lib$es6$promise$$internal$$REJECTED; + promise._result=reason; + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers=parent._subscribers; + var length=subscribers.length; + parent._onerror=null; + subscribers[length]=child; + subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment; + subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection; + if (length===0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + function lib$es6$promise$$internal$$publish(promise) { + var subscribers=promise._subscribers; + var settled=promise._state; + if (subscribers.length===0) { + return; + } + var child, callback, detail=promise._result; + for (var i=0; i < subscribers.length; i+=3) { + child=subscribers[i]; + callback=subscribers[i+settled]; + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } + else { + callback(detail); + } + } + promise._subscribers.length=0; + } + function lib$es6$promise$$internal$$ErrorObject() { + this.error=null; + } + var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject(); + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } + catch (e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed; + if (hasCallback) { + value=lib$es6$promise$$internal$$tryCatch(callback, detail); + if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed=true; + error=value.error; + value=null; + } + else { + succeeded=true; + } + if (promise===value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + } + else { + value=detail; + succeeded=true; + } + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + } + else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } + else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } + else if (settled===lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } + else if (settled===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + catch (e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator=this; + enumerator._instanceConstructor=Constructor; + enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop); + if (enumerator._validateInput(input)) { + enumerator._input=input; + enumerator.length=input.length; + enumerator._remaining=input.length; + enumerator._init(); + if (enumerator.length===0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + else { + enumerator.length=enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining===0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } + else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) { + return lib$es6$promise$utils$$isArray(input); + }; + lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () { + return new OfficeExtension.Error('Array Methods must be provided an Array'); + }; + lib$es6$promise$enumerator$$Enumerator.prototype._init=function () { + this._result=new Array(this.length); + }; + var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator; + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () { + var enumerator=this; + var length=enumerator.length; + var promise=enumerator.promise; + var input=enumerator._input; + for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) { + var enumerator=this; + var c=enumerator._instanceConstructor; + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) { + entry._onerror=null; + enumerator._settledAt(entry._state, i, entry._result); + } + else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } + else { + enumerator._remaining--; + enumerator._result[i]=entry; + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) { + var enumerator=this; + var promise=enumerator.promise; + if (promise._state===lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + if (state===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + else { + enumerator._result[i]=value; + } + } + if (enumerator._remaining===0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) { + var enumerator=this; + lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function (reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + var Constructor=this; + var promise=new Constructor(lib$es6$promise$$internal$$noop); + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + var length=entries.length; + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + return promise; + } + var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + var Constructor=this; + if (object && typeof object==='object' && object.constructor===Constructor) { + return object; + } + var promise=new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + var Constructor=this; + var promise=new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject; + var lib$es6$promise$promise$$counter=0; + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise; + function lib$es6$promise$promise$$Promise(resolver) { + this._id=lib$es6$promise$promise$$counter++; + this._state=undefined; + this._result=undefined; + this._subscribers=[]; + if (lib$es6$promise$$internal$$noop !==resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap; + lib$es6$promise$promise$$Promise.prototype={ + constructor: lib$es6$promise$promise$$Promise, + then: function (onFulfillment, onRejection) { + var parent=this; + var state=parent._state; + if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + var child=new this.constructor(lib$es6$promise$$internal$$noop); + var result=parent._result; + if (state) { + var callback=arguments[state - 1]; + lib$es6$promise$asap$$asap(function () { + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } + else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + return child; + }, + 'catch': function (onRejection) { + return this.then(null, onRejection); + } + }; + OfficeExtension["Promise"]=lib$es6$promise$promise$$default; + }).call(this); + } + PromiseImpl.Init=Init; + })(PromiseImpl || (PromiseImpl={})); +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (OperationType) { + OperationType[OperationType["Default"]=0]="Default"; + OperationType[OperationType["Read"]=1]="Read"; + })(OfficeExtension.OperationType || (OfficeExtension.OperationType={})); + var OperationType=OfficeExtension.OperationType; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var TrackedObjects=(function () { + function TrackedObjects(context) { + this._autoCleanupList={}; + this.m_context=context; + } + TrackedObjects.prototype.add=function (param) { + var _this=this; + if (Array.isArray(param)) { + param.forEach(function (item) { return _this._addCommon(item, true); }); + } + else { + this._addCommon(param, true); + } + }; + TrackedObjects.prototype._autoAdd=function (object) { + this._addCommon(object, false); + this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object; + }; + TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) { + var referenceId=object[OfficeExtension.Constants.referenceId]; + if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) { + object._KeepReference(); + OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object); + if (isExplicitlyAdded && this.m_context._autoCleanup) { + delete this._autoCleanupList[object._objectPath.objectPathInfo.Id]; + } + } + }; + TrackedObjects.prototype.remove=function (param) { + var _this=this; + if (Array.isArray(param)) { + param.forEach(function (item) { return _this._removeCommon(item); }); + } + else { + this._removeCommon(param); + } + }; + TrackedObjects.prototype._removeCommon=function (object) { + var referenceId=object[OfficeExtension.Constants.referenceId]; + if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) { + var rootObject=this.m_context._rootObject; + if (rootObject._RemoveReference) { + rootObject._RemoveReference(referenceId); + } + } + }; + TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () { + var list=this._autoCleanupList; + this._autoCleanupList={}; + return list; + }; + return TrackedObjects; + })(); + OfficeExtension.TrackedObjects=TrackedObjects; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ResourceStrings=(function () { + function ResourceStrings() { + } + ResourceStrings.invalidObjectPath="InvalidObjectPath"; + ResourceStrings.propertyNotLoaded="PropertyNotLoaded"; + ResourceStrings.invalidRequestContext="InvalidRequestContext"; + ResourceStrings.invalidArgument="InvalidArgument"; + ResourceStrings.runMustReturnPromise="RunMustReturnPromise"; + return ResourceStrings; + })(); + OfficeExtension.ResourceStrings=ResourceStrings; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var RichApiMessageUtility=(function () { + function RichApiMessageUtility() { + } + RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) { + var headerArray=[]; + if (headers) { + for (var headerName in headers) { + headerArray.push(headerName); + headerArray.push(headers[headerName]); + } + } + var appPermission=0; + var solutionId=""; + var instanceId=""; + var marketplaceType=""; + return [ + customData, + method, + path, + headerArray, + body, + appPermission, + requestFlags, + solutionId, + instanceId, + marketplaceType + ]; + }; + RichApiMessageUtility.getResponseBody=function (result) { + return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseHeaders=function (result) { + return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) { + var ret=data[2 ]; + if (typeof (ret)==="string") { + return ret; + } + var arr=ret; + return arr.join(""); + }; + RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) { + var arrayHeader=data[1 ]; + if (!arrayHeader) { + return null; + } + var headers={}; + for (var i=0; i < arrayHeader.length - 1; i+=2) { + headers[arrayHeader[i]]=arrayHeader[i+1]; + } + return headers; + }; + RichApiMessageUtility.getResponseStatusCode=function (result) { + return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) { + return data[0 ]; + }; + return RichApiMessageUtility; + })(); + OfficeExtension.RichApiMessageUtility=RichApiMessageUtility; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var Utility=(function () { + function Utility() { + } + Utility.checkArgumentNull=function (value, name) { + }; + Utility.isNullOrUndefined=function (value) { + if (value===null) { + return true; + } + if (typeof (value)==="undefined") { + return true; + } + return false; + }; + Utility.isUndefined=function (value) { + if (typeof (value)==="undefined") { + return true; + } + return false; + }; + Utility.isNullOrEmptyString=function (value) { + if (value===null) { + return true; + } + if (typeof (value)==="undefined") { + return true; + } + if (value.length==0) { + return true; + } + return false; + }; + Utility.trim=function (str) { + return str.replace(new RegExp("^\\s+|\\s+$", "g"), ""); + }; + Utility.caseInsensitiveCompareString=function (str1, str2) { + if (Utility.isNullOrUndefined(str1)) { + return Utility.isNullOrUndefined(str2); + } + else { + if (Utility.isNullOrUndefined(str2)) { + return false; + } + else { + return str1.toUpperCase()==str2.toUpperCase(); + } + } + }; + Utility.isReadonlyRestRequest=function (method) { + return Utility.caseInsensitiveCompareString(method, "GET"); + }; + Utility.setMethodArguments=function (context, argumentInfo, args) { + if (Utility.isNullOrUndefined(args)) { + return null; + } + var referencedObjectPaths=new Array(); + var referencedObjectPathIds=new Array(); + var hasOne=false; + for (var i=0; i < args.length; i++) { + if (args[i] instanceof OfficeExtension.ClientObject) { + var clientObject=args[i]; + Utility.validateContext(context, clientObject); + args[i]=clientObject._objectPath.objectPathInfo.Id; + referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id); + referencedObjectPaths.push(clientObject._objectPath); + hasOne=true; + } + else { + referencedObjectPathIds.push(0); + } + } + argumentInfo.Arguments=args; + if (hasOne) { + argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds; + return referencedObjectPaths; + } + return null; + }; + Utility.fixObjectPathIfNecessary=function (clientObject, value) { + if (clientObject && clientObject._objectPath && value) { + clientObject._objectPath.updateUsingObjectData(value); + } + }; + Utility.validateObjectPath=function (clientObject) { + var objectPath=clientObject._objectPath; + while (objectPath) { + if (!objectPath.isValid) { + var pathExpression=Utility.getObjectPathExpression(objectPath); + Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression); + } + objectPath=objectPath.parentObjectPath; + } + }; + Utility.validateReferencedObjectPaths=function (objectPaths) { + if (objectPaths) { + for (var i=0; i < objectPaths.length; i++) { + var objectPath=objectPaths[i]; + while (objectPath) { + if (!objectPath.isValid) { + var pathExpression=Utility.getObjectPathExpression(objectPath); + Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression); + } + objectPath=objectPath.parentObjectPath; + } + } + } + }; + Utility.validateContext=function (context, obj) { + if (obj && obj.context !==context) { + Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext); + } + }; + Utility.log=function (message) { + if (Utility._logEnabled && window.console && window.console.log) { + window.console.log(message); + } + }; + Utility.load=function (clientObj, option) { + clientObj.context.load(clientObj, option); + }; + Utility.throwError=function (resourceId, arg) { + throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), {}); + }; + Utility.createRuntimeError=function (code, message, location) { + return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location }); + }; + Utility._getResourceString=function (resourceId, arg) { + var ret=resourceId; + if (window.Strings && window.Strings.OfficeOM) { + var stringName="L_"+resourceId; + var stringValue=window.Strings.OfficeOM[stringName]; + if (stringValue) { + ret=stringValue; + } + } + if (!Utility.isNullOrUndefined(arg)) { + ret=ret.replace("{0}", arg); + } + return ret; + }; + Utility.throwIfNotLoaded=function (propertyName, fieldValue) { + if (Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) { + Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName); + } + }; + Utility.getObjectPathExpression=function (objectPath) { + var ret=""; + while (objectPath) { + switch (objectPath.objectPathInfo.ObjectPathType) { + case 1 : + ret=ret; + break; + case 2 : + ret="new()"+(ret.length > 0 ? "." : "")+ret; + break; + case 3 : + ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret; + break; + case 4 : + ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret; + break; + case 5 : + ret="getItem()"+(ret.length > 0 ? "." : "")+ret; + break; + case 6 : + ret="_reference()"+(ret.length > 0 ? "." : "")+ret; + break; + } + objectPath=objectPath.parentObjectPath; + } + return ret; + }; + Utility._createPromiseFromResult=function (value) { + OfficeExtension._EnsurePromise(); + return new OfficeExtension['Promise'](function (resolve, reject) { + resolve(value); + }); + }; + Utility._addActionResultHandler=function (clientObj, action, resultHandler) { + clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler); + }; + Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) { + for (var i=0; i < propertyNames.length - 1; i+=2) { + if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) { + clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]); + } + } + }; + Utility.normalizeName=function (name) { + return name.substr(0, 1).toLowerCase()+name.substr(1); + }; + Utility._logEnabled=false; + Utility.s_underscoreCharCode="_".charCodeAt(0); + return Utility; + })(); + OfficeExtension.Utility=Utility; +})(OfficeExtension || (OfficeExtension={})); + +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var Excel; +(function (Excel) { + var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath; + var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath; + var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath; + var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath; + var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer; + var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt; + var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction; + var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction; + var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined; + var _isUndefined=OfficeExtension.Utility.isUndefined; + var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded; + var _load=OfficeExtension.Utility.load; + var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary; + var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler; + var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults; + var Application=(function (_super) { + __extends(Application, _super); + function Application() { + _super.apply(this, arguments); + } + Object.defineProperty(Application.prototype, "calculationMode", { + get: function () { + _throwIfNotLoaded("calculationMode", this.m_calculationMode); + return this.m_calculationMode; + }, + enumerable: true, + configurable: true + }); + Application.prototype.calculate=function (calculationType) { + _createMethodAction(this.context, this, "Calculate", 0 , [calculationType]); + }; + Application.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["CalculationMode"])) { + this.m_calculationMode=obj["CalculationMode"]; + } + }; + Application.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Application; + })(OfficeExtension.ClientObject); + Excel.Application=Application; + var Workbook=(function (_super) { + __extends(Workbook, _super); + function Workbook() { + _super.apply(this, arguments); + } + Object.defineProperty(Workbook.prototype, "application", { + get: function () { + if (!this.m_application) { + this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false)); + } + return this.m_application; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "bindings", { + get: function () { + if (!this.m_bindings) { + this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false)); + } + return this.m_bindings; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "names", { + get: function () { + if (!this.m_names) { + this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false)); + } + return this.m_names; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "tables", { + get: function () { + if (!this.m_tables) { + this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false)); + } + return this.m_tables; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "worksheets", { + get: function () { + if (!this.m_worksheets) { + this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false)); + } + return this.m_worksheets; + }, + enumerable: true, + configurable: true + }); + Workbook.prototype.getSelectedRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", 1 , [], false, true)); + }; + Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) { + var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", 1 , [bstrReferenceId]); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) { + var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", 1 , [bstrReferenceId]); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Workbook.prototype._GetReferenceCount=function () { + var action=_createMethodAction(this.context, this, "_GetReferenceCount", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Workbook.prototype._RemoveAllReferences=function () { + _createMethodAction(this.context, this, "_RemoveAllReferences", 1 , []); + }; + Workbook.prototype._RemoveReference=function (bstrReferenceId) { + _createMethodAction(this.context, this, "_RemoveReference", 1 , [bstrReferenceId]); + }; + Workbook.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "names", "Names", "tables", "Tables", "worksheets", "Worksheets"]); + }; + Workbook.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Workbook; + })(OfficeExtension.ClientObject); + Excel.Workbook=Workbook; + var Worksheet=(function (_super) { + __extends(Worksheet, _super); + function Worksheet() { + _super.apply(this, arguments); + } + Object.defineProperty(Worksheet.prototype, "charts", { + get: function () { + if (!this.m_charts) { + this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false)); + } + return this.m_charts; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "tables", { + get: function () { + if (!this.m_tables) { + this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false)); + } + return this.m_tables; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "position", { + get: function () { + _throwIfNotLoaded("position", this.m_position); + return this.m_position; + }, + set: function (value) { + this.m_position=value; + _createSetPropertyAction(this.context, this, "Position", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "visibility", { + get: function () { + _throwIfNotLoaded("visibility", this.m_visibility); + return this.m_visibility; + }, + enumerable: true, + configurable: true + }); + Worksheet.prototype.activate=function () { + _createMethodAction(this.context, this, "Activate", 1 , []); + }; + Worksheet.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Worksheet.prototype.getCell=function (row, column) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", 1 , [row, column], false, true)); + }; + Worksheet.prototype.getRange=function (address) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [address], false, true)); + }; + Worksheet.prototype.getUsedRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", 1 , [], false, true)); + }; + Worksheet.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Position"])) { + this.m_position=obj["Position"]; + } + if (!_isUndefined(obj["Visibility"])) { + this.m_visibility=obj["Visibility"]; + } + _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "tables", "Tables"]); + }; + Worksheet.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Worksheet; + })(OfficeExtension.ClientObject); + Excel.Worksheet=Worksheet; + var WorksheetCollection=(function (_super) { + __extends(WorksheetCollection, _super); + function WorksheetCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(WorksheetCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + WorksheetCollection.prototype.add=function (name) { + return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [name], false, true)); + }; + WorksheetCollection.prototype.getActiveWorksheet=function () { + return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", 1 , [], false, false)); + }; + WorksheetCollection.prototype.getItem=function (key) { + return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key])); + }; + WorksheetCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + WorksheetCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return WorksheetCollection; + })(OfficeExtension.ClientObject); + Excel.WorksheetCollection=WorksheetCollection; + var Range=(function (_super) { + __extends(Range, _super); + function Range() { + _super.apply(this, arguments); + } + Object.defineProperty(Range.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "worksheet", { + get: function () { + if (!this.m_worksheet) { + this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false)); + } + return this.m_worksheet; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "address", { + get: function () { + _throwIfNotLoaded("address", this.m_address); + return this.m_address; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "addressLocal", { + get: function () { + _throwIfNotLoaded("addressLocal", this.m_addressLocal); + return this.m_addressLocal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "cellCount", { + get: function () { + _throwIfNotLoaded("cellCount", this.m_cellCount); + return this.m_cellCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "columnCount", { + get: function () { + _throwIfNotLoaded("columnCount", this.m_columnCount); + return this.m_columnCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "columnIndex", { + get: function () { + _throwIfNotLoaded("columnIndex", this.m_columnIndex); + return this.m_columnIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "formulas", { + get: function () { + _throwIfNotLoaded("formulas", this.m_formulas); + return this.m_formulas; + }, + set: function (value) { + this.m_formulas=value; + _createSetPropertyAction(this.context, this, "Formulas", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "formulasLocal", { + get: function () { + _throwIfNotLoaded("formulasLocal", this.m_formulasLocal); + return this.m_formulasLocal; + }, + set: function (value) { + this.m_formulasLocal=value; + _createSetPropertyAction(this.context, this, "FormulasLocal", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "numberFormat", { + get: function () { + _throwIfNotLoaded("numberFormat", this.m_numberFormat); + return this.m_numberFormat; + }, + set: function (value) { + this.m_numberFormat=value; + _createSetPropertyAction(this.context, this, "NumberFormat", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "rowCount", { + get: function () { + _throwIfNotLoaded("rowCount", this.m_rowCount); + return this.m_rowCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "rowIndex", { + get: function () { + _throwIfNotLoaded("rowIndex", this.m_rowIndex); + return this.m_rowIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "valueTypes", { + get: function () { + _throwIfNotLoaded("valueTypes", this.m_valueTypes); + return this.m_valueTypes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "values", { + get: function () { + _throwIfNotLoaded("values", this.m_values); + return this.m_values; + }, + set: function (value) { + this.m_values=value; + _createSetPropertyAction(this.context, this, "Values", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + Range.prototype.clear=function (applyTo) { + _createMethodAction(this.context, this, "Clear", 0 , [applyTo]); + }; + Range.prototype.delete=function (shift) { + _createMethodAction(this.context, this, "Delete", 0 , [shift]); + }; + Range.prototype.getBoundingRect=function (anotherRange) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", 1 , [anotherRange], false, true)); + }; + Range.prototype.getCell=function (row, column) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", 1 , [row, column], false, true)); + }; + Range.prototype.getColumn=function (column) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", 1 , [column], false, true)); + }; + Range.prototype.getEntireColumn=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", 1 , [], false, true)); + }; + Range.prototype.getEntireRow=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", 1 , [], false, true)); + }; + Range.prototype.getIntersection=function (anotherRange) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", 1 , [anotherRange], false, true)); + }; + Range.prototype.getLastCell=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", 1 , [], false, true)); + }; + Range.prototype.getLastColumn=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", 1 , [], false, true)); + }; + Range.prototype.getLastRow=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", 1 , [], false, true)); + }; + Range.prototype.getOffsetRange=function (rowOffset, columnOffset) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", 1 , [rowOffset, columnOffset], false, true)); + }; + Range.prototype.getRow=function (row) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", 1 , [row], false, true)); + }; + Range.prototype.getUsedRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", 1 , [], false, true)); + }; + Range.prototype.insert=function (shift) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", 0 , [shift], false, true)); + }; + Range.prototype.select=function () { + _createMethodAction(this.context, this, "Select", 1 , []); + }; + Range.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + Range.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Address"])) { + this.m_address=obj["Address"]; + } + if (!_isUndefined(obj["AddressLocal"])) { + this.m_addressLocal=obj["AddressLocal"]; + } + if (!_isUndefined(obj["CellCount"])) { + this.m_cellCount=obj["CellCount"]; + } + if (!_isUndefined(obj["ColumnCount"])) { + this.m_columnCount=obj["ColumnCount"]; + } + if (!_isUndefined(obj["ColumnIndex"])) { + this.m_columnIndex=obj["ColumnIndex"]; + } + if (!_isUndefined(obj["Formulas"])) { + this.m_formulas=obj["Formulas"]; + } + if (!_isUndefined(obj["FormulasLocal"])) { + this.m_formulasLocal=obj["FormulasLocal"]; + } + if (!_isUndefined(obj["NumberFormat"])) { + this.m_numberFormat=obj["NumberFormat"]; + } + if (!_isUndefined(obj["RowCount"])) { + this.m_rowCount=obj["RowCount"]; + } + if (!_isUndefined(obj["RowIndex"])) { + this.m_rowIndex=obj["RowIndex"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["ValueTypes"])) { + this.m_valueTypes=obj["ValueTypes"]; + } + if (!_isUndefined(obj["Values"])) { + this.m_values=obj["Values"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format", "worksheet", "Worksheet"]); + }; + Range.prototype.load=function (option) { + _load(this, option); + return this; + }; + Range.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return Range; + })(OfficeExtension.ClientObject); + Excel.Range=Range; + var NamedItemCollection=(function (_super) { + __extends(NamedItemCollection, _super); + function NamedItemCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(NamedItemCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + NamedItemCollection.prototype.getItem=function (name) { + return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name])); + }; + NamedItemCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + NamedItemCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return NamedItemCollection; + })(OfficeExtension.ClientObject); + Excel.NamedItemCollection=NamedItemCollection; + var NamedItem=(function (_super) { + __extends(NamedItem, _super); + function NamedItem() { + _super.apply(this, arguments); + } + Object.defineProperty(NamedItem.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "type", { + get: function () { + _throwIfNotLoaded("type", this.m_type); + return this.m_type; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "value", { + get: function () { + _throwIfNotLoaded("value", this.m_value); + return this.m_value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + NamedItem.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + NamedItem.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Type"])) { + this.m_type=obj["Type"]; + } + if (!_isUndefined(obj["Value"])) { + this.m_value=obj["Value"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + }; + NamedItem.prototype.load=function (option) { + _load(this, option); + return this; + }; + return NamedItem; + })(OfficeExtension.ClientObject); + Excel.NamedItem=NamedItem; + var Binding=(function (_super) { + __extends(Binding, _super); + function Binding() { + _super.apply(this, arguments); + } + Object.defineProperty(Binding.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "type", { + get: function () { + _throwIfNotLoaded("type", this.m_type); + return this.m_type; + }, + enumerable: true, + configurable: true + }); + Binding.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, false)); + }; + Binding.prototype.getTable=function () { + return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", 1 , [], false, false)); + }; + Binding.prototype.getText=function () { + var action=_createMethodAction(this.context, this, "GetText", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Binding.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Type"])) { + this.m_type=obj["Type"]; + } + }; + Binding.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Binding; + })(OfficeExtension.ClientObject); + Excel.Binding=Binding; + var BindingCollection=(function (_super) { + __extends(BindingCollection, _super); + function BindingCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(BindingCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BindingCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + BindingCollection.prototype.getItem=function (id) { + return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id])); + }; + BindingCollection.prototype.getItemAt=function (index) { + return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + BindingCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + BindingCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return BindingCollection; + })(OfficeExtension.ClientObject); + Excel.BindingCollection=BindingCollection; + var TableCollection=(function (_super) { + __extends(TableCollection, _super); + function TableCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(TableCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + TableCollection.prototype.add=function (address, hasHeaders) { + return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [address, hasHeaders], false, true)); + }; + TableCollection.prototype.getItem=function (key) { + return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key])); + }; + TableCollection.prototype.getItemAt=function (index) { + return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + TableCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + TableCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableCollection; + })(OfficeExtension.ClientObject); + Excel.TableCollection=TableCollection; + var Table=(function (_super) { + __extends(Table, _super); + function Table() { + _super.apply(this, arguments); + } + Object.defineProperty(Table.prototype, "columns", { + get: function () { + if (!this.m_columns) { + this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false)); + } + return this.m_columns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "rows", { + get: function () { + if (!this.m_rows) { + this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false)); + } + return this.m_rows; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "showHeaders", { + get: function () { + _throwIfNotLoaded("showHeaders", this.m_showHeaders); + return this.m_showHeaders; + }, + set: function (value) { + this.m_showHeaders=value; + _createSetPropertyAction(this.context, this, "ShowHeaders", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "showTotals", { + get: function () { + _throwIfNotLoaded("showTotals", this.m_showTotals); + return this.m_showTotals; + }, + set: function (value) { + this.m_showTotals=value; + _createSetPropertyAction(this.context, this, "ShowTotals", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Table.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Table.prototype.getDataBodyRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", 1 , [], false, true)); + }; + Table.prototype.getHeaderRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", 1 , [], false, true)); + }; + Table.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + Table.prototype.getTotalRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", 1 , [], false, true)); + }; + Table.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["ShowHeaders"])) { + this.m_showHeaders=obj["ShowHeaders"]; + } + if (!_isUndefined(obj["ShowTotals"])) { + this.m_showTotals=obj["ShowTotals"]; + } + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows"]); + }; + Table.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Table; + })(OfficeExtension.ClientObject); + Excel.Table=Table; + var TableColumnCollection=(function (_super) { + __extends(TableColumnCollection, _super); + function TableColumnCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(TableColumnCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumnCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + TableColumnCollection.prototype.add=function (index, values) { + return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [index, values], false, true)); + }; + TableColumnCollection.prototype.getItem=function (key) { + return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key])); + }; + TableColumnCollection.prototype.getItemAt=function (index) { + return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + TableColumnCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + TableColumnCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableColumnCollection; + })(OfficeExtension.ClientObject); + Excel.TableColumnCollection=TableColumnCollection; + var TableColumn=(function (_super) { + __extends(TableColumn, _super); + function TableColumn() { + _super.apply(this, arguments); + } + Object.defineProperty(TableColumn.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumn.prototype, "index", { + get: function () { + _throwIfNotLoaded("index", this.m_index); + return this.m_index; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumn.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumn.prototype, "values", { + get: function () { + _throwIfNotLoaded("values", this.m_values); + return this.m_values; + }, + set: function (value) { + this.m_values=value; + _createSetPropertyAction(this.context, this, "Values", value); + }, + enumerable: true, + configurable: true + }); + TableColumn.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + TableColumn.prototype.getDataBodyRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", 1 , [], false, true)); + }; + TableColumn.prototype.getHeaderRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", 1 , [], false, true)); + }; + TableColumn.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + TableColumn.prototype.getTotalRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", 1 , [], false, true)); + }; + TableColumn.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Index"])) { + this.m_index=obj["Index"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Values"])) { + this.m_values=obj["Values"]; + } + }; + TableColumn.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableColumn; + })(OfficeExtension.ClientObject); + Excel.TableColumn=TableColumn; + var TableRowCollection=(function (_super) { + __extends(TableRowCollection, _super); + function TableRowCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(TableRowCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableRowCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + TableRowCollection.prototype.add=function (index, values) { + return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [index, values], false, true)); + }; + TableRowCollection.prototype.getItemAt=function (index) { + return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + TableRowCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + TableRowCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableRowCollection; + })(OfficeExtension.ClientObject); + Excel.TableRowCollection=TableRowCollection; + var TableRow=(function (_super) { + __extends(TableRow, _super); + function TableRow() { + _super.apply(this, arguments); + } + Object.defineProperty(TableRow.prototype, "index", { + get: function () { + _throwIfNotLoaded("index", this.m_index); + return this.m_index; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableRow.prototype, "values", { + get: function () { + _throwIfNotLoaded("values", this.m_values); + return this.m_values; + }, + set: function (value) { + this.m_values=value; + _createSetPropertyAction(this.context, this, "Values", value); + }, + enumerable: true, + configurable: true + }); + TableRow.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + TableRow.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + TableRow.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Index"])) { + this.m_index=obj["Index"]; + } + if (!_isUndefined(obj["Values"])) { + this.m_values=obj["Values"]; + } + }; + TableRow.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableRow; + })(OfficeExtension.ClientObject); + Excel.TableRow=TableRow; + var RangeFormat=(function (_super) { + __extends(RangeFormat, _super); + function RangeFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeFormat.prototype, "borders", { + get: function () { + if (!this.m_borders) { + this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false)); + } + return this.m_borders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", { + get: function () { + _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment); + return this.m_horizontalAlignment; + }, + set: function (value) { + this.m_horizontalAlignment=value; + _createSetPropertyAction(this.context, this, "HorizontalAlignment", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "verticalAlignment", { + get: function () { + _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment); + return this.m_verticalAlignment; + }, + set: function (value) { + this.m_verticalAlignment=value; + _createSetPropertyAction(this.context, this, "VerticalAlignment", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "wrapText", { + get: function () { + _throwIfNotLoaded("wrapText", this.m_wrapText); + return this.m_wrapText; + }, + set: function (value) { + this.m_wrapText=value; + _createSetPropertyAction(this.context, this, "WrapText", value); + }, + enumerable: true, + configurable: true + }); + RangeFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["HorizontalAlignment"])) { + this.m_horizontalAlignment=obj["HorizontalAlignment"]; + } + if (!_isUndefined(obj["VerticalAlignment"])) { + this.m_verticalAlignment=obj["VerticalAlignment"]; + } + if (!_isUndefined(obj["WrapText"])) { + this.m_wrapText=obj["WrapText"]; + } + _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font"]); + }; + RangeFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeFormat; + })(OfficeExtension.ClientObject); + Excel.RangeFormat=RangeFormat; + var RangeFill=(function (_super) { + __extends(RangeFill, _super); + function RangeFill() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeFill.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + RangeFill.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + RangeFill.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + }; + RangeFill.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeFill; + })(OfficeExtension.ClientObject); + Excel.RangeFill=RangeFill; + var RangeBorder=(function (_super) { + __extends(RangeBorder, _super); + function RangeBorder() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeBorder.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorder.prototype, "sideIndex", { + get: function () { + _throwIfNotLoaded("sideIndex", this.m_sideIndex); + return this.m_sideIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorder.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorder.prototype, "weight", { + get: function () { + _throwIfNotLoaded("weight", this.m_weight); + return this.m_weight; + }, + set: function (value) { + this.m_weight=value; + _createSetPropertyAction(this.context, this, "Weight", value); + }, + enumerable: true, + configurable: true + }); + RangeBorder.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["SideIndex"])) { + this.m_sideIndex=obj["SideIndex"]; + } + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + if (!_isUndefined(obj["Weight"])) { + this.m_weight=obj["Weight"]; + } + }; + RangeBorder.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeBorder; + })(OfficeExtension.ClientObject); + Excel.RangeBorder=RangeBorder; + var RangeBorderCollection=(function (_super) { + __extends(RangeBorderCollection, _super); + function RangeBorderCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeBorderCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorderCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + RangeBorderCollection.prototype.getItem=function (index) { + return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index])); + }; + RangeBorderCollection.prototype.getItemAt=function (index) { + return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + RangeBorderCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + RangeBorderCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeBorderCollection; + })(OfficeExtension.ClientObject); + Excel.RangeBorderCollection=RangeBorderCollection; + var RangeFont=(function (_super) { + __extends(RangeFont, _super); + function RangeFont() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeFont.prototype, "bold", { + get: function () { + _throwIfNotLoaded("bold", this.m_bold); + return this.m_bold; + }, + set: function (value) { + this.m_bold=value; + _createSetPropertyAction(this.context, this, "Bold", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "italic", { + get: function () { + _throwIfNotLoaded("italic", this.m_italic); + return this.m_italic; + }, + set: function (value) { + this.m_italic=value; + _createSetPropertyAction(this.context, this, "Italic", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "size", { + get: function () { + _throwIfNotLoaded("size", this.m_size); + return this.m_size; + }, + set: function (value) { + this.m_size=value; + _createSetPropertyAction(this.context, this, "Size", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "underline", { + get: function () { + _throwIfNotLoaded("underline", this.m_underline); + return this.m_underline; + }, + set: function (value) { + this.m_underline=value; + _createSetPropertyAction(this.context, this, "Underline", value); + }, + enumerable: true, + configurable: true + }); + RangeFont.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Bold"])) { + this.m_bold=obj["Bold"]; + } + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["Italic"])) { + this.m_italic=obj["Italic"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Size"])) { + this.m_size=obj["Size"]; + } + if (!_isUndefined(obj["Underline"])) { + this.m_underline=obj["Underline"]; + } + }; + RangeFont.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeFont; + })(OfficeExtension.ClientObject); + Excel.RangeFont=RangeFont; + var ChartCollection=(function (_super) { + __extends(ChartCollection, _super); + function ChartCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + ChartCollection.prototype.add=function (type, sourceData, seriesBy) { + if (!(sourceData instanceof Range)) { + throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add"); + } + return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [type, sourceData, seriesBy], false, true)); + }; + ChartCollection.prototype.getItem=function (name) { + return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", 1 , [name], false, false)); + }; + ChartCollection.prototype.getItemAt=function (index) { + return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + ChartCollection.prototype._GetItem=function (id) { + return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [id])); + }; + ChartCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ChartCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartCollection; + })(OfficeExtension.ClientObject); + Excel.ChartCollection=ChartCollection; + var Chart=(function (_super) { + __extends(Chart, _super); + function Chart() { + _super.apply(this, arguments); + } + Object.defineProperty(Chart.prototype, "axes", { + get: function () { + if (!this.m_axes) { + this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false)); + } + return this.m_axes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "dataLabels", { + get: function () { + if (!this.m_dataLabels) { + this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false)); + } + return this.m_dataLabels; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "legend", { + get: function () { + if (!this.m_legend) { + this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false)); + } + return this.m_legend; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "series", { + get: function () { + if (!this.m_series) { + this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false)); + } + return this.m_series; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "title", { + get: function () { + if (!this.m_title) { + this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false)); + } + return this.m_title; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "height", { + get: function () { + _throwIfNotLoaded("height", this.m_height); + return this.m_height; + }, + set: function (value) { + this.m_height=value; + _createSetPropertyAction(this.context, this, "Height", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "left", { + get: function () { + _throwIfNotLoaded("left", this.m_left); + return this.m_left; + }, + set: function (value) { + this.m_left=value; + _createSetPropertyAction(this.context, this, "Left", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "top", { + get: function () { + _throwIfNotLoaded("top", this.m_top); + return this.m_top; + }, + set: function (value) { + this.m_top=value; + _createSetPropertyAction(this.context, this, "Top", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "width", { + get: function () { + _throwIfNotLoaded("width", this.m_width); + return this.m_width; + }, + set: function (value) { + this.m_width=value; + _createSetPropertyAction(this.context, this, "Width", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + Chart.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Chart.prototype.setData=function (sourceData, seriesBy) { + if (!(sourceData instanceof Range)) { + throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData"); + } + _createMethodAction(this.context, this, "SetData", 0 , [sourceData, seriesBy]); + }; + Chart.prototype.setPosition=function (startCell, endCell) { + _createMethodAction(this.context, this, "SetPosition", 0 , [startCell, endCell]); + }; + Chart.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Height"])) { + this.m_height=obj["Height"]; + } + if (!_isUndefined(obj["Left"])) { + this.m_left=obj["Left"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Top"])) { + this.m_top=obj["Top"]; + } + if (!_isUndefined(obj["Width"])) { + this.m_width=obj["Width"]; + } + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title"]); + }; + Chart.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Chart; + })(OfficeExtension.ClientObject); + Excel.Chart=Chart; + var ChartAreaFormat=(function (_super) { + __extends(ChartAreaFormat, _super); + function ChartAreaFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAreaFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAreaFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartAreaFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartAreaFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAreaFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAreaFormat=ChartAreaFormat; + var ChartSeriesCollection=(function (_super) { + __extends(ChartSeriesCollection, _super); + function ChartSeriesCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartSeriesCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeriesCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + ChartSeriesCollection.prototype.getItemAt=function (index) { + return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + ChartSeriesCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ChartSeriesCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartSeriesCollection; + })(OfficeExtension.ClientObject); + Excel.ChartSeriesCollection=ChartSeriesCollection; + var ChartSeries=(function (_super) { + __extends(ChartSeries, _super); + function ChartSeries() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartSeries.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeries.prototype, "points", { + get: function () { + if (!this.m_points) { + this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false)); + } + return this.m_points; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeries.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + ChartSeries.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]); + }; + ChartSeries.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartSeries; + })(OfficeExtension.ClientObject); + Excel.ChartSeries=ChartSeries; + var ChartSeriesFormat=(function (_super) { + __extends(ChartSeriesFormat, _super); + function ChartSeriesFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartSeriesFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeriesFormat.prototype, "line", { + get: function () { + if (!this.m_line) { + this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false)); + } + return this.m_line; + }, + enumerable: true, + configurable: true + }); + ChartSeriesFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]); + }; + ChartSeriesFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartSeriesFormat; + })(OfficeExtension.ClientObject); + Excel.ChartSeriesFormat=ChartSeriesFormat; + var ChartPointsCollection=(function (_super) { + __extends(ChartPointsCollection, _super); + function ChartPointsCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartPointsCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartPointsCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + ChartPointsCollection.prototype.getItemAt=function (index) { + return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + ChartPointsCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ChartPointsCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartPointsCollection; + })(OfficeExtension.ClientObject); + Excel.ChartPointsCollection=ChartPointsCollection; + var ChartPoint=(function (_super) { + __extends(ChartPoint, _super); + function ChartPoint() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartPoint.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartPoint.prototype, "value", { + get: function () { + _throwIfNotLoaded("value", this.m_value); + return this.m_value; + }, + enumerable: true, + configurable: true + }); + ChartPoint.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Value"])) { + this.m_value=obj["Value"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartPoint.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartPoint; + })(OfficeExtension.ClientObject); + Excel.ChartPoint=ChartPoint; + var ChartPointFormat=(function (_super) { + __extends(ChartPointFormat, _super); + function ChartPointFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartPointFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + ChartPointFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]); + }; + ChartPointFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartPointFormat; + })(OfficeExtension.ClientObject); + Excel.ChartPointFormat=ChartPointFormat; + var ChartAxes=(function (_super) { + __extends(ChartAxes, _super); + function ChartAxes() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxes.prototype, "categoryAxis", { + get: function () { + if (!this.m_categoryAxis) { + this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false)); + } + return this.m_categoryAxis; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxes.prototype, "seriesAxis", { + get: function () { + if (!this.m_seriesAxis) { + this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false)); + } + return this.m_seriesAxis; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxes.prototype, "valueAxis", { + get: function () { + if (!this.m_valueAxis) { + this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false)); + } + return this.m_valueAxis; + }, + enumerable: true, + configurable: true + }); + ChartAxes.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]); + }; + ChartAxes.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxes; + })(OfficeExtension.ClientObject); + Excel.ChartAxes=ChartAxes; + var ChartAxis=(function (_super) { + __extends(ChartAxis, _super); + function ChartAxis() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxis.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "majorGridlines", { + get: function () { + if (!this.m_majorGridlines) { + this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false)); + } + return this.m_majorGridlines; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "minorGridlines", { + get: function () { + if (!this.m_minorGridlines) { + this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false)); + } + return this.m_minorGridlines; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "title", { + get: function () { + if (!this.m_title) { + this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false)); + } + return this.m_title; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "majorUnit", { + get: function () { + _throwIfNotLoaded("majorUnit", this.m_majorUnit); + return this.m_majorUnit; + }, + set: function (value) { + this.m_majorUnit=value; + _createSetPropertyAction(this.context, this, "MajorUnit", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "maximum", { + get: function () { + _throwIfNotLoaded("maximum", this.m_maximum); + return this.m_maximum; + }, + set: function (value) { + this.m_maximum=value; + _createSetPropertyAction(this.context, this, "Maximum", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "minimum", { + get: function () { + _throwIfNotLoaded("minimum", this.m_minimum); + return this.m_minimum; + }, + set: function (value) { + this.m_minimum=value; + _createSetPropertyAction(this.context, this, "Minimum", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "minorUnit", { + get: function () { + _throwIfNotLoaded("minorUnit", this.m_minorUnit); + return this.m_minorUnit; + }, + set: function (value) { + this.m_minorUnit=value; + _createSetPropertyAction(this.context, this, "MinorUnit", value); + }, + enumerable: true, + configurable: true + }); + ChartAxis.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["MajorUnit"])) { + this.m_majorUnit=obj["MajorUnit"]; + } + if (!_isUndefined(obj["Maximum"])) { + this.m_maximum=obj["Maximum"]; + } + if (!_isUndefined(obj["Minimum"])) { + this.m_minimum=obj["Minimum"]; + } + if (!_isUndefined(obj["MinorUnit"])) { + this.m_minorUnit=obj["MinorUnit"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]); + }; + ChartAxis.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxis; + })(OfficeExtension.ClientObject); + Excel.ChartAxis=ChartAxis; + var ChartAxisFormat=(function (_super) { + __extends(ChartAxisFormat, _super); + function ChartAxisFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxisFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxisFormat.prototype, "line", { + get: function () { + if (!this.m_line) { + this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false)); + } + return this.m_line; + }, + enumerable: true, + configurable: true + }); + ChartAxisFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]); + }; + ChartAxisFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxisFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAxisFormat=ChartAxisFormat; + var ChartAxisTitle=(function (_super) { + __extends(ChartAxisTitle, _super); + function ChartAxisTitle() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxisTitle.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxisTitle.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + set: function (value) { + this.m_text=value; + _createSetPropertyAction(this.context, this, "Text", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxisTitle.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartAxisTitle.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartAxisTitle.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxisTitle; + })(OfficeExtension.ClientObject); + Excel.ChartAxisTitle=ChartAxisTitle; + var ChartAxisTitleFormat=(function (_super) { + __extends(ChartAxisTitleFormat, _super); + function ChartAxisTitleFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxisTitleFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartAxisTitleFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["font", "Font"]); + }; + ChartAxisTitleFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxisTitleFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAxisTitleFormat=ChartAxisTitleFormat; + var ChartDataLabels=(function (_super) { + __extends(ChartDataLabels, _super); + function ChartDataLabels() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartDataLabels.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "position", { + get: function () { + _throwIfNotLoaded("position", this.m_position); + return this.m_position; + }, + set: function (value) { + this.m_position=value; + _createSetPropertyAction(this.context, this, "Position", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "separator", { + get: function () { + _throwIfNotLoaded("separator", this.m_separator); + return this.m_separator; + }, + set: function (value) { + this.m_separator=value; + _createSetPropertyAction(this.context, this, "Separator", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", { + get: function () { + _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize); + return this.m_showBubbleSize; + }, + set: function (value) { + this.m_showBubbleSize=value; + _createSetPropertyAction(this.context, this, "ShowBubbleSize", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", { + get: function () { + _throwIfNotLoaded("showCategoryName", this.m_showCategoryName); + return this.m_showCategoryName; + }, + set: function (value) { + this.m_showCategoryName=value; + _createSetPropertyAction(this.context, this, "ShowCategoryName", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", { + get: function () { + _throwIfNotLoaded("showLegendKey", this.m_showLegendKey); + return this.m_showLegendKey; + }, + set: function (value) { + this.m_showLegendKey=value; + _createSetPropertyAction(this.context, this, "ShowLegendKey", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showPercentage", { + get: function () { + _throwIfNotLoaded("showPercentage", this.m_showPercentage); + return this.m_showPercentage; + }, + set: function (value) { + this.m_showPercentage=value; + _createSetPropertyAction(this.context, this, "ShowPercentage", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", { + get: function () { + _throwIfNotLoaded("showSeriesName", this.m_showSeriesName); + return this.m_showSeriesName; + }, + set: function (value) { + this.m_showSeriesName=value; + _createSetPropertyAction(this.context, this, "ShowSeriesName", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showValue", { + get: function () { + _throwIfNotLoaded("showValue", this.m_showValue); + return this.m_showValue; + }, + set: function (value) { + this.m_showValue=value; + _createSetPropertyAction(this.context, this, "ShowValue", value); + }, + enumerable: true, + configurable: true + }); + ChartDataLabels.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Position"])) { + this.m_position=obj["Position"]; + } + if (!_isUndefined(obj["Separator"])) { + this.m_separator=obj["Separator"]; + } + if (!_isUndefined(obj["ShowBubbleSize"])) { + this.m_showBubbleSize=obj["ShowBubbleSize"]; + } + if (!_isUndefined(obj["ShowCategoryName"])) { + this.m_showCategoryName=obj["ShowCategoryName"]; + } + if (!_isUndefined(obj["ShowLegendKey"])) { + this.m_showLegendKey=obj["ShowLegendKey"]; + } + if (!_isUndefined(obj["ShowPercentage"])) { + this.m_showPercentage=obj["ShowPercentage"]; + } + if (!_isUndefined(obj["ShowSeriesName"])) { + this.m_showSeriesName=obj["ShowSeriesName"]; + } + if (!_isUndefined(obj["ShowValue"])) { + this.m_showValue=obj["ShowValue"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartDataLabels.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartDataLabels; + })(OfficeExtension.ClientObject); + Excel.ChartDataLabels=ChartDataLabels; + var ChartDataLabelFormat=(function (_super) { + __extends(ChartDataLabelFormat, _super); + function ChartDataLabelFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartDataLabelFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabelFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartDataLabelFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartDataLabelFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartDataLabelFormat; + })(OfficeExtension.ClientObject); + Excel.ChartDataLabelFormat=ChartDataLabelFormat; + var ChartGridlines=(function (_super) { + __extends(ChartGridlines, _super); + function ChartGridlines() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartGridlines.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartGridlines.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartGridlines.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartGridlines.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartGridlines; + })(OfficeExtension.ClientObject); + Excel.ChartGridlines=ChartGridlines; + var ChartGridlinesFormat=(function (_super) { + __extends(ChartGridlinesFormat, _super); + function ChartGridlinesFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartGridlinesFormat.prototype, "line", { + get: function () { + if (!this.m_line) { + this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false)); + } + return this.m_line; + }, + enumerable: true, + configurable: true + }); + ChartGridlinesFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["line", "Line"]); + }; + ChartGridlinesFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartGridlinesFormat; + })(OfficeExtension.ClientObject); + Excel.ChartGridlinesFormat=ChartGridlinesFormat; + var ChartLegend=(function (_super) { + __extends(ChartLegend, _super); + function ChartLegend() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartLegend.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegend.prototype, "overlay", { + get: function () { + _throwIfNotLoaded("overlay", this.m_overlay); + return this.m_overlay; + }, + set: function (value) { + this.m_overlay=value; + _createSetPropertyAction(this.context, this, "Overlay", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegend.prototype, "position", { + get: function () { + _throwIfNotLoaded("position", this.m_position); + return this.m_position; + }, + set: function (value) { + this.m_position=value; + _createSetPropertyAction(this.context, this, "Position", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegend.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartLegend.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Overlay"])) { + this.m_overlay=obj["Overlay"]; + } + if (!_isUndefined(obj["Position"])) { + this.m_position=obj["Position"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartLegend.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartLegend; + })(OfficeExtension.ClientObject); + Excel.ChartLegend=ChartLegend; + var ChartLegendFormat=(function (_super) { + __extends(ChartLegendFormat, _super); + function ChartLegendFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartLegendFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegendFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartLegendFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartLegendFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartLegendFormat; + })(OfficeExtension.ClientObject); + Excel.ChartLegendFormat=ChartLegendFormat; + var ChartTitle=(function (_super) { + __extends(ChartTitle, _super); + function ChartTitle() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartTitle.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitle.prototype, "overlay", { + get: function () { + _throwIfNotLoaded("overlay", this.m_overlay); + return this.m_overlay; + }, + set: function (value) { + this.m_overlay=value; + _createSetPropertyAction(this.context, this, "Overlay", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitle.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + set: function (value) { + this.m_text=value; + _createSetPropertyAction(this.context, this, "Text", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitle.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartTitle.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Overlay"])) { + this.m_overlay=obj["Overlay"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartTitle.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartTitle; + })(OfficeExtension.ClientObject); + Excel.ChartTitle=ChartTitle; + var ChartTitleFormat=(function (_super) { + __extends(ChartTitleFormat, _super); + function ChartTitleFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartTitleFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitleFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartTitleFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartTitleFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartTitleFormat; + })(OfficeExtension.ClientObject); + Excel.ChartTitleFormat=ChartTitleFormat; + var ChartFill=(function (_super) { + __extends(ChartFill, _super); + function ChartFill() { + _super.apply(this, arguments); + } + ChartFill.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + ChartFill.prototype.setSolidColor=function (color) { + _createMethodAction(this.context, this, "SetSolidColor", 0 , [color]); + }; + ChartFill.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + }; + ChartFill.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartFill; + })(OfficeExtension.ClientObject); + Excel.ChartFill=ChartFill; + var ChartLineFormat=(function (_super) { + __extends(ChartLineFormat, _super); + function ChartLineFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartLineFormat.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + ChartLineFormat.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + ChartLineFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + }; + ChartLineFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartLineFormat; + })(OfficeExtension.ClientObject); + Excel.ChartLineFormat=ChartLineFormat; + var ChartFont=(function (_super) { + __extends(ChartFont, _super); + function ChartFont() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartFont.prototype, "bold", { + get: function () { + _throwIfNotLoaded("bold", this.m_bold); + return this.m_bold; + }, + set: function (value) { + this.m_bold=value; + _createSetPropertyAction(this.context, this, "Bold", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "italic", { + get: function () { + _throwIfNotLoaded("italic", this.m_italic); + return this.m_italic; + }, + set: function (value) { + this.m_italic=value; + _createSetPropertyAction(this.context, this, "Italic", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "size", { + get: function () { + _throwIfNotLoaded("size", this.m_size); + return this.m_size; + }, + set: function (value) { + this.m_size=value; + _createSetPropertyAction(this.context, this, "Size", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "underline", { + get: function () { + _throwIfNotLoaded("underline", this.m_underline); + return this.m_underline; + }, + set: function (value) { + this.m_underline=value; + _createSetPropertyAction(this.context, this, "Underline", value); + }, + enumerable: true, + configurable: true + }); + ChartFont.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Bold"])) { + this.m_bold=obj["Bold"]; + } + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["Italic"])) { + this.m_italic=obj["Italic"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Size"])) { + this.m_size=obj["Size"]; + } + if (!_isUndefined(obj["Underline"])) { + this.m_underline=obj["Underline"]; + } + }; + ChartFont.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartFont; + })(OfficeExtension.ClientObject); + Excel.ChartFont=ChartFont; + var BindingType; + (function (BindingType) { + BindingType.range="Range"; + BindingType.table="Table"; + BindingType.text="Text"; + })(BindingType=Excel.BindingType || (Excel.BindingType={})); + var BorderIndex; + (function (BorderIndex) { + BorderIndex.edgeTop="EdgeTop"; + BorderIndex.edgeBottom="EdgeBottom"; + BorderIndex.edgeLeft="EdgeLeft"; + BorderIndex.edgeRight="EdgeRight"; + BorderIndex.insideVertical="InsideVertical"; + BorderIndex.insideHorizontal="InsideHorizontal"; + BorderIndex.diagonalDown="DiagonalDown"; + BorderIndex.diagonalUp="DiagonalUp"; + })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={})); + var BorderLineStyle; + (function (BorderLineStyle) { + BorderLineStyle.none="None"; + BorderLineStyle.continuous="Continuous"; + BorderLineStyle.dash="Dash"; + BorderLineStyle.dashDot="DashDot"; + BorderLineStyle.dashDotDot="DashDotDot"; + BorderLineStyle.dot="Dot"; + BorderLineStyle.double="Double"; + BorderLineStyle.slantDashDot="SlantDashDot"; + })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={})); + var BorderWeight; + (function (BorderWeight) { + BorderWeight.hairline="Hairline"; + BorderWeight.thin="Thin"; + BorderWeight.medium="Medium"; + BorderWeight.thick="Thick"; + })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={})); + var CalculationMode; + (function (CalculationMode) { + CalculationMode.automatic="Automatic"; + CalculationMode.automaticExceptTables="AutomaticExceptTables"; + CalculationMode.manual="Manual"; + })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={})); + var CalculationType; + (function (CalculationType) { + CalculationType.recalculate="Recalculate"; + CalculationType.full="Full"; + CalculationType.fullRebuild="FullRebuild"; + })(CalculationType=Excel.CalculationType || (Excel.CalculationType={})); + var ClearApplyTo; + (function (ClearApplyTo) { + ClearApplyTo.all="All"; + ClearApplyTo.formats="Formats"; + ClearApplyTo.contents="Contents"; + })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={})); + var ChartDataLabelPosition; + (function (ChartDataLabelPosition) { + ChartDataLabelPosition.invalid="Invalid"; + ChartDataLabelPosition.none="None"; + ChartDataLabelPosition.center="Center"; + ChartDataLabelPosition.insideEnd="InsideEnd"; + ChartDataLabelPosition.insideBase="InsideBase"; + ChartDataLabelPosition.outsideEnd="OutsideEnd"; + ChartDataLabelPosition.left="Left"; + ChartDataLabelPosition.right="Right"; + ChartDataLabelPosition.top="Top"; + ChartDataLabelPosition.bottom="Bottom"; + ChartDataLabelPosition.bestFit="BestFit"; + ChartDataLabelPosition.callout="Callout"; + })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={})); + var ChartLegendPosition; + (function (ChartLegendPosition) { + ChartLegendPosition.invalid="Invalid"; + ChartLegendPosition.top="Top"; + ChartLegendPosition.bottom="Bottom"; + ChartLegendPosition.left="Left"; + ChartLegendPosition.right="Right"; + ChartLegendPosition.corner="Corner"; + ChartLegendPosition.custom="Custom"; + })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={})); + var ChartSeriesBy; + (function (ChartSeriesBy) { + ChartSeriesBy.auto="Auto"; + ChartSeriesBy.columns="Columns"; + ChartSeriesBy.rows="Rows"; + })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={})); + var ChartType; + (function (ChartType) { + ChartType.invalid="Invalid"; + ChartType.columnClustered="ColumnClustered"; + ChartType.columnStacked="ColumnStacked"; + ChartType.columnStacked100="ColumnStacked100"; + ChartType._3DColumnClustered="3DColumnClustered"; + ChartType._3DColumnStacked="3DColumnStacked"; + ChartType._3DColumnStacked100="3DColumnStacked100"; + ChartType.barClustered="BarClustered"; + ChartType.barStacked="BarStacked"; + ChartType.barStacked100="BarStacked100"; + ChartType._3DBarClustered="3DBarClustered"; + ChartType._3DBarStacked="3DBarStacked"; + ChartType._3DBarStacked100="3DBarStacked100"; + ChartType.lineStacked="LineStacked"; + ChartType.lineStacked100="LineStacked100"; + ChartType.lineMarkers="LineMarkers"; + ChartType.lineMarkersStacked="LineMarkersStacked"; + ChartType.lineMarkersStacked100="LineMarkersStacked100"; + ChartType.pieOfPie="PieOfPie"; + ChartType.pieExploded="PieExploded"; + ChartType._3DPieExploded="3DPieExploded"; + ChartType.barOfPie="BarOfPie"; + ChartType.xyscatterSmooth="XYScatterSmooth"; + ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers"; + ChartType.xyscatterLines="XYScatterLines"; + ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers"; + ChartType.areaStacked="AreaStacked"; + ChartType.areaStacked100="AreaStacked100"; + ChartType._3DAreaStacked="3DAreaStacked"; + ChartType._3DAreaStacked100="3DAreaStacked100"; + ChartType.doughnutExploded="DoughnutExploded"; + ChartType.radarMarkers="RadarMarkers"; + ChartType.radarFilled="RadarFilled"; + ChartType.surface="Surface"; + ChartType.surfaceWireframe="SurfaceWireframe"; + ChartType.surfaceTopView="SurfaceTopView"; + ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe"; + ChartType.bubble="Bubble"; + ChartType.bubble3DEffect="Bubble3DEffect"; + ChartType.stockHLC="StockHLC"; + ChartType.stockOHLC="StockOHLC"; + ChartType.stockVHLC="StockVHLC"; + ChartType.stockVOHLC="StockVOHLC"; + ChartType.cylinderColClustered="CylinderColClustered"; + ChartType.cylinderColStacked="CylinderColStacked"; + ChartType.cylinderColStacked100="CylinderColStacked100"; + ChartType.cylinderBarClustered="CylinderBarClustered"; + ChartType.cylinderBarStacked="CylinderBarStacked"; + ChartType.cylinderBarStacked100="CylinderBarStacked100"; + ChartType.cylinderCol="CylinderCol"; + ChartType.coneColClustered="ConeColClustered"; + ChartType.coneColStacked="ConeColStacked"; + ChartType.coneColStacked100="ConeColStacked100"; + ChartType.coneBarClustered="ConeBarClustered"; + ChartType.coneBarStacked="ConeBarStacked"; + ChartType.coneBarStacked100="ConeBarStacked100"; + ChartType.coneCol="ConeCol"; + ChartType.pyramidColClustered="PyramidColClustered"; + ChartType.pyramidColStacked="PyramidColStacked"; + ChartType.pyramidColStacked100="PyramidColStacked100"; + ChartType.pyramidBarClustered="PyramidBarClustered"; + ChartType.pyramidBarStacked="PyramidBarStacked"; + ChartType.pyramidBarStacked100="PyramidBarStacked100"; + ChartType.pyramidCol="PyramidCol"; + ChartType._3DColumn="3DColumn"; + ChartType.line="Line"; + ChartType._3DLine="3DLine"; + ChartType._3DPie="3DPie"; + ChartType.pie="Pie"; + ChartType.xyscatter="XYScatter"; + ChartType._3DArea="3DArea"; + ChartType.area="Area"; + ChartType.doughnut="Doughnut"; + ChartType.radar="Radar"; + })(ChartType=Excel.ChartType || (Excel.ChartType={})); + var ChartUnderlineStyle; + (function (ChartUnderlineStyle) { + ChartUnderlineStyle.none="None"; + ChartUnderlineStyle.single="Single"; + })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={})); + var DeleteShiftDirection; + (function (DeleteShiftDirection) { + DeleteShiftDirection.up="Up"; + DeleteShiftDirection.left="Left"; + })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={})); + var HorizontalAlignment; + (function (HorizontalAlignment) { + HorizontalAlignment.general="General"; + HorizontalAlignment.left="Left"; + HorizontalAlignment.center="Center"; + HorizontalAlignment.right="Right"; + HorizontalAlignment.fill="Fill"; + HorizontalAlignment.justify="Justify"; + HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection"; + HorizontalAlignment.distributed="Distributed"; + })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={})); + var InsertShiftDirection; + (function (InsertShiftDirection) { + InsertShiftDirection.down="Down"; + InsertShiftDirection.right="Right"; + })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={})); + var NamedItemType; + (function (NamedItemType) { + NamedItemType.string="String"; + NamedItemType.integer="Integer"; + NamedItemType.double="Double"; + NamedItemType.boolean="Boolean"; + NamedItemType.range="Range"; + })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={})); + var RangeUnderlineStyle; + (function (RangeUnderlineStyle) { + RangeUnderlineStyle.none="None"; + RangeUnderlineStyle.single="Single"; + RangeUnderlineStyle.double="Double"; + RangeUnderlineStyle.singleAccountant="SingleAccountant"; + RangeUnderlineStyle.doubleAccountant="DoubleAccountant"; + })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={})); + var SheetVisibility; + (function (SheetVisibility) { + SheetVisibility.visible="Visible"; + SheetVisibility.hidden="Hidden"; + SheetVisibility.veryHidden="VeryHidden"; + })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={})); + var RangeValueType; + (function (RangeValueType) { + RangeValueType.unknown="Unknown"; + RangeValueType.empty="Empty"; + RangeValueType.string="String"; + RangeValueType.integer="Integer"; + RangeValueType.double="Double"; + RangeValueType.boolean="Boolean"; + RangeValueType.error="Error"; + })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={})); + var VerticalAlignment; + (function (VerticalAlignment) { + VerticalAlignment.top="Top"; + VerticalAlignment.center="Center"; + VerticalAlignment.bottom="Bottom"; + VerticalAlignment.justify="Justify"; + VerticalAlignment.distributed="Distributed"; + })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={})); + var ErrorCodes; + (function (ErrorCodes) { + ErrorCodes.accessDenied="AccessDenied"; + ErrorCodes.generalException="GeneralException"; + ErrorCodes.insertDeleteConflict="InsertDeleteConflict"; + ErrorCodes.invalidArgument="InvalidArgument"; + ErrorCodes.invalidBinding="InvalidBinding"; + ErrorCodes.invalidOperation="InvalidOperation"; + ErrorCodes.invalidReference="InvalidReference"; + ErrorCodes.invalidSelection="InvalidSelection"; + ErrorCodes.itemAlreadyExists="ItemAlreadyExists"; + ErrorCodes.itemNotFound="ItemNotFound"; + ErrorCodes.notImplemented="NotImplemented"; + ErrorCodes.unsupportedOperation="UnsupportedOperation"; + })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={})); +})(Excel || (Excel={})); +var Excel; +(function (Excel) { + var RequestContext=(function (_super) { + __extends(RequestContext, _super); + function RequestContext(url) { + _super.call(this, url); + this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this)); + this._rootObject=this.m_workbook; + } + Object.defineProperty(RequestContext.prototype, "workbook", { + get: function () { + return this.m_workbook; + }, + enumerable: true, + configurable: true + }); + return RequestContext; + })(OfficeExtension.ClientRequestContext); + Excel.RequestContext=RequestContext; + function run(batch) { + return OfficeExtension.ClientRequestContext._run(function () { return new Excel.RequestContext(); }, batch); + } + Excel.run=run; +})(Excel || (Excel={})); + + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-web-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-web-16.00.js new file mode 100644 index 000000000..cdb0a88a4 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-web-16.00.js @@ -0,0 +1,19 @@ +/* Excel web application specific API library */ +/* Version: 16.0.6216.3006 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/* +* @overview es6-promise - a tiny implementation of Promises/A+. +* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) +* @license Licensed under MIT license +* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE +* @version 2.3.0 +*/ + +var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},OsfMsAjaxFactory,OSF,msAjaxCDNPath,OSFLog,Logger,OSFAppTelemetry,OSF_DDA_Marshaling_File_FilePropertiesKeys,OSF_DDA_Marshaling_File_SlicePropertiesKeys,OSF_DDA_Marshaling_File_FileType,OSF_DDA_Marshaling_File_ParameterKeys,OSF_DDA_Marshaling_FilePropertiesKeys,OSF_DDA_Marshaling_GoToType,OSF_DDA_Marshaling_SelectionMode,OSF_DDA_Marshaling_TableOptionProperties,OSF_DDA_Marshaling_CellProperties,OSF_DDA_Marshaling_CellFormatProperties,OSF_DDA_Marshaling_BorderStyleType,OSF_DDA_Marshaling_ColorType,OSF_DDA_Marshaling_AlignHorizontalType,OSF_DDA_Marshaling_AlignVerticalType,OSF_DDA_Marshaling_FontStyleType,OSF_DDA_Marshaling_FontUnderlineStyleType,OSF_DDA_Marshaling_FontDirectionType,OSF_DDA_Marshaling_WidthType,OSF_DDA_Marshaling_HeightType,AgaveFormatAPI,OfficeExt,OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys,OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys,OfficeExtension,Excel;(function(n){var t=function(){function t(){}var i=null,n=!0;return t.prototype.isMsAjaxLoaded=function(){var t="function",i="undefined";return typeof Sys!==i&&typeof Type!==i&&Sys.StringBuilder&&typeof Sys.StringBuilder===t&&Type.registerNamespace&&typeof Type.registerNamespace===t&&Type.registerClass&&typeof Type.registerClass===t&&typeof Function._validateParams===t?n:!1},t.prototype.loadMsAjaxFull=function(n){var t=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(t,n)},Object.defineProperty(t.prototype,"msAjaxError",{get:function(){var n=this;return n._msAjaxError==i&&n.isMsAjaxLoaded()&&(n._msAjaxError=Error),n._msAjaxError},set:function(n){this._msAjaxError=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxSerializer",{get:function(){var n=this;return n._msAjaxSerializer==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer),n._msAjaxSerializer},set:function(n){this._msAjaxSerializer=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxString",{get:function(){var n=this;return n._msAjaxString==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=String),n._msAjaxString},set:function(n){this._msAjaxString=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxDebug",{get:function(){var n=this;return n._msAjaxDebug==i&&n.isMsAjaxLoaded()&&(n._msAjaxDebug=Sys.Debug),n._msAjaxDebug},set:function(n){this._msAjaxDebug=n},enumerable:n,configurable:n}),t}();n.MicrosoftAjaxFactory=t})(OfficeExt||(OfficeExt={}));OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory;OSF=OSF||{},function(n){var t=function(){function n(n){this._internalStorage=n}return n.prototype.getItem=function(n){try{return this._internalStorage&&this._internalStorage.getItem(n)}catch(t){return null}},n.prototype.setItem=function(n,t){try{this._internalStorage&&this._internalStorage.setItem(n,t)}catch(i){}},n.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(n){}},n.prototype.removeItem=function(n){try{this._internalStorage&&this._internalStorage.removeItem(n)}catch(t){}},n.prototype.getKeysWithPrefix=function(n){var r=[],u,t,i;try{for(u=this._internalStorage&&this._internalStorage.length||0,t=0;t1?s[s.length-1]:t,h=d(),e,o,c;return!r&&h&&(e=window.name.indexOf(i),e>-1&&(o=window.name.indexOf(";",e),o==-1&&(o=window.name.length),c=window.name.substring(e,o),f?h.setItem(c,f):f=h.getItem(c))),f},getConversationId:function(){var i=window.location.search,n=t,r;return i&&(r=i.indexOf("&"),n=r>0?i.substring(1,r):i.substr(1),n&&n.charAt(n.length-1)==="="&&(n=n.substring(0,n.length-1),n&&(n=decodeURIComponent(n)))),n},getInfoItems:function(n){var t=n.split("$");return typeof t[1]==e&&(t=n.split("|")),t},getConversationUrl:function(){var t="",r=OSF.OUtil.parseXdmInfo(i),n;return r&&(n=OSF.OUtil.getInfoItems(r),n!=undefined&&n.length>=3&&(t=n[2])),t},validateParamObject:function(t,r){var u=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:n},{name:"expectedProperties",type:Object,mayBeNull:n},{name:"callback",type:Function,mayBeNull:i}]),f;if(u)throw u;for(f in r)if(u=Function._validateParameter(t[f],r[f],f),u)throw u;},writeProfilerMark:function(n){window.msWriteProfilerMark&&(window.msWriteProfilerMark(n),OsfMsAjaxFactory.msAjaxDebug.trace(n))},outputDebug:function(n){typeof Sys!==e&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(n)},defineNondefaultProperty:function(n,t,r,u){var e,f;r=r||{};for(e in u)f=u[e],r[f]==undefined&&(r[f]=i);return Object.defineProperty(n,t,r),n},defineNondefaultProperties:function(n,t,i){t=t||{};for(var r in t)OSF.OUtil.defineNondefaultProperty(n,r,t[r],i);return n},defineEnumerableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[f])},defineEnumerableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[f])},defineMutableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[y,f,v])},defineMutableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[y,f,v])},finalizeProperties:function(t,r){var e,u;r=r||{};for(var o=Object.getOwnPropertyNames(t),s=o.length,f=0;f>8,f=e&255,i[t++]=r>>2,i[t++]=(r&3)<<4|u>>4,i[t++]=(u&15)<<2|f>>6,i[t++]=f&63,isNaN(e)||(r=e>>8,u=s&255,f=s>>8,i[t++]=r>>2,i[t++]=(r&3)<<4|u>>4,i[t++]=(u&15)<<2|f>>6,i[t++]=f&63),isNaN(e)?i[t-1]=64:isNaN(s)&&(i[t-2]=64,i[t-1]=64),h=0;h0;t++)(t==8||t==12||t==16||t==20)&&(i+="-"),i+=n[r%16],r=Math.floor(r/16);for(;t<32;t++)(t==8||t==12||t==16||t==20)&&(i+="-"),i+=n[Math.floor(Math.random()*16)];return i}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){var b=this;b._id=n;b._appName=t;b._appVersion=i;b._appUILocale=r;b._dataLocale=u;b._docUrl=f;b._clientMode=e;b._settings=o;b._reason=s;b._osfControlType=h;b._eToken=c;b._correlationId=l;b._appInstanceId=a;b._touchEnabled=v;b._commerceAllowed=y;b._appMinorVersion=p;b._requirementMatrix=w;b.get_id=function(){return this._id};b.get_appName=function(){return this._appName};b.get_appVersion=function(){return this._appVersion};b.get_appUILocale=function(){return this._appUILocale};b.get_dataLocale=function(){return this._dataLocale};b.get_docUrl=function(){return this._docUrl};b.get_clientMode=function(){return this._clientMode};b.get_bindings=function(){return this._bindings};b.get_settings=function(){return this._settings};b.get_reason=function(){return this._reason};b.get_osfControlType=function(){return this._osfControlType};b.get_eToken=function(){return this._eToken};b.get_correlationId=function(){return this._correlationId};b.get_appInstanceId=function(){return this._appInstanceId};b.get_touchEnabled=function(){return this._touchEnabled};b.get_commerceAllowed=function(){return this._commerceAllowed};b.get_appMinorVersion=function(){return this._appMinorVersion};b.get_requirementMatrix=function(){return this._requirementMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",ImageLeft:"imageLeft",ImageTop:"imageTop",ImageWidth:"imageWidth",ImageHeight:"imageHeight",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(n,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged?n+"_"+t:t};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var n={};return{getErrorArgs:function(t){return n[t]||n[this.errorCodes.ooeInternalError]},addErrorMessage:function(t,i){n[t]=i},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(t){n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:t.L_APICallFailed,message:t.L_ActivityLimitReached};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported}}}}(),function(n){(function(n){var t=1.1,r=function(){function n(n){this.isSetSupported=function(n,t){var u,i,r;return n==undefined?!1:(t==undefined&&(t=0),u=this._setMap,i=u._sets,i.hasOwnProperty(n.toLowerCase())?(r=i[n.toLowerCase()],r>0&&r>=t):!1)};this._setMap=n}return n}(),i,f,e,o,s,h,c,l,a,u,v,y,p,w,b,k,d;n.RequirementMatrix=r;i=function(){function n(n){this._sets=n}return n}();n.DefaultSetRequirement=i;f=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,excelapi:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t})}return __extends(i,n),i}(i);n.ExcelClientDefaultSetRequirement=f;e=function(n){function t(){n.call(this,{mailbox:1.3})}return __extends(t,n),t}(i);n.OutlookClientDefaultSetRequirement=e;o=function(n){function i(){n.call(this,{bindingevents:t,compressedfile:t,customxmlparts:t,documentevents:t,file:t,htmlcoercion:t,matrixbindings:t,matrixcoercion:t,ooxmlcoercion:t,pdffile:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,textfile:t,wordapi:t})}return __extends(i,n),i}(i);n.WordClientDefaultSetRequirement=o;s=function(n){function i(){n.call(this,{activeview:t,compressedfile:t,documentevents:t,file:t,pdffile:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.PowerpointClientDefaultSetRequirement=s;h=function(n){function i(){n.call(this,{selection:t,textcoercion:t})}return __extends(i,n),i}(i);n.ProjectClientDefaultSetRequirement=h;c=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,file:t})}return __extends(i,n),i}(i);n.ExcelWebDefaultSetRequirement=c;l=function(n){function i(){n.call(this,{customxmlparts:t,documentevents:t,file:t,ooxmlcoercion:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.WordWebDefaultSetRequirement=l;a=function(n){function i(){n.call(this,{activeview:t,settings:t})}return __extends(i,n),i}(i);n.PowerpointWebDefaultSetRequirement=a;u=function(n){function t(){n.call(this,{mailbox:1.3})}return __extends(t,n),t}(i);n.OutlookWebDefaultSetRequirement=u;v=function(n){function i(){n.call(this,{activeview:t,documentevents:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.SwayWebDefaultSetRequirement=v;y=function(n){function i(){n.call(this,{bindingevents:t,partialtablebindings:t,settings:t,tablebindings:t,tablecoercion:t})}return __extends(i,n),i}(i);n.AccessWebDefaultSetRequirement=y;p=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t})}return __extends(i,n),i}(i);n.ExcelIOSDefaultSetRequirement=p;w=function(n){function i(){n.call(this,{bindingevents:t,compressedfile:t,customxmlparts:t,documentevents:t,file:t,htmlcoercion:t,matrixbindings:t,matrixcoercion:t,ooxmlcoercion:t,pdffile:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,textfile:t})}return __extends(i,n),i}(i);n.WordIOSDefaultSetRequirement=w;b=function(n){function i(){n.call(this,{activeview:t,compressedfile:t,documentevents:t,file:t,pdffile:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.PowerpointIOSDefaultSetRequirement=b;k=function(n){function i(){n.call(this,{mailbox:t})}return __extends(i,n),i}(i);n.OutlookIOSDefaultSetRequirement=k;d=function(){function n(){}return n.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)},n.getDefaultRequirementMatrix=function(t){var u,s,f,e,h,o;return this.initializeDefaultSetMatrix(),u=undefined,t.get_requirementMatrix()!=undefined&&typeof JSON!="undefined"?(s=JSON.parse(t.get_requirementMatrix()),u=new r(new i(s))):(f=t.get_appMinorVersion(),e="",e=f<10?"0"+f:""+f,h=t.get_appVersion()+"."+e,o=t.get_appName()+"-"+h,u=n.DefaultSetArrayMatrix!=undefined&&n.DefaultSetArrayMatrix[o]!=undefined?new r(n.DefaultSetArrayMatrix[o]):new r(new i({}))),u},n.initializeDefaultSetMatrix=function(){n.DefaultSetArrayMatrix[n.Excel_RCLIENT_1600]=new f;n.DefaultSetArrayMatrix[n.Word_RCLIENT_1600]=new o;n.DefaultSetArrayMatrix[n.PowerPoint_RCLIENT_1600]=new s;n.DefaultSetArrayMatrix[n.Outlook_RCLIENT_1600]=new e;n.DefaultSetArrayMatrix[n.Excel_WAC_1600]=new c;n.DefaultSetArrayMatrix[n.Word_WAC_1600]=new l;n.DefaultSetArrayMatrix[n.Outlook_WAC_1600]=new u;n.DefaultSetArrayMatrix[n.Outlook_WAC_1601]=new u;n.DefaultSetArrayMatrix[n.Project_RCLIENT_1600]=new h;n.DefaultSetArrayMatrix[n.Access_WAC_1600]=new y;n.DefaultSetArrayMatrix[n.PowerPoint_WAC_1600]=new a;n.DefaultSetArrayMatrix[n.Excel_IOS_1600]=new p;n.DefaultSetArrayMatrix[n.SWAY_WAC_1600]=new v;n.DefaultSetArrayMatrix[n.Word_IOS_1600]=new w;n.DefaultSetArrayMatrix[n.PowerPoint_IOS_1600]=new b;n.DefaultSetArrayMatrix[n.Outlook_IOS_1600]=new k},n.Excel_RCLIENT_1600="1-16.00",n.Word_RCLIENT_1600="2-16.00",n.PowerPoint_RCLIENT_1600="4-16.00",n.Outlook_RCLIENT_1600="8-16.00",n.Excel_WAC_1600="16-16.00",n.Word_WAC_1600="32-16.00",n.Outlook_WAC_1600="64-16.00",n.Outlook_WAC_1601="64-16.01",n.Project_RCLIENT_1600="128-16.00",n.Access_WAC_1600="256-16.00",n.PowerPoint_WAC_1600="512-16.00",n.Excel_IOS_1600="1024-16.01",n.SWAY_WAC_1600="2048-16.00",n.Word_IOS_1600="4096-16.00",n.PowerPoint_IOS_1600="8192-16.00",n.Outlook_IOS_1600="65536-16.00",n.DefaultSetArrayMatrix={},n}();n.RequirementsMatrixFactory=d})(n.Requirement||(n.Requirement={}));var t=n.Requirement}(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var t,n=!1;return{enableShortcut:function(){n||(window.Office?t=window.Office:OSF.OUtil.setNamespace("Office",window),window.Office=Microsoft.Office.WebExtension,n=!0)},disableShortcut:function(){n&&(t?window.Office=t:OSF.OUtil.unsetNamespace("Office",window),n=!1)}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(n){n?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(n,t){var i,r,o,u,f,e;if(n&&typeof n=="string"&&(r=n.indexOf("#"),r!=-1)){o=n.substring(0,r);u=n.substring(r+1);switch(o){case"binding":case"bindings":u&&(i=new OSF.DDA.BindingPromise(u))}}if(i)return i.onFail=t,i;else if(t)if(f=typeof t,f=="function")e={},e[Microsoft.Office.WebExtension.Parameters.Callback]=t,OSF.DDA.issueAsyncResult(e,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,f);};OSF.DDA.Context=function(n,t,i,r,u){var f=this,e,o;OSF.OUtil.defineEnumerableProperties(f,{contentLanguage:{value:n.get_dataLocale()},displayLanguage:{value:n.get_appUILocale()},touchEnabled:{value:n.get_touchEnabled()},commerceAllowed:{value:n.get_commerceAllowed()}});t&&OSF.OUtil.defineEnumerableProperty(f,"document",{value:t});i&&OSF.OUtil.defineEnumerableProperty(f,"license",{value:i});r&&(e=r.displayName||"appOM",delete r.displayName,OSF.OUtil.defineEnumerableProperty(f,e,{value:r}));u&&OSF.OUtil.defineEnumerableProperty(f,"officeTheme",{get:function(){return u()}});o=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(n);OSF.OUtil.defineEnumerableProperty(f,"requirements",{value:o})};OSF.DDA.OutlookContext=function(n,t,i,r,u){OSF.DDA.OutlookContext.uber.constructor.call(this,n,null,i,r,u);t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(n,t){var i;switch(n.get_clientMode()){case OSF.ClientMode.ReadOnly:i=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:i=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t});OSF.OUtil.defineMutableProperties(this,{mode:{value:i},url:{value:n.get_docUrl()}})};OSF.DDA.JsomDocument=function(n,t,i){var r=this,u;OSF.DDA.JsomDocument.uber.constructor.call(r,n,i);t&&OSF.OUtil.defineEnumerableProperty(r,"bindings",{get:function(){return t}});u=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(r,[u.GetSelectedDataAsync,u.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(r,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var n;return OSF&&OSF._OfficeAppFactory&&(n=OSF._OfficeAppFactory.getContext()),n}});OSF.DDA.License=function(n){OSF.OUtil.defineEnumerableProperty(this,"value",{value:n})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(n){var t,i;for(t in n)i={},OSF.OUtil.defineEnumerableProperties(i,{id:{value:t},displayName:{value:n[t]}}),OSF.DDA.AsyncMethodNames[t]=i};OSF.DDA.AsyncMethodCall=function(n,t,i,r,u,f,e){function c(n,t){var u,i,r;for(u in n){if(i=n[u],r=t[u],i["enum"])switch(typeof r){case"string":if(OSF.OUtil.listContainsValue(i["enum"],r))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw s();}if(i.types&&!OSF.OUtil.listContainsValue(i.types,typeof r))throw s();}}function l(t,i,r){var f,u,h,e,l,a;if(t.lengtho+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(a=n.length-1;a>=o;a--){v=n[a];switch(typeof v){case"object":if(f)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else f=v;break;case h:if(l)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else l=v;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);}}f=f||{};for(y in t)OSF.OUtil.listContainsKey(f,y)||(e=undefined,s=t[y],s.calculate&&i&&(e=s.calculate(i,r,u)),e||s.defaultValue===undefined||(e=s.defaultValue),f[y]=e);if(l)if(f[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else f[Microsoft.Office.WebExtension.Parameters.Callback]=l;return c(t,f),f}var h="function",o=n.length,s=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,e)});this.verifyAndExtractCall=function(n,t,r){var e=l(n,t,r),c=a(n,e,t,r),u={},o,s,h;for(o in e)u[o]=e[o];for(s in c)u[s]=c[s];for(h in i)u[h]=i[h](t,r);return f&&(u=f(u,t,r)),u};this.processResponse=function(n,t,i,f){return n==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?r?r(t,i,f):t:u?u(n,t):OSF.DDA.ErrorCodeManager.getErrorArgs(n)};this.getCallArgs=function(n){for(var t,u,r,i=n.length-1;i>=o;i--){r=n[i];switch(typeof r){case"object":t=r;break;case h:u=r}}return t=t||{},u&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=u),t}};OSF.DDA.AsyncMethodCallFactory=function(){function n(n){var i=null,r,t;if(n)for(i={},r=n.length,t=0;t=1?!0:(t=n.deserialize,n.deserialize=function(n){return c(n,!0,t)},n.__patchVersion=1,!0)}var r=new RegExp('"(\\\\.|[^"\\\\])*"',"g"),u=new RegExp("\\b(true|false|null)\\b","g"),f=new RegExp("-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?","g"),e=new RegExp("[^{:,\\[\\s](?=\\s*\\[)"),o=new RegExp("[^\\s\\[\\]{}:,]"),t="Cannot deserialize. The data does not correspond to valid JSON.";i()||s(n,"load",function(){i()})}(window);Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5};Microsoft.Office.Common.InvokeResultCode={noError:0,errorInRequest:-1,errorHandlingRequest:-2,errorInResponse:-3,errorHandlingResponse:-4,errorHandlingRequestAccessDenied:-5,errorHandlingMethodCallTimedout:-6};Microsoft.Office.Common.MessageType={request:0,response:1};Microsoft.Office.Common.ActionType={invoke:0,registerEvent:1,unregisterEvent:2};Microsoft.Office.Common.ResponseType={forCalling:0,forEventing:1};Microsoft.Office.Common.MethodObject=function(n,t,i){this._method=n;this._invokeType=t;this._blockingOthers=i};Microsoft.Office.Common.MethodObject.prototype={getMethod:function(){return this._method},getInvokeType:function(){return this._invokeType},getBlockingFlag:function(){return this._blockingOthers}};Microsoft.Office.Common.EventMethodObject=function(n,t){this._registerMethodObject=n;this._unregisterMethodObject=t};Microsoft.Office.Common.EventMethodObject.prototype={getRegisterMethodObject:function(){return this._registerMethodObject},getUnregisterMethodObject:function(){return this._unregisterMethodObject}};Microsoft.Office.Common.ServiceEndPoint=function(n){var t=this,i=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(i)throw i;t._methodObjectList={};t._eventHandlerProxyList={};t._Id=n;t._conversations={};t._policyManager=null;t._appDomains={}};Microsoft.Office.Common.ServiceEndPoint.prototype={registerMethod:function(n,t,i,r){var f="invokeType",u=!1,e=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:u},{name:"method",type:Function,mayBeNull:u},{name:f,type:Number,mayBeNull:u},{name:"blockingOthers",type:Boolean,mayBeNull:u}]),o;if(e)throw e;if(i!==Microsoft.Office.Common.InvokeType.async&&i!==Microsoft.Office.Common.InvokeType.sync)throw OsfMsAjaxFactory.msAjaxError.argument(f);o=new Microsoft.Office.Common.MethodObject(t,i,r);this._methodObjectList[n]=o},unregisterMethod:function(n){var t=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:!1}]);if(t)throw t;delete this._methodObjectList[n]},registerEvent:function(n,t,i){var r=!1,u=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:r},{name:"registerMethod",type:Function,mayBeNull:r},{name:"unregisterMethod",type:Function,mayBeNull:r}]),f;if(u)throw u;f=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(t,Microsoft.Office.Common.InvokeType.syncRegisterEvent,r),new Microsoft.Office.Common.MethodObject(i,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,r));this._methodObjectList[n]=f},registerEventEx:function(n,t,i,r,u){var f=!1,e=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:f},{name:"registerMethod",type:Function,mayBeNull:f},{name:"registerMethodInvokeType",type:Number,mayBeNull:f},{name:"unregisterMethod",type:Function,mayBeNull:f},{name:"unregisterMethodInvokeType",type:Number,mayBeNull:f}]),o;if(e)throw e;o=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(t,i,f),new Microsoft.Office.Common.MethodObject(r,u,f));this._methodObjectList[n]=o},unregisterEvent:function(n){var t=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:!1}]);if(t)throw t;this.unregisterMethod(n)},registerConversation:function(n,t,i,r){var f="appDomains",u=!0,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1},{name:"conversationUrl",type:String,mayBeNull:!1,optional:u},{name:f,type:Object,mayBeNull:u,optional:u},{name:"serializerVersion",type:Number,mayBeNull:u,optional:u}]);if(e)throw e;if(i){if(!(i instanceof Array))throw OsfMsAjaxFactory.msAjaxError.argument(f);this._appDomains[n]=i}this._conversations[n]={url:t,serializerVersion:r}},unregisterConversation:function(n){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;delete this._conversations[n]},setPolicyManager:function(n){var t="policyManager",i=Function._validateParams(arguments,[{name:t,type:Object,mayBeNull:!1}]);if(i)throw i;if(!n.checkPermission)throw OsfMsAjaxFactory.msAjaxError.argument(t);this._policyManager=n},getPolicyManager:function(){return this._policyManager}};Microsoft.Office.Common.ClientEndPoint=function(n,t,i,r){var f="targetWindow",u=this,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1},{name:f,mayBeNull:!1},{name:"targetUrl",type:String,mayBeNull:!1},{name:"serializerVersion",type:Number,mayBeNull:!0,optional:!0}]);if(e)throw e;if(!t.postMessage)throw OsfMsAjaxFactory.msAjaxError.argument(f);u._conversationId=n;u._targetWindow=t;u._targetUrl=i;u._callingIndex=0;u._callbackList={};u._eventHandlerList={};u._serializerVersion=r!=null?r:OSF.SerializerVersion.MsAjax};Microsoft.Office.Common.ClientEndPoint.prototype={invoke:function(n,t,i){var r=this,f=Function._validateParams(arguments,[{name:"targetMethodName",type:String,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"param",mayBeNull:!0}]),o,s;if(f)throw f;var u=r._callingIndex++,h=new Date,e={callback:t,createdOn:h.getTime()};i&&typeof i=="object"&&typeof i.__timeout__=="number"&&(e.timeout=i.__timeout__,delete i.__timeout__);r._callbackList[u]=e;try{o=new Microsoft.Office.Common.Request(n,Microsoft.Office.Common.ActionType.invoke,r._conversationId,u,i);s=Microsoft.Office.Common.MessagePackager.envelope(o,r._serializerVersion);r._targetWindow.postMessage(s,r._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(c){try{t!==null&&t(Microsoft.Office.Common.InvokeResultCode.errorInRequest,c)}finally{delete r._callbackList[u]}}},registerForEvent:function(n,t,i,r){var u=this,e=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:!1},{name:"eventHandler",type:Function,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"data",mayBeNull:!0,optional:!0}]),f,o,s,h;if(e)throw e;f=u._callingIndex++;o=new Date;u._callbackList[f]={callback:i,createdOn:o.getTime()};try{s=new Microsoft.Office.Common.Request(n,Microsoft.Office.Common.ActionType.registerEvent,u._conversationId,f,r);h=Microsoft.Office.Common.MessagePackager.envelope(s,u._serializerVersion);u._targetWindow.postMessage(h,u._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();u._eventHandlerList[n]=t}catch(c){try{i!==null&&i(Microsoft.Office.Common.InvokeResultCode.errorInRequest,c)}finally{delete u._callbackList[f]}}},unregisterForEvent:function(n,t,i){var r=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"data",mayBeNull:!0,optional:!0}]),u,e,o,s;if(f)throw f;u=r._callingIndex++;e=new Date;r._callbackList[u]={callback:t,createdOn:e.getTime()};try{o=new Microsoft.Office.Common.Request(n,Microsoft.Office.Common.ActionType.unregisterEvent,r._conversationId,u,i);s=Microsoft.Office.Common.MessagePackager.envelope(o,r._serializerVersion);r._targetWindow.postMessage(s,r._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(h){try{t!==null&&t(Microsoft.Office.Common.InvokeResultCode.errorInRequest,h)}finally{delete r._callbackList[u]}}finally{delete r._eventHandlerList[n]}}};Microsoft.Office.Common.XdmCommunicationManager=function(){function tt(n){for(var t in f)if(f[t]._conversations[n])return f[t];OsfMsAjaxFactory.msAjaxDebug.trace(a);throw OsfMsAjaxFactory.msAjaxError.argument(o);}function it(n){var t=i[n];if(!t){OsfMsAjaxFactory.msAjaxDebug.trace(a);throw OsfMsAjaxFactory.msAjaxError.argument(o);}return t}function rt(t,i){var r=t._methodObjectList[i._actionName],u;if(!r){OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+i._actionName);throw OsfMsAjaxFactory.msAjaxError.argument("messageObject");}return u=n,i._actionType===Microsoft.Office.Common.ActionType.invoke?r:i._actionType===Microsoft.Office.Common.ActionType.registerEvent?r.getRegisterMethodObject():r.getUnregisterMethodObject()}function ut(n){h.push(n)}function ft(){if(r!==n){if(!s)if(h.length>0){var t=h.shift();b(t)}else clearInterval(r),r=n}else OsfMsAjaxFactory.msAjaxDebug.trace(l)}function b(n){s=n.getInvokeBlockingFlag();n.invoke();c=(new Date).getTime()}function et(){var r,f,s,e,h,o,t;if(u){f=0;s=new Date;for(h in i){r=i[h];for(o in r._callbackList)if(t=r._callbackList[o],e=t.timeout?t.timeout:p,e>=0&&Math.abs(s.getTime()-t.createdOn)>=e)try{t.callback&&t.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,n)}finally{delete r._callbackList[o]}else f++}f===0&&(clearInterval(u),u=n)}else OsfMsAjaxFactory.msAjaxDebug.trace(l)}function ot(){s=t}function st(n){if(window.addEventListener)window.addEventListener("message",n,t);else if(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent)window.attachEvent("onmessage",n);else{OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API.");throw OsfMsAjaxFactory.msAjaxError.argument("Browser");}}function k(n,i){var f=t,r,u;return n===e?e:!n||!i||!n.length||!i.length?f:(r=document.createElement("a"),u=document.createElement("a"),r.href=n,u.href=i,f=d(r,u),delete r,u,f)}function ht(n,i){var u=t,f,e,r;if(!i||!i.length||!n||!(n instanceof Array)||!n.length)return u;for(f=document.createElement("a"),e=document.createElement("a"),f.href=i,r=0;rv)&&!s?(b(st),ct=t):r=setInterval(ft,v));ct&&ut(st)}catch(et){g=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;et==nt&&(g=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied);lt=new Microsoft.Office.Common.Response(u._actionName,u._conversationId,u._correlationId,g,Microsoft.Office.Common.ResponseType.forCalling,et);at=Microsoft.Office.Common.MessagePackager.envelope(lt,f);i.source&&i.source.postMessage&&i.source.postMessage(at,w)}}else if(u._messageType===Microsoft.Office.Common.MessageType.response){if(h=it(u._conversationId),h._serializerVersion=f,!k(h._targetUrl,i.origin))throw"Failed orgin check";if(u._responseType===Microsoft.Office.Common.ResponseType.forCalling){if(a=h._callbackList[u._correlationId],a)try{a.callback&&a.callback(u._errorCode,u._data)}finally{delete h._callbackList[u._correlationId]}}else y=h._eventHandlerList[u._actionName],y!==undefined&&y!==n&&y(u._data)}else return}}function g(){w||(st(ct),w=e)}var e=!0,l="channel is not ready.",o="conversationId",a="Unknown conversation Id.",t=!1,n=null,h=[],c=n,r=n,v=10,s=t,u=n,nt=2e3,y=65e3,p=y,f={},i={},w=t;return{connect:function(n,t,r,u){var f=i[n];return f||(g(),f=new Microsoft.Office.Common.ClientEndPoint(n,t,r,u),i[n]=f),f},getClientEndPoint:function(n){var r=Function._validateParams(arguments,[{name:o,type:String,mayBeNull:t}]);if(r)throw r;return i[n]},createServiceEndPoint:function(n){g();var t=new Microsoft.Office.Common.ServiceEndPoint(n);return f[n]=t,t},getServiceEndPoint:function(n){var i=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:t}]);if(i)throw i;return f[n]},deleteClientEndPoint:function(n){var r=Function._validateParams(arguments,[{name:o,type:String,mayBeNull:t}]);if(r)throw r;delete i[n]},_setMethodTimeout:function(n){var i=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:t}]);if(i)throw i;p=n<=0?y:n},_startMethodTimeoutTimer:function(){u||(u=setInterval(et,nt))}}}();Microsoft.Office.Common.Message=function(n,t,i,r,u){var e=!1,f=this,o=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:e},{name:"actionName",type:String,mayBeNull:e},{name:"conversationId",type:String,mayBeNull:e},{name:"correlationId",mayBeNull:e},{name:"data",mayBeNull:!0,optional:!0}]);if(o)throw o;f._messageType=n;f._actionName=t;f._conversationId=i;f._correlationId=r;f._origin=window.location.href;f._data=typeof u=="undefined"?null:u};Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}};Microsoft.Office.Common.Request=function(n,t,i,r,u){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,n,i,r,u);this._actionType=t};OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message);Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType};Microsoft.Office.Common.Response=function(n,t,i,r,u,f){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,n,t,i,f);this._errorCode=r;this._responseType=u};OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message);Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode};Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType};Microsoft.Office.Common.MessagePackager={envelope:function(n,t){return t==OSF.SerializerVersion.Browser&&typeof JSON!="undefined"?(typeof n=="object"&&(n._serializerVersion=t),JSON.stringify(n)):(typeof n=="object"&&(n._serializerVersion=OSF.SerializerVersion.MsAjax),OsfMsAjaxFactory.msAjaxSerializer.serialize(n))},unenvelope:function(n,t){return t==OSF.SerializerVersion.Browser&&typeof JSON!="undefined"?JSON.parse(n):OsfMsAjaxFactory.msAjaxSerializer.deserialize(n,!0)}};Microsoft.Office.Common.ResponseSender=function(n,t,i,r,u,f,e){var h=!1,o=this,c=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:h},{name:"requesterUrl",type:String,mayBeNull:h},{name:"actionName",type:String,mayBeNull:h},{name:"conversationId",type:String,mayBeNull:h},{name:"correlationId",mayBeNull:h},{name:"responsetype",type:Number,maybeNull:h},{name:"serializerVersion",type:Number,maybeNull:!0,optional:!0}]),s;if(c)throw c;o._requesterWindow=n;o._requesterUrl=t;o._actionName=i;o._conversationId=r;o._correlationId=u;o._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;o._responseType=f;s=o;o._send=function(n){try{var t=new Microsoft.Office.Common.Response(s._actionName,s._conversationId,s._correlationId,s._invokeResultCode,s._responseType,n),i=Microsoft.Office.Common.MessagePackager.envelope(t,e);s._requesterWindow.postMessage(i,s._requesterUrl)}catch(r){OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+r.message)}}};Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(n){this._invokeResultCode=n}};Microsoft.Office.Common.InvokeCompleteCallback=function(n,t,i,r,u,f,e){var s=this,o;Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(s,n,t,i,r,u,Microsoft.Office.Common.ResponseType.forCalling,e);s._postCallbackHandler=f;o=s;s._send=function(n){try{var t=new Microsoft.Office.Common.Response(o._actionName,o._conversationId,o._correlationId,o._invokeResultCode,o._responseType,n),i=Microsoft.Office.Common.MessagePackager.envelope(t,e);o._requesterWindow.postMessage(i,o._requesterUrl);o._postCallbackHandler()}catch(r){OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+r.message)}}};OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender);Microsoft.Office.Common.Invoker=function(n,t,i,r,u,f,e){var s=!0,h=!1,o=this,c=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:h},{name:"paramValue",mayBeNull:s},{name:"invokeCompleteCallback",mayBeNull:h},{name:"eventHandlerProxyList",mayBeNull:s},{name:"conversationId",type:String,mayBeNull:h},{name:"eventName",type:String,mayBeNull:h},{name:"serializerVersion",type:Number,mayBeNull:s,optional:s}]);if(c)throw c;o._methodObject=n;o._param=t;o._invokeCompleteCallback=i;o._eventHandlerProxyList=r;o._conversationId=u;o._eventName=f;o._serializerVersion=e};Microsoft.Office.Common.Invoker.prototype={invoke:function(){var n=this,t,i,u,r,f;try{switch(n._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:n._methodObject.getMethod()(n._param,n._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:t=n._methodObject.getMethod()(n._param);n._invokeCompleteCallback.getSend()(t);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent:i=n._createEventHandlerProxyObject(n._invokeCompleteCallback);t=n._methodObject.getMethod()(i.getSend(),n._param);n._eventHandlerProxyList[n._conversationId+n._eventName]=i.getSend();n._invokeCompleteCallback.getSend()(t);break;case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:u=n._eventHandlerProxyList[n._conversationId+n._eventName];t=n._methodObject.getMethod()(u,n._param);delete n._eventHandlerProxyList[n._conversationId+n._eventName];n._invokeCompleteCallback.getSend()(t);break;case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:r=n._createEventHandlerProxyObject(n._invokeCompleteCallback);n._methodObject.getMethod()(r.getSend(),n._invokeCompleteCallback.getSend(),n._param);n._eventHandlerProxyList[n._callerId+n._eventName]=r.getSend();break;case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:f=n._eventHandlerProxyList[n._callerId+n._eventName];n._methodObject.getMethod()(f,n._invokeCompleteCallback.getSend(),n._param);delete n._eventHandlerProxyList[n._callerId+n._eventName]}}catch(e){n._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);n._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(n){return new Microsoft.Office.Common.ResponseSender(n.getRequesterWindow(),n.getRequesterUrl(),n.getActionName(),n.getConversationId(),n.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing,this._serializerVersion)}};OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"};OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var n=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource],t={};OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,n,t)};OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]);OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.getDelegateMethods=function(){var n={};return n[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync,n[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync,n[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync,n};OSF.DDA.WAC.Delegate.version=1;OSF.DDA.WAC.Delegate.executeAsync=function(n){n.hostCallArgs||(n.hostCallArgs={});n.hostCallArgs.DdaMethod={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:n.dispId};n.hostCallArgs.__timeout__=-1;n.onCalling&&n.onCalling();var t=(new Date).getTime();OSF.getClientEndPoint().invoke("executeMethod",function(i,r){n.onReceiving&&n.onReceiving();var u;if(i==Microsoft.Office.Common.InvokeResultCode.noError)OSF.DDA.WAC.Delegate.version=r.Version,u=r.Error;else switch(i){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:u=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:u=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}n.onComplete&&n.onComplete(u,r);OSF.AppTelemetry&&OSF.AppTelemetry.onMethodDone(n.dispId,null,Math.abs((new Date).getTime()-t),u)},n.hostCallArgs)};OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(n,t){var i=(new Date).getTime();return function(r,u){t.onReceiving&&t.onReceiving();var f;if(r!=Microsoft.Office.Common.InvokeResultCode.noError)switch(r){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:f=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:f=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else f=u?u.Error?u.Error:OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess:OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;t.onComplete&&t.onComplete(f);OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(n,t.dispId,Math.abs((new Date).getTime()-i),f)}};OSF.DDA.WAC.Delegate.registerEventAsync=function(n){n.onCalling&&n.onCalling();OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(n.targetId,n.eventType),function(t){n.onEvent&&n.onEvent(t);OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(n.dispId)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,n),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:n.dispId,targetId:n.targetId})};OSF.DDA.WAC.Delegate.unregisterEventAsync=function(n){n.onCalling&&n.onCalling();OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(n.targetId,n.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,n),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:n.dispId,targetId:n.targetId})};OSF.OUtil.setNamespace("WebApp",OSF);OSF.WebApp.AddHostInfoAndXdmInfo=function(n){return OSF._OfficeAppFactory.getWindowLocationSearch&&OSF._OfficeAppFactory.getWindowLocationHash?n+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash():n};OSF.WebApp._UpdateLinksForHostAndXdmInfo=function(){for(var r,i,t=document.querySelectorAll("a[data-officejs-navigate]"),n=0;n0?n.substr(0,i):null,r=t!==null?t.toLowerCase()==="http"||t.toLowerCase()==="https":!0;return r&&n!="#"&&n!="/"&&n!=""&&n!=OSF._OfficeAppFactory.getWebAppState().webAppUrl};OSF.InitializationHelper=function(n,t,i,r,u){var f=this,e;f._hostInfo=n;f._webAppState=t;f._context=i;f._settings=r;f._hostFacade=u;f._initializeSettings=function(n,t){var e="undefined",r=n.get_settings(),u=OSF.OUtil.getSessionStorage(),i,f;return u&&(i=u.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()),i?r=typeof JSON!==e?JSON.parse(i):OsfMsAjaxFactory.msAjaxSerializer.deserialize(i,!0):(i=typeof JSON!==e?JSON.stringify(r):OsfMsAjaxFactory.msAjaxSerializer.serialize(r),u.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),i))),f=OSF.DDA.SettingsManager.deserializeSettings(r),t?new OSF.DDA.RefreshableSettings(f):new OSF.DDA.Settings(f)};e=function(n){var t=window.open;n.open=function(n,i,r){var u=null,f;try{u=t(n,i,r)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+e)}return u||(f={strUrl:n,strWindowName:i,strWindowFeatures:r},OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,f)),u}};e(window)};OSF.InitializationHelper.prototype.getAppContext=function(n,t){var r=function(n,i){var r,u,h,f,e,o,s;if(i._appName===OSF.AppName.ExcelWebApp){u=i._settings;r={};for(h in u)f=u[h],r[f[0]]=f[1]}else r=i._settings;if(n===0&&i._id!=undefined&&i._appName!=undefined&&i._appVersion!=undefined&&i._appUILocale!=undefined&&i._dataLocale!=undefined&&i._docUrl!=undefined&&i._clientMode!=undefined&&i._settings!=undefined&&i._reason!=undefined){var l=i._id,a=!1,v=!0,c=0;i._appMinorVersion!=undefined&&(c=i._appMinorVersion);e=undefined;i._requirementMatrix!=undefined&&(e=i._requirementMatrix);o=new OSF.OfficeAppContext(i._id,i._appName,i._appVersion,i._appUILocale,i._dataLocale,i._docUrl,i._clientMode,r,i._reason,i._osfControlType,i._eToken,i._correlationId,l,a,v,c,e);OSF.AppTelemetry&&OSF.AppTelemetry.initialize(o);t(o)}else{s="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+n+", exception: "+i;OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(s);throw s;}};try{this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",r,this._webAppState.id)}catch(i){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+i+"]");throw i;}};OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){var r="ContextActivationManager_notifyHost",t=!1,n,u,i,f,e,o;try{n=this;u=OSF.OUtil.parseXdmInfoWithGivenFragment(t,OSF._OfficeAppFactory.getWindowLocationHash());u&&(i=OSF.OUtil.getInfoItems(u),i!=undefined&&i.length>=3&&(n._webAppState.conversationID=i[0],n._webAppState.id=i[1],n._webAppState.webAppUrl=i[2]));n._webAppState.serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(t,OSF._OfficeAppFactory.getWindowLocationHash());n._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(n._webAppState.conversationID,n._webAppState.wnd,n._webAppState.webAppUrl,n._webAppState.serializerVersion);n._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(n._webAppState.id);f=n._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;n._webAppState.serviceEndPoint.registerConversation(f,n._webAppState.webAppUrl);e=function(){var i,t,r,u;if(!n._webAppState.focused)for(n._webAppState.focused=!0,i=document.querySelectorAll("input,a,button"),t=0;t40)&&(n=OSF.OUtil.Guid.generateNewGuid(),t.setValue(t.clientIDKey,n)),n},n.prototype.saveLog=function(n,t){var i=this,r=i.getValue(i.logIdSetKey);r=(r&&r.length>0?r+";":"")+n;i.setValue(i.logIdSetKey,r);i.setValue(n,t)},n.prototype.enumerateLog=function(n,t){var i=this,e=i.getValue(i.logIdSetKey),u,o,r,f;if(e){u=e.split(";");for(o in u)r=u[o],f=i.getValue(r),f&&(n&&n(r,f),t&&i.remove(r));t&&i.remove(i.logIdSetKey)}},n.prototype.getValue=function(n){var t=OSF.OUtil.getLocalStorage(),i="";return t&&(i=t.getItem(n)),i},n.prototype.setValue=function(n,t){var i=OSF.OUtil.getLocalStorage();i&&i.setItem(n,t)},n.prototype.remove=function(n){var t=OSF.OUtil.getLocalStorage();if(t)try{t.removeItem(n)}catch(i){}},n}(),f=function(){function n(){}return n.prototype.LogData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n.SerializeRow(),OSF.Logger.SendFlag.none)},n.prototype.LogRawData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n,OSF.Logger.SendFlag.none)},n}();n.initialize=c;n.onAppActivated=l;n.onScriptDone=a;n.onCallDone=v;n.onMethodDone=y;n.onPropertyDone=p;n.onEventDone=w;n.onRegisterDone=b;n.onAppClosed=k;n.setOsfControlAppCorrelationId=d;n.doAppInitializationLogging=s;n.logAppCommonMessage=g;n.logAppException=nt;OSF.AppTelemetry=n}(OSFAppTelemetry||(OSFAppTelemetry={}));Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed",Pdf:"pdf"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FileProperties:"FileProperties",FileSliceProperties:"FileSliceProperties"});OSF.DDA.FileProperties={Handle:"FileHandle",FileSize:"FileSize",SliceSize:Microsoft.Office.WebExtension.Parameters.SliceSize};OSF.DDA.File=function(n,t,i){var r,u;OSF.OUtil.defineEnumerableProperties(this,{size:{value:t},sliceCount:{value:Math.ceil(t/i)}});r={};r[OSF.DDA.FileProperties.Handle]=n;r[OSF.DDA.FileProperties.SliceSize]=i;u=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[u.GetDocumentCopyChunkAsync,u.ReleaseDocumentCopyAsync],r)};OSF.DDA.FileSliceOffset="fileSliceoffset";OSF.DDA.AsyncMethodNames.addNames({GetDocumentCopyAsync:"getFileAsync",GetDocumentCopyChunkAsync:"getSliceAsync",ReleaseDocumentCopyAsync:"closeAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.FileType,"enum":Microsoft.Office.WebExtension.FileType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:{types:["number"],defaultValue:4194304}}],checkCallArgs:function(n){var t=n[Microsoft.Office.WebExtension.Parameters.SliceSize];if(t<=0||t>4194304)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return n},onSucceeded:function(n,t,i){return new OSF.DDA.File(n[OSF.DDA.FileProperties.Handle],n[OSF.DDA.FileProperties.FileSize],i[Microsoft.Office.WebExtension.Parameters.SliceSize])}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(n,t){return t[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(n,t){return t[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(n,t,i){var r=n[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(r<0||r>=t.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;return n[OSF.DDA.FileSliceOffset]=parseInt((r*i[OSF.DDA.FileProperties.SliceSize]).toString()),n},onSucceeded:function(n,t,i){var r={};return OSF.OUtil.defineEnumerableProperties(r,{data:{value:n[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:i[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:n[OSF.DDA.FileProperties.SliceSize]}}),r}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(n,t){return t[OSF.DDA.FileProperties.Handle]}}]});OSF.OUtil.setNamespace("Marshaling",OSF.DDA);OSF.OUtil.setNamespace("File",OSF.DDA.Marshaling),function(n){var t="FileSize";n[n.Handle=0]="Handle";n[n[t]=1]=t}(OSF_DDA_Marshaling_File_FilePropertiesKeys||(OSF_DDA_Marshaling_File_FilePropertiesKeys={}));OSF.DDA.Marshaling.File.FilePropertiesKeys=OSF_DDA_Marshaling_File_FilePropertiesKeys,function(n){var t="SliceSize";n[n.Data=0]="Data";n[n[t]=1]=t}(OSF_DDA_Marshaling_File_SlicePropertiesKeys||(OSF_DDA_Marshaling_File_SlicePropertiesKeys={}));OSF.DDA.Marshaling.File.SlicePropertiesKeys=OSF_DDA_Marshaling_File_SlicePropertiesKeys,function(n){var t="Compressed";n[n.Text=0]="Text";n[n[t]=1]=t;n[n.Pdf=2]="Pdf"}(OSF_DDA_Marshaling_File_FileType||(OSF_DDA_Marshaling_File_FileType={}));OSF.DDA.Marshaling.File.FileType=OSF_DDA_Marshaling_File_FileType,function(n){var t="SliceIndex",i="SliceSize",r="FileType";n[n[r]=0]=r;n[n[i]=1]=i;n[n.Handle=2]="Handle";n[n[t]=3]=t}(OSF_DDA_Marshaling_File_ParameterKeys||(OSF_DDA_Marshaling_File_ParameterKeys={}));OSF.DDA.Marshaling.File.ParameterKeys=OSF_DDA_Marshaling_File_ParameterKeys;OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties);OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle},{name:OSF.DDA.FileProperties.FileSize,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data},{name:OSF.DDA.FileProperties.SliceSize,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:OSF.DDA.Marshaling.File.FileType.Text},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:OSF.DDA.Marshaling.File.FileType.Compressed},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:OSF.DDA.Marshaling.File.FileType.Pdf}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:OSF.DDA.Marshaling.File.ParameterKeys.FileType},{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceSize}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle},{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle}]});Microsoft.Office.WebExtension.TableData=function(n,t){function i(n){if(n==null||n==undefined)return null;try{for(var t=OSF.DDA.DataCoercion.findArrayDimensionality(n,2);t<2;t++)n=[n];return n}catch(i){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{get:function(){return t},set:function(n){t=i(n)}},rows:{get:function(){return n},set:function(t){n=t==null||OSF.OUtil.isArray(t)&&t.length==0?[]:i(t)}}});this.headers=t;this.rows=n};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureTableData=function(n){return new Microsoft.Office.WebExtension.TableData(n[OSF.DDA.TableDataProperties.TableRows],n[OSF.DDA.TableDataProperties.TableHeaders])};Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"};OSF.DDA.DataCoercion=function(){var n=null;return{findArrayDimensionality:function(n){if(OSF.OUtil.isArray(n)){for(var t=0,i=0;i6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix&&(i=new Date(parseInt(t.slice(5,-1))),i)?i:t}):Sys.Serialization.JavaScriptSerializer.deserialize(t,!0);r[i]=t}catch(u){}}return r}};OSF.DDA.Settings=function(n){var t="name",i;n=n||{};i=function(n){var i=OSF.OUtil.getSessionStorage(),t,r;i&&(t=OSF.DDA.SettingsManager.serializeSettings(n),r=JSON?JSON.stringify(t):Sys.Serialization.JavaScriptSerializer.serialize(t),i.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),r))};OSF.OUtil.defineEnumerableProperties(this,{get:{value:function(i){var u=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1}]),r;if(u)throw u;return r=n[i],typeof r=="undefined"?null:r}},set:{value:function(r,u){var f=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1},{name:"value",mayBeNull:!0}]);if(f)throw f;n[r]=u;i(n)}},remove:{value:function(r){var u=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1}]);if(u)throw u;delete n[r];i(n)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],n)};OSF.DDA.RefreshableSettings=function(n){OSF.DDA.RefreshableSettings.uber.constructor.call(this,n);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],n);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(n){var t,i;this._eventHandlers={};for(t in n)i=n[t],this._eventHandlers[i]=[]};OSF.EventDispatch.prototype={getSupportedEvents:function(){var n=[];for(var t in this._eventHandlers)n.push(t);return n},supportsEvent:function(n){var t=!1;for(var i in this._eventHandlers)if(n==i){t=!0;break}return t},hasEventHandler:function(n,t){var i=this._eventHandlers[n],r;if(i&&i.length>0)for(r in i)if(i[r]===t)return!0;return!1},addEventHandler:function(n,t){if(typeof t!="function")return!1;var i=this._eventHandlers[n];return i&&!this.hasEventHandler(n,t)?(i.push(t),!0):!1},removeEventHandler:function(n,t){var i=this._eventHandlers[n],r;if(i&&i.length>0)for(r=0;r0?(this._eventHandlers[n]=[],!0):!1},getEventHandlerCount:function(n){return this._eventHandlers[n]!=undefined?this._eventHandlers[n].length:-1},fireEvent:function(n){var t,i,r;if(n.type==undefined)return!1;if(t=n.type,t&&this._eventHandlers[t]){i=this._eventHandlers[t];for(r in i)i[r](n);return!0}else return!1}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(n,t,i){var u=this,r;switch(n){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:r=new OSF.DDA.DocumentSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:r=new OSF.DDA.BindingSelectionChangedEventArgs(u.manufactureBinding(i,t.document),i[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:r=new OSF.DDA.BindingDataChangedEventArgs(u.manufactureBinding(i,t.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:r=new OSF.DDA.SettingsChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:r=new OSF.DDA.ActiveViewChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:r=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:r=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:r=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(i);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:r=new OSF.DDA.NodeInsertedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:r=new OSF.DDA.NodeReplacedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:r=new OSF.DDA.NodeDeletedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:r=new OSF.DDA.TaskSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:r=new OSF.DDA.ResourceSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:r=new OSF.DDA.ViewSelectionChangedEventArgs(t);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,n));}return r};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:n}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n){var t=n[OSF.DDA.SettingsManager.SerializedSettings];return OSF.DDA.SettingsManager.deserializeSettings(t)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:!0}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(n,t){return OSF.DDA.SettingsManager.serializeSettings(t)}}]});OSF.DDA.WAC.SettingsTranslator=function(){var n=0,t=1;return{read:function(i){var u,e,f,r;if(i.Settings){r={};u=i.Settings;for(e in u)f=u[e],r[f[n]]=f[t];return r}else return typeof window.OSFPPTWAC!="undefined"?i:{}},write:function(i){var f=[],u,r;for(u in i)r=[],r[n]=u,r[t]=i[u],f.push(r);return f}}}();OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings,{toHost:OSF.DDA.WAC.SettingsTranslator.write,fromHost:OSF.DDA.WAC.SettingsTranslator.read});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SettingsRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:"OverwriteIfStale"},{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}],invertible:!0});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SettingsRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType};OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.BindingPromise=function(n,t){this._id=n;OSF.OUtil.defineEnumerableProperty(this,"onFail",{get:function(){return t},set:function(n){var i=typeof n;if(i!="undefined"&&i!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,i);t=n}})};OSF.DDA.BindingPromise.prototype={_fetch:function(n){var t=this,i;return t.binding?n&&n(t.binding):t._binding||(i=t,Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(t._id,function(t){t.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded?(OSF.OUtil.defineEnumerableProperty(i,"binding",{value:t.value}),n&&n(i.binding)):i.onFail&&i.onFail(t)})),t},getDataAsync:function(){var n=arguments;return this._fetch(function(t){t.getDataAsync.apply(t,n)}),this},setDataAsync:function(){var n=arguments;return this._fetch(function(t){t.setDataAsync.apply(t,n)}),this},addHandlerAsync:function(){var n=arguments;return this._fetch(function(t){t.addHandlerAsync.apply(t,n)}),this},removeHandlerAsync:function(){var n=arguments;return this._fetch(function(t){t.removeHandlerAsync.apply(t,n)}),this}};OSF.DDA.BindingFacade=function(n){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:n});var t=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[t.AddFromSelectionAsync,t.AddFromNamedItemAsync,t.GetAllAsync,t.GetByIdAsync,t.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(n,t){OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:n}})};OSF.DDA.Binding=function(n,t){var r,u,i,f;OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:n}});r=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[r.GetDataAsync,r.SetDataAsync]);u=Microsoft.Office.WebExtension.EventType;i=t.bindings._eventDispatches;i[n]||(i[n]=new OSF.EventDispatch([u.BindingSelectionChanged,u.BindingDataChanged]));f=i[n];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.generateBindingId=function(){return"UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureBinding=function(n,t){var r=n[OSF.DDA.BindingProperties.Id],u=n[OSF.DDA.BindingProperties.RowCount],f=n[OSF.DDA.BindingProperties.ColumnCount],s=n[OSF.DDA.BindingProperties.HasHeaders],i,e,o;switch(n[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:i=new OSF.DDA.TextBinding(r,t);break;case Microsoft.Office.WebExtension.BindingType.Matrix:i=new OSF.DDA.MatrixBinding(r,t,u,f);break;case Microsoft.Office.WebExtension.BindingType.Table:e=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument};o=e()&&OSF.DDA.ExcelTableBinding?OSF.DDA.ExcelTableBinding:OSF.DDA.TableBinding;i=new o(r,t,u,f,s);break;default:i=new OSF.DDA.UnknownBinding(r,t)}return i};OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"}),function(){function u(n){return OSF.DDA.OMFactory.manufactureBinding(n,Microsoft.Office.WebExtension.context.document)}function f(n){return n.id}function e(n,t,i){var u=n[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&u&&(u[OSF.DDA.TableDataProperties.TableRows]!=undefined||u[OSF.DDA.TableDataProperties.TableHeaders]!=undefined)&&(u=OSF.DDA.OMFactory.manufactureTableData(u)),u=OSF.DDA.DataCoercion.coerceData(u,i[Microsoft.Office.WebExtension.Parameters.CoercionType]),u==undefined?r:u}var t="number",i="object",n="string",r=null;OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[n],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}}],privateStateCallbacks:[],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[n]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[n],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return!0}}],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n){return OSF.OUtil.mapList(n[OSF.DDA.ListDescriptors.BindingList],u)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[n]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[n]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n,t,i){var r=i[Microsoft.Office.WebExtension.Parameters.Id];delete t._eventDispatches[r]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n,t){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[i,n],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[t],defaultValue:0}}],checkCallArgs:function(n,t){if(n[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&n[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&n[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&n[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0&&(delete n[Microsoft.Office.WebExtension.Parameters.StartRow],delete n[Microsoft.Office.WebExtension.Parameters.StartColumn],delete n[Microsoft.Office.WebExtension.Parameters.RowCount],delete n[Microsoft.Office.WebExtension.Parameters.ColumnCount]),n[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[Microsoft.Office.WebExtension.Parameters.StartRow]||n[Microsoft.Office.WebExtension.Parameters.StartColumn]||n[Microsoft.Office.WebExtension.Parameters.RowCount]||n[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[n,i,t,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[i,n],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}}],checkCallArgs:function(n,t){if(n[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&n[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&(delete n[Microsoft.Office.WebExtension.Parameters.StartRow],delete n[Microsoft.Office.WebExtension.Parameters.StartColumn]),n[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[Microsoft.Office.WebExtension.Parameters.StartRow]||n[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}]})}();OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{TableDataProperties:"TableDataProperties"});OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.DDA.TableBinding=function(n,t,i,r,u){OSF.DDA.TableBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:i?i:0},columnCount:{value:r?r:0},hasHeaders:{value:u?u:!1}});var f=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[f.AddRowsAsync,f.AddColumnsAsync,f.DeleteAllDataValuesAsync])};OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddRowsAsync:"addRowsAsync",AddColumnsAsync:"addColumnsAsync",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync"}),function(){function n(n){return n.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]})}();OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.BindingRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:"ItemName"},{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:"BindingType"},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:"PromptText"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:"SampleData"},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:"FailOnCollision"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:2},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:3},{name:Microsoft.Office.WebExtension.BindingType.Table,value:1}],invertible:!0});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:"Name"},{name:OSF.DDA.BindingProperties.Type,value:"BindingType"},{name:OSF.DDA.BindingProperties.RowCount,value:"RowCount"},{name:OSF.DDA.BindingProperties.ColumnCount,value:"ColCount"},{name:OSF.DDA.BindingProperties.HasHeaders,value:"HasHeaders"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]});OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.MatrixBinding=function(n,t,i,r){OSF.DDA.MatrixBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:i?i:0},columnCount:{value:r?r:0}})};OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding);OSF.DDA.TextBinding=function(n,t){OSF.DDA.TextBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})};OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddFromPromptAsync:"addFromPromptAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromPromptAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:{types:["string"],calculate:function(){return Strings.OfficeOM.L_AddBindingFromPromptDefaultText}}},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:function(n){return OSF.DDA.OMFactory.manufactureBinding(n,Microsoft.Office.WebExtension.context.document)}});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"});OSF.DDA.DocumentSelectionChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:n}})};OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{BindingSelectionChangedEvent:"BindingSelectionChangedEvent"});OSF.DDA.BindingSelectionChangedEventArgs=function(n,t){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:n}});for(var i in t)OSF.OUtil.defineEnumerableProperty(this,i,{value:t[i]})};OSF.DDA.BindingDataChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:n}})};OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.BindingSelectionChangedEvent);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.WAC.UniqueArguments.BindingEventSource},{name:OSF.DDA.PropertyDescriptors.Subset,value:OSF.DDA.PropertyDescriptors.Subset}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.WAC.UniqueArguments.BindingEventSource}]});OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"});Microsoft.Office.WebExtension.FileProperties=function(n){OSF.OUtil.defineEnumerableProperties(this,{url:{value:n[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(n){return new Microsoft.Office.WebExtension.FileProperties(n)}});OSF.OUtil.setNamespace("Marshaling",OSF.DDA),function(n){var t="Properties";n[n[t]=0]=t;n[n.Url=1]="Url"}(OSF_DDA_Marshaling_FilePropertiesKeys||(OSF_DDA_Marshaling_FilePropertiesKeys={}));OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys;OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:OSF.DDA.FilePropertiesDescriptor.Url,value:OSF.DDA.Marshaling.FilePropertiesKeys.Url}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:OSF.DDA.Marshaling.FilePropertiesKeys.Properties}]});Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"};Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"};Microsoft.Office.WebExtension.Index={First:"first",Last:"last",Next:"next",Previous:"previous"};OSF.DDA.AsyncMethodNames.addNames({GoToByIdAsync:"goToByIdAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GoToByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string","number"]},{name:Microsoft.Office.WebExtension.Parameters.GoToType,"enum":Microsoft.Office.WebExtension.GoToType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:{"enum":Microsoft.Office.WebExtension.SelectionMode,defaultValue:Microsoft.Office.WebExtension.SelectionMode.Default}}]});OSF.OUtil.setNamespace("Marshaling",OSF.DDA);OSF.DDA.Marshaling.NavigationKeys={NavigationRequest:"DdaGoToByIdMethod",Id:"Id",GoToType:"GoToType",SelectionMode:"SelectionMode"},function(n){var t="NamedItem";n[n.Binding=0]="Binding";n[n[t]=1]=t;n[n.Slide=2]="Slide";n[n.Index=3]="Index"}(OSF_DDA_Marshaling_GoToType||(OSF_DDA_Marshaling_GoToType={}));OSF.DDA.Marshaling.GoToType=OSF_DDA_Marshaling_GoToType,function(n){var t="Selected";n[n.Default=0]="Default";n[n[t]=1]=t;n[n.None=2]="None"}(OSF_DDA_Marshaling_SelectionMode||(OSF_DDA_Marshaling_SelectionMode={}));OSF.DDA.Marshaling.SelectionMode=OSF_DDA_Marshaling_SelectionMode;OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.Marshaling.NavigationKeys.NavigationRequest);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.NavigationKeys.Id},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:OSF.DDA.Marshaling.NavigationKeys.GoToType},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:OSF.DDA.Marshaling.NavigationKeys.SelectionMode}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:OSF.DDA.Marshaling.GoToType.Binding},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:OSF.DDA.Marshaling.GoToType.NamedItem},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:OSF.DDA.Marshaling.GoToType.Slide},{name:Microsoft.Office.WebExtension.GoToType.Index,value:OSF.DDA.Marshaling.GoToType.Index}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:OSF.DDA.Marshaling.SelectionMode.Default},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:OSF.DDA.Marshaling.SelectionMode.Selected},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:OSF.DDA.Marshaling.SelectionMode.None}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.ExcelTableBinding=function(n,t,i,r,u){var f=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[f.ClearFormatsAsync,f.SetTableOptionsAsync,f.SetFormatsAsync]);OSF.DDA.ExcelTableBinding.uber.constructor.call(this,n,t,i,r,u);OSF.OUtil.finalizeProperties(this)};OSF.OUtil.extend(OSF.DDA.ExcelTableBinding,OSF.DDA.TableBinding),function(){var t="number",n="object",i="string";OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[i,n,t,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:[n],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:[n],defaultValue:[]}}],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[i,n,t,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[n,i],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[n],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:[n],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:[n],defaultValue:[]}}],checkCallArgs:function(n,t){var i=Microsoft.Office.WebExtension.Parameters;if(n[i.StartRow]==0&&n[i.StartColumn]==0&&OSF.OUtil.isArray(n[i.CellFormat])&&n[i.CellFormat].length===0&&OSF.OUtil.isArray(n[i.TableOptions])&&n[i.TableOptions].length===0&&(delete n[i.StartRow],delete n[i.StartColumn],delete n[i.CellFormat],delete n[i.TableOptions]),n[i.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[i.StartRow]&&n[i.StartRow]!=0||n[i.StartColumn]&&n[i.StartColumn]!=0||n[i.CellFormat]||n[i.TableOptions]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:function(n){return n.id}}]});OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function(){var n=arguments;return this._fetch(function(t){t.setTableOptionsAsync.apply(t,n)}),this};OSF.DDA.BindingPromise.prototype.setFormatsAsync=function(){var n=arguments;return this._fetch(function(t){t.setFormatsAsync.apply(t,n)}),this};OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function(){var n=arguments;return this._fetch(function(t){t.clearFormatsAsync.apply(t,n)}),this}}(),function(){function n(n){return n.id}OSF.DDA.AsyncMethodNames.addNames({ClearFormatsAsync:"clearFormatsAsync",SetTableOptionsAsync:"setTableOptionsAsync",SetFormatsAsync:"setFormatsAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ClearFormatsAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TableOptions,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetFormatsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CellFormat,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]})}();OSF.OUtil.setNamespace("Marshaling",OSF.DDA);OSF.DDA.Marshaling.FormatKeys={Id:"BindingId",CellFormat:"CellFormat",TableOptions:"TableOptions"},function(n){var t="totalRow",i="filterButton",r="bandedColumns",u="lastColumn",f="firstColumn",e="bandedRows",o="headerRow";n[n[o]=0]=o;n[n[e]=1]=e;n[n[f]=2]=f;n[n[u]=3]=u;n[n[r]=4]=r;n[n[i]=5]=i;n[n.style=6]="style";n[n[t]=7]=t}(OSF_DDA_Marshaling_TableOptionProperties||(OSF_DDA_Marshaling_TableOptionProperties={}));OSF.DDA.Marshaling.TableOptionProperties=OSF_DDA_Marshaling_TableOptionProperties,function(n){n[n.row=0]="row";n[n.column=1]="column"}(OSF_DDA_Marshaling_CellProperties||(OSF_DDA_Marshaling_CellProperties={}));OSF.DDA.Marshaling.CellProperties=OSF_DDA_Marshaling_CellProperties,function(n){var t="wrapping",i="numberFormat",r="indentRight",u="indentLeft",f="fontNormal",e="fontSubscript",o="fontSuperscript",s="fontStrikethrough",h="fontDirection",c="fontColor",l="fontUnderlineStyle",a="fontSize",v="fontStyle",y="fontFamily",p="borderInlineColor",w="borderInlineStyle",b="borderOutlineColor",k="borderOutlineStyle",d="borderRightColor",g="borderRightStyle",nt="borderLeftColor",tt="borderLeftStyle",it="borderBottomColor",rt="borderBottomStyle",ut="borderTopColor",ft="borderTopStyle",et="borderColor",ot="borderStyle",st="backgroundColor",ht="alignVertical",ct="alignHorizontal";n[n[ct]=1]=ct;n[n[ht]=2]=ht;n[n[st]=101]=st;n[n[ot]=201]=ot;n[n[et]=202]=et;n[n[ft]=203]=ft;n[n[ut]=204]=ut;n[n[rt]=205]=rt;n[n[it]=206]=it;n[n[tt]=207]=tt;n[n[nt]=208]=nt;n[n[g]=209]=g;n[n[d]=210]=d;n[n[k]=211]=k;n[n[b]=212]=b;n[n[w]=213]=w;n[n[p]=214]=p;n[n[y]=301]=y;n[n[v]=302]=v;n[n[a]=303]=a;n[n[l]=304]=l;n[n[c]=305]=c;n[n[h]=306]=h;n[n[s]=307]=s;n[n[o]=308]=o;n[n[e]=309]=e;n[n[f]=310]=f;n[n[u]=401]=u;n[n[r]=402]=r;n[n[i]=501]=i;n[n.width=701]="width";n[n.height=702]="height";n[n[t]=703]=t}(OSF_DDA_Marshaling_CellFormatProperties||(OSF_DDA_Marshaling_CellFormatProperties={}));OSF.DDA.Marshaling.CellFormatProperties=OSF_DDA_Marshaling_CellFormatProperties,function(n){var t="slantDashDot",i="mediumDashDotDot",r="dashDotDot",u="mediumDashDot",f="mediumDashed";n[n.none=0]="none";n[n.thin=1]="thin";n[n.medium=2]="medium";n[n.dashed=3]="dashed";n[n.dotted=4]="dotted";n[n.thick=5]="thick";n[n.double=6]="double";n[n.hair=7]="hair";n[n[f]=8]=f;n[n.dashDot=9]="dashDot";n[n[u]=10]=u;n[n[r]=11]=r;n[n[i]=12]=i;n[n[t]=13]=t}(OSF_DDA_Marshaling_BorderStyleType||(OSF_DDA_Marshaling_BorderStyleType={}));OSF.DDA.Marshaling.BorderStyleType=OSF_DDA_Marshaling_BorderStyleType,function(n){var t="automatic",i="turquoise";n[n.none=0]="none";n[n.black=1]="black";n[n.blue=2]="blue";n[n.gray=3]="gray";n[n.green=4]="green";n[n.orange=5]="orange";n[n.pink=6]="pink";n[n.purple=7]="purple";n[n.red=8]="red";n[n.teal=9]="teal";n[n[i]=10]=i;n[n.violet=11]="violet";n[n.white=12]="white";n[n.yellow=13]="yellow";n[n[t]=14]=t}(OSF_DDA_Marshaling_ColorType||(OSF_DDA_Marshaling_ColorType={}));OSF.DDA.Marshaling.ColorType=OSF_DDA_Marshaling_ColorType,function(n){var t="distributed",i="centerAcrossSelection";n[n.general=0]="general";n[n.left=1]="left";n[n.center=2]="center";n[n.right=3]="right";n[n.fill=4]="fill";n[n.justify=5]="justify";n[n[i]=6]=i;n[n[t]=7]=t}(OSF_DDA_Marshaling_AlignHorizontalType||(OSF_DDA_Marshaling_AlignHorizontalType={}));OSF.DDA.Marshaling.AlignHorizontalType=OSF_DDA_Marshaling_AlignHorizontalType,function(n){var t="distributed";n[n.top=0]="top";n[n.center=1]="center";n[n.bottom=2]="bottom";n[n.justify=3]="justify";n[n[t]=4]=t}(OSF_DDA_Marshaling_AlignVerticalType||(OSF_DDA_Marshaling_AlignVerticalType={}));OSF.DDA.Marshaling.AlignVerticalType=OSF_DDA_Marshaling_AlignVerticalType,function(n){var t="boldItalic";n[n.regular=0]="regular";n[n.italic=1]="italic";n[n.bold=2]="bold";n[n[t]=3]=t}(OSF_DDA_Marshaling_FontStyleType||(OSF_DDA_Marshaling_FontStyleType={}));OSF.DDA.Marshaling.FontStyleType=OSF_DDA_Marshaling_FontStyleType,function(n){var t="doubleAccounting",i="singleAccounting";n[n.none=0]="none";n[n.single=1]="single";n[n.double=2]="double";n[n[i]=3]=i;n[n[t]=4]=t}(OSF_DDA_Marshaling_FontUnderlineStyleType||(OSF_DDA_Marshaling_FontUnderlineStyleType={}));OSF.DDA.Marshaling.FontUnderlineStyleType=OSF_DDA_Marshaling_FontUnderlineStyleType,function(n){var t="rightToLeft",i="leftToRight";n[n.context=0]="context";n[n[i]=1]=i;n[n[t]=2]=t}(OSF_DDA_Marshaling_FontDirectionType||(OSF_DDA_Marshaling_FontDirectionType={}));OSF.DDA.Marshaling.FontDirectionType=OSF_DDA_Marshaling_FontDirectionType,function(n){n[n.autoFit=-1]="autoFit"}(OSF_DDA_Marshaling_WidthType||(OSF_DDA_Marshaling_WidthType={}));OSF.DDA.Marshaling.WidthType=OSF_DDA_Marshaling_WidthType,function(n){n[n.autoFit=-1]="autoFit"}(OSF_DDA_Marshaling_HeightType||(OSF_DDA_Marshaling_HeightType={}));OSF.DDA.Marshaling.HeightType=OSF_DDA_Marshaling_HeightType,function(){var e=null,p="undefined",k="auto fit",d="distributed",b="none",s=OSF.DDA.Marshaling.AlignHorizontalType,a=OSF.DDA.Marshaling.AlignVerticalType,f=OSF.DDA.Marshaling.BorderStyleType,t=OSF.DDA.Marshaling.CellFormatProperties,g=OSF.DDA.Marshaling.CellProperties,u=OSF.DDA.Marshaling.ColorType,w=OSF.DDA.Marshaling.FontDirectionType,y=OSF.DDA.Marshaling.FontStyleType,v=OSF.DDA.Marshaling.FontUnderlineStyleType,nt=OSF.DDA.Marshaling.HeightType,c=OSF.DDA.Marshaling.FormatKeys,r=Microsoft.Office.WebExtension.Parameters,n=OSF.DDA.WAC.Delegate.ParameterMap,o=OSF.DDA.Marshaling.TableOptionProperties,tt=OSF.DDA.Marshaling.WidthType;Microsoft.Office.WebExtension.Table={All:0,Data:1,Headers:2};n.define({type:OSF.DDA.WAC.UniqueArguments.ClearFormats,toHost:[{name:r.Id,value:c.Id}]});n.define({type:OSF.DDA.MethodDispId.dispidClearFormatsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.ClearFormats,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});n.define({type:OSF.DDA.WAC.UniqueArguments.SetFormats,toHost:[{name:r.Id,value:c.Id},{name:r.CellFormat,value:c.CellFormat},{name:r.TableOptions,value:c.TableOptions}]});n.define({type:OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetFormats,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});n.define({type:OSF.DDA.MethodDispId.dispidSetFormatsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetFormats,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});n.define({type:OSF.DDA.WAC.UniqueArguments.SetData,toHost:[{name:r.Id,value:c.Id},{name:r.CoercionType,value:"CoerceType"},{name:r.Data,value:OSF.DDA.WAC.UniqueArguments.Data},{name:r.Rows,value:"Rows"},{name:r.Columns,value:"Columns"},{name:r.StartRow,value:"StartRow"},{name:r.StartColumn,value:"StartCol"},{name:r.CellFormat,value:c.CellFormat},{name:r.TableOptions,value:c.TableOptions}]});n.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});n.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});var i={alignHorizontal:{text:"alignHorizontal",type:t.alignHorizontal},alignVertical:{text:"alignVertical",type:t.alignVertical},backgroundColor:{text:"backgroundColor",type:t.backgroundColor},borderStyle:{text:"borderStyle",type:t.borderStyle},borderColor:{text:"borderColor",type:t.borderColor},borderTopStyle:{text:"borderTopStyle",type:t.borderTopStyle},borderTopColor:{text:"borderTopColor",type:t.borderTopColor},borderBottomStyle:{text:"borderBottomStyle",type:t.borderBottomStyle},borderBottomColor:{text:"borderBottomColor",type:t.borderBottomColor},borderLeftStyle:{text:"borderLeftStyle",type:t.borderLeftStyle},borderLeftColor:{text:"borderLeftColor",type:t.borderLeftColor},borderRightStyle:{text:"borderRightStyle",type:t.borderRightStyle},borderRightColor:{text:"borderRightColor",type:t.borderRightColor},borderOutlineStyle:{text:"borderOutlineStyle",type:t.borderOutlineStyle},borderOutlineColor:{text:"borderOutlineColor",type:t.borderOutlineColor},borderInlineStyle:{text:"borderInlineStyle",type:t.borderInlineStyle},borderInlineColor:{text:"borderInlineColor",type:t.borderInlineColor},fontFamily:{text:"fontFamily",type:t.fontFamily},fontStyle:{text:"fontStyle",type:t.fontStyle},fontSize:{text:"fontSize",type:t.fontSize},fontUnderlineStyle:{text:"fontUnderlineStyle",type:t.fontUnderlineStyle},fontColor:{text:"fontColor",type:t.fontColor},fontDirection:{text:"fontDirection",type:t.fontDirection},fontStrikethrough:{text:"fontStrikethrough",type:t.fontStrikethrough},fontSuperscript:{text:"fontSuperscript",type:t.fontSuperscript},fontSubscript:{text:"fontSubscript",type:t.fontSubscript},fontNormal:{text:"fontNormal",type:t.fontNormal},indentLeft:{text:"indentLeft",type:t.indentLeft},indentRight:{text:"indentRight",type:t.indentRight},numberFormat:{text:"numberFormat",type:t.numberFormat},width:{text:"width",type:t.width},height:{text:"height",type:t.height},wrapping:{text:"wrapping",type:t.wrapping}},l=[{name:b,value:f.none},{name:"thin",value:f.thin},{name:"medium",value:f.medium},{name:"dashed",value:f.dashed},{name:"dotted",value:f.dotted},{name:"thick",value:f.thick},{name:"double",value:f.double},{name:"hair",value:f.hair},{name:"medium dashed",value:f.mediumDashed},{name:"dash dot",value:f.dashDot},{name:"medium dash dot",value:f.mediumDashDot},{name:"dash dot dot",value:f.dashDotDot},{name:"medium dash dot dot",value:f.mediumDashDotDot},{name:"slant dash dot",value:f.slantDashDot}],h=[{name:b,value:u.none},{name:"black",value:u.black},{name:"blue",value:u.blue},{name:"gray",value:u.gray},{name:"green",value:u.green},{name:"orange",value:u.orange},{name:"pink",value:u.pink},{name:"purple",value:u.purple},{name:"red",value:u.red},{name:"teal",value:u.teal},{name:"turquoise",value:u.turquoise},{name:"violet",value:u.violet},{name:"white",value:u.white},{name:"yellow",value:u.yellow},{name:"automatic",value:u.automatic}];n.define({type:i.alignHorizontal.text,toHost:[{name:"general",value:s.general},{name:"left",value:s.left},{name:"center",value:s.center},{name:"right",value:s.right},{name:"fill",value:s.fill},{name:"justify",value:s.justify},{name:"center across selection",value:s.centerAcrossSelection},{name:d,value:s.distributed}]});n.define({type:i.alignVertical.text,toHost:[{name:"top",value:a.top},{name:"center",value:a.center},{name:"bottom",value:a.bottom},{name:"justify",value:a.justify},{name:d,value:a.distributed}]});n.define({type:i.backgroundColor.text,toHost:h});n.define({type:i.borderStyle.text,toHost:l});n.define({type:i.borderColor.text,toHost:h});n.define({type:i.borderTopStyle.text,toHost:l});n.define({type:i.borderTopColor.text,toHost:h});n.define({type:i.borderBottomStyle.text,toHost:l});n.define({type:i.borderBottomColor.text,toHost:h});n.define({type:i.borderLeftStyle.text,toHost:l});n.define({type:i.borderLeftColor.text,toHost:h});n.define({type:i.borderRightStyle.text,toHost:l});n.define({type:i.borderRightColor.text,toHost:h});n.define({type:i.borderOutlineStyle.text,toHost:l});n.define({type:i.borderOutlineColor.text,toHost:h});n.define({type:i.borderInlineStyle.text,toHost:l});n.define({type:i.borderInlineColor.text,toHost:h});n.define({type:i.fontStyle.text,toHost:[{name:"regular",value:y.regular},{name:"italic",value:y.italic},{name:"bold",value:y.bold},{name:"bold italic",value:y.boldItalic}]});n.define({type:i.fontUnderlineStyle.text,toHost:[{name:b,value:v.none},{name:"single",value:v.single},{name:"double",value:v.double},{name:"single accounting",value:v.singleAccounting},{name:"double accounting",value:v.doubleAccounting}]});n.define({type:i.fontColor.text,toHost:h});n.define({type:i.fontDirection.text,toHost:[{name:"context",value:w.context},{name:"left-to-right",value:w.leftToRight},{name:"right-to-left",value:w.rightToLeft}]});n.define({type:i.width.text,toHost:[{name:k,value:tt.autoFit}]});n.define({type:i.height.text,toHost:[{name:k,value:nt.autoFit}]});n.define({type:r.TableOptions,toHost:[{name:"headerRow",value:o.headerRow},{name:"bandedRows",value:o.bandedRows},{name:"firstColumn",value:o.firstColumn},{name:"lastColumn",value:o.lastColumn},{name:"bandedColumns",value:o.bandedCoumns},{name:"filterButton",value:o.filterButton},{name:"style",value:o.style},{name:"totalRow",value:o.totalRow}]});n.dynamicTypes[r.CellFormat]={toHost:function(t){for(var i in t)t[i].format&&(t[i].format=n.doMapValues(t[i].format,"toHost"));return t},fromHost:function(n){return n}};n.setDynamicType(r.CellFormat,{toHost:function(n){var s="cells",a="format",y=0,w=1,v=[],h,t,r,u,f,e,c,l,o;for(h in n){if(t=n[h],r=[],typeof t[s]!==p){if(u=t[s],typeof t[s]=="object"){f=[];for(e in u)typeof g[e]!==p&&(f[g[e]]=u[e])}else f=u;r[y]=f}if(t[a]){c=t[a];l=[];for(o in c)typeof i[o]!==p&&l.push([i[o].type,c[o]]);r[w]=l}v[h]=r}return v},fromHost:function(n){return n}});n.setDynamicType(r.TableOptions,{toHost:function(n){var i=[];for(var t in n)typeof o[t]!=p&&(i[o[t]]=n[t]);return i},fromHost:function(n){return n}});s=e;a=e;f=e;t=e;u=e;w=e;y=e;v=e;nt=e;c=e;tt=e}(AgaveFormatAPI||(AgaveFormatAPI={}));OSF.DDA.AsyncMethodNames.addNames({ExecuteRichApiRequestAsync:"executeRichApiRequestAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[]});OSF.OUtil.setNamespace("RichApi",OSF.DDA);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.ArrayData}],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType,{OnlyVisible:"onlyVisible"}),function(n){(function(t){var u=function(){function r(){var n=this,t=n;n._pseudoDocument=u;n._eventDispatch=u;n._processAppCommandInvocation=function(n){var i=t._verifyManifestCallback(n.callbackName),r;if(i.errorCode!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){t._invokeAppCommandCompletedMethod(n.appCommandId,i.errorCode,"");return}r=t._constructEventObjectForCallback(n);r?window.setTimeout(function(){i.callback(r)},0):t._invokeAppCommandCompletedMethod(n.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,"")}}var f="object",e="string",u=null;return r.initializeOsfDda=function(){OSF.DDA.AsyncMethodNames.addNames({AppCommandInvocationCompletedAsync:"appCommandInvocationCompletedAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[e]},{name:Microsoft.Office.WebExtension.Parameters.Status,types:["number"]},{name:Microsoft.Office.WebExtension.Parameters.Data,types:[e]}]});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{AppCommandInvokedEvent:"AppCommandInvokedEvent"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{AppCommandInvoked:"appCommandInvoked"});OSF.OUtil.setNamespace("AppCommand",OSF.DDA);OSF.DDA.AppCommand.AppCommandInvokedEventArgs=n.AppCommand.AppCommandInvokedEventArgs},r.prototype.initializeAndChangeOnce=function(n){var i=this,r;t.registerDdaFacade();i._pseudoDocument={};OSF.DDA.DispIdHost.addAsyncMethods(i._pseudoDocument,[OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync]);i._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.AppCommandInvoked]);r=function(t){n&&(t.status=="succeeded"?n(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):n(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError))};OSF.DDA.DispIdHost.addEventSupport(i._pseudoDocument,i._eventDispatch);i._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked,i._processAppCommandInvocation,r)},r.prototype._verifyManifestCallback=function(n){var e={callback:u,errorCode:OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback},o;n=n.trim();try{for(var t=n.split("."),i=window,r=0;r0},enumerable:!0,configurable:!0}),t.prototype.addTrace=function(n,t){this.m_traceInfos[n]=t},t.prototype.addReferencedObjectPath=function(t){if(!this.m_referencedObjectPaths[t.objectPathInfo.Id])for(t.isValid||n.Utility.throwError(n.ResourceStrings.invalidObjectPath,n.Utility.getObjectPathExpression(t));t;)t.isWriteOperation&&(this.m_flags=this.m_flags|1),this.m_referencedObjectPaths[t.objectPathInfo.Id]=t,t.objectPathInfo.ObjectPathType==3&&this.addReferencedObjectPaths(t.argumentObjectPaths),t=t.parentObjectPath},t.prototype.addReferencedObjectPaths=function(n){if(n)for(var t=0;t0&&(f=i.substr(0,u),e=i.substr(u+1),f=n.Utility.trim(f),e=n.Utility.trim(e),this.m_responseHeaders[f.toUpperCase()]=e))},t.UNSENT=0,t.OPENED=1,t.DONE=4,t.settings=new i,t}();n.OfficeXHR=t}(OfficeExtension||(OfficeExtension={})),function(n){function i(){n.Promise||t.Init()}n._EnsurePromise=i;var t;(function(t){function i(){(function(){"use strict";function wt(n){return typeof n=="function"||typeof n=="object"&&n!==null}function b(n){return typeof n=="function"}function bt(n){return typeof n=="object"&&n!==null}function kt(n){k=n}function dt(n){f=n}function ti(){var t=process.nextTick,n=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(n)&&n[1]==="0"&&n[2]==="10"&&(t=setImmediate),function(){t(c)}}function ii(){return function(){tt(c)}}function ri(){var n=0,i=new ut(c),t=document.createTextNode("");return i.observe(t,{characterData:!0}),function(){t.data=n=++n%2}}function ui(){var n=new MessageChannel;return n.port1.onmessage=c,function(){n.port2.postMessage(0)}}function ft(){return function(){setTimeout(c,1)}}function c(){for(var t,i,n=0;n0?".":"")+i;break;case 3:i=t.normalizeName(n.objectPathInfo.Name)+"()"+(i.length>0?".":"")+i;break;case 4:i=t.normalizeName(n.objectPathInfo.Name)+(i.length>0?".":"")+i;break;case 5:i="getItem()"+(i.length>0?".":"")+i;break;case 6:i="_reference()"+(i.length>0?".":"")+i;break}n=n.parentObjectPath}return i},t._createPromiseFromResult=function(t){return n._EnsurePromise(),new n.Promise(function(n,i){n(t)})},t._addActionResultHandler=function(n,t,i){n.context._pendingRequest.addActionResultHandler(t,i)},t._handleNavigationPropertyResults=function(n,i,r){for(var u=0;u 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage=_getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart=window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd==-1) { + sessionKeyEnd=window.name.length; + } + var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue=osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString=window.location.search; + var conversationId=null; + if (searchString) { + var index=searchString.indexOf("&"); + + conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') { + conversationId=conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId=decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items=strInfo.split("$"); + if (typeof items[1]=="undefined") { + items=strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl=''; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items=OSF.OUtil.getInfoItems(xdmInfoValue); + if (items !=undefined && items.length >=3) { + conversationUrl=items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e=Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e=Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !=='undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor=descriptor || {}; + for (var nd in attributes) { + var attribute=attributes[nd]; + if (descriptor[attribute]==undefined) { + descriptor[attribute]=true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors=descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor=descriptor || {}; + var props=Object.getOwnPropertyNames(obj); + var propsLength=props.length; + for (var i=0; i < propsLength; i++) { + var prop=props[i]; + var desc=Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable=descriptor.writable || false; + } + desc.configurable=descriptor.configurable || false; + desc.enumerable=descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret=[]; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key==item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value==list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add=list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key]=value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2]=newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj)==="[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj)==="[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj)==="[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on"+eventName, listener); + } else { + element["on"+eventName]=listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on"+eventName, listener); + } else { + element["on"+eventName]=null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp=new XMLHttpRequest(); + xmlhttp.onreadystatechange=function () { + if (xmlhttp.readyState==4) { + if (xmlhttp.status==200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/="; + var output=[]; + var temp=[]; + var index=0; + var c1, c2, c3, a, b, c; + var i; + var length=input.length; + do { + c1=input.charCodeAt(index++); + c2=input.charCodeAt(index++); + c3=input.charCodeAt(index++); + i=0; + a=c1 & 255; + b=c1 >> 8; + c=c2 & 255; + temp[i++]=a >> 2; + temp[i++]=((a & 3) << 4) | (b >> 4); + temp[i++]=((b & 15) << 2) | (c >> 6); + temp[i++]=c & 63; + if (!isNaN(c2)) { + a=c2 >> 8; + b=c3 & 255; + c=c3 >> 8; + temp[i++]=a >> 2; + temp[i++]=((a & 3) << 4) | (b >> 4); + temp[i++]=((b & 15) << 2) | (c >> 6); + temp[i++]=c & 63; + } + if (isNaN(c2)) { + temp[i - 1]=64; + } else if (isNaN(c3)) { + temp[i - 2]=64; + temp[i - 1]=64; + } + for (var t=0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage=window.localStorage; + } catch (ex) { + localStorage=null; + } + _safeLocalStorage=new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick=function (e) { + handler(); + }; + element.ontouchend=function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e=Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj=sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property]=sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid=(function () { + var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result=""; + var tick=(new Date()).getTime(); + var index=0; + + for (; index < 32 && tick > 0; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[tick % 16]; + tick=Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF=OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName={ + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker={ + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker={ + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction={ + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants={ + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id=id; + this._appName=appName; + this._appVersion=appVersion; + this._appUILocale=appUILocale; + this._dataLocale=dataLocale; + this._docUrl=docUrl; + this._clientMode=clientMode; + this._settings=settings; + this._reason=reason; + this._osfControlType=osfControlType; + this._eToken=eToken; + this._correlationId=correlationId; + this._appInstanceId=appInstanceId; + this._touchEnabled=touchEnabled; + this._commerceAllowed=commerceAllowed; + this._appMinorVersion=appMinorVersion; + this._requirementMatrix=requirementMatrix; + this.get_id=function get_id() { + return this._id; + }; + this.get_appName=function get_appName() { + return this._appName; + }; + this.get_appVersion=function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale=function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale=function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl=function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode=function get_clientMode() { + return this._clientMode; + }; + this.get_bindings=function get_bindings() { + return this._bindings; + }; + this.get_settings=function get_settings() { + return this._settings; + }; + this.get_reason=function get_reason() { + return this._reason; + }; + this.get_osfControlType=function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken=function get_eToken() { + return this._eToken; + }; + this.get_correlationId=function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId=function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled=function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed=function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion=function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementMatrix=function get_requirementMatrix() { + return this._requirementMatrix; + }; +}; +OSF.OsfControlType={ + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode={ + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason={ + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat={ + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType={ + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters={ + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + ImageLeft: "imageLeft", + ImageTop: "imageTop", + ImageWidth: "imageWidth", + ImageHeight: "imageHeight", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode={ + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors={ + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors={}; +OSF.DDA.ListDescriptors={}; + +OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId+"_"+eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId={ + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId={ + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager=(function () { + var _errorMappings={}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode]=errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix=(function () { + function RequirementMatrix(_setMap) { + this.isSetSupported=function _isSetSupported(name, minVersion) { + if (name==undefined) { + return false; + } + if (minVersion==undefined) { + minVersion=0; + } + var setSupportArray=this._setMap; + var sets=setSupportArray._sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion=sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >=minVersion; + } else { + return false; + } + }; + this._setMap=_setMap; + } + return RequirementMatrix; + })(); + Requirement.RequirementMatrix=RequirementMatrix; + var DefaultSetRequirement=(function () { + function DefaultSetRequirement(setMap) { + this._sets=setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement=DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement=(function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement=(function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement=(function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement=(function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement=(function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement=(function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement=(function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement=(function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement=(function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement=(function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement=(function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement=(function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement=(function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement=(function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement=(function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory=(function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda=function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix=undefined; + if (appContext.get_requirementMatrix() !=undefined && typeof (JSON) !=="undefined") { + var matrixItem=JSON.parse(appContext.get_requirementMatrix()); + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion=appContext.get_appMinorVersion(); + var appMinorVersionString=""; + if (appMinorVersion < 10) { + appMinorVersionString="0"+appMinorVersion; + } else { + appMinorVersionString=""+appMinorVersion; + } + + var appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString; + var appLocator=appContext.get_appName()+"-"+appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) { + defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix=function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600="16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600="32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600="256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600="1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600="4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix={}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement={})); + var Requirement=OfficeExt.Requirement; +})(OfficeExt || (OfficeExt={})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode={ + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode={ + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager=(function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut=false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice=window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office=Microsoft.Office.WebExtension; + _useShortcut=true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office=_userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut=false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str=="string") { + var index=str.indexOf("#"); + if (index !=-1) { + var op=str.substring(0, index); + var target=str.substring(index+1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise=new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType=typeof errorCallback; + if (callbackType=="function") { + var callArgs={}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail=errorCallback; + return promise; + } +}; + +OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName=appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context=OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License=function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties={ + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus={ + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode={ + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties={ + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames={}; +OSF.DDA.AsyncMethodNames.addNames=function (methodNames) { + for (var entry in methodNames) { + var am={}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry]=am; + } +}; +OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount=requiredParameters.length; + var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param=params[name]; + var arg=args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs=[]; + var index; + for (index=0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret={}; + for (index=0; index < requiredCount; index++) { + var param=requiredParameters[index]; + var arg=requiredArgs[index]; + if (param.verify) { + var isValid=param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name]=arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount+2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i=userArgs.length - 1; i >=requiredCount; i--) { + var argument=userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options=argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback=argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options=options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value=undefined; + var option=supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value=option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !==undefined) { + value=option.defaultValue; + } + options[optionName]=value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs={}; + for (var r in required) { + callArgs[r]=required[r]; + } + for (var o in options) { + callArgs[o]=options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s]=privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs=checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload=onSucceeded(response, caller, callArgs); + } else { + payload=response; + } + } else { + if (onFailed) { + payload=onFailed(status, response); + } else { + payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs=function (suppliedArgs) { + var options, parameterCallback; + + for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) { + var argument=suppliedArgs[i]; + switch (typeof argument) { + case "object": + options=argument; + break; + case "function": + parameterCallback=argument; + break; + } + } + options=options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory=(function () { + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls={}; +OSF.DDA.AsyncMethodCalls.define=function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error=function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs={}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload; + } else { + errorArgs={}; + payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType=(function () { + var listTypes={}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t]=prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap=function (specialProcessor, mappings) { + var toHostMap="toHost"; + var fromHostMap="fromHost"; + + var self="self"; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={ + toHost: function (data) { + if (data !=null && data.rows !==undefined) { + var tableData={}; + tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers; + data=tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret=preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage=preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image=[]; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image=dynamicTypes[entry][mapping](preimage); + } else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) { + image=mapValues(preimage, mapping); + } else { + var maps=mappings[entry]; + if (maps) { + var map=maps[mapping]; + if (map) { + image=map[preimage]; + if (image===undefined) { + image=preimage; + } + } + } else { + image=preimage; + } + } + ret[entry]=image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg=generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg=imageSet[param]; + } + if (arg !=undefined) { + if (!ret) { + ret={}; + } + var index=parameters[param]; + + if (index==self) { + index=param; + } + ret[index]=specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted={}; + } + for (var param in parameters) { + var index=parameters[param]; + var value; + + if (index==self) { + value=source; + } else { + value=source[index]; + } + if (value===null || value===undefined) { + extracted[param]=undefined; + } else { + value=specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map=mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param]=extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map={}; + var entryDescriptor=OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor]=self; + for (var item in value) { + value[item]=extractArguments(value[item], map); + } + } + extracted[param]=value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters=mappings[mapName][mapping]; + var image; + if (mapping=="toHost") { + var imageSet=mapValues(preimage, mapping); + image=generateArguments(imageSet, parameters); + } else if (mapping=="fromHost") { + var argumentSet=extractArguments(preimage, parameters); + image=mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings={}; + } + this.addMapping=function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost=description.map; + fromHost={}; + for (var preimage in toHost) { + var image=toHost[preimage]; + + if (image==self) { + image=preimage; + } + fromHost[image]=preimage; + } + } else { + toHost=description.toHost; + fromHost=description.fromHost; + } + var pair=mappings[mapName]; + if (pair) { + var currMap=pair[toHostMap]; + for (var th in currMap) + toHost[th]=currMap[th]; + currMap=pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh]=currMap[fh]; + } else { + pair=mappings[mapName]={}; + } + pair[toHostMap]=toHost; + pair[fromHostMap]=fromHost; + }; + this.toHost=function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost=function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self=self; + this.addComplexType=function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType=function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType=function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes=dynamicTypes; + this.doMapValues=function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) { + this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt]=handler; + }; + this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn=[]; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn=pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) { + var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor); + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + parameterMap.define=function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + + if (definition.invertible) { + args.map=toHost; + } else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods={ + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates={ + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap={}; + var jsom=OSF.DDA.AsyncMethodNames; + var did=OSF.DDA.MethodDispId; + + var methodMap={ + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id]=methodMap[method]; + } + } + + jsom=Microsoft.Office.WebExtension.EventType; + did=OSF.DDA.EventDispId; + var eventMap={ + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]]=eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex=="number") { + if (!callArgs) { + callArgs=asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName=method.id; + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId=dispIdMap[methodName]; + var delegate=getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs=parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs=callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs=parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs=hostResponseArgs; + } + } else { + responseArgs=hostResponseArgs; + } + var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added=eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args=parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler===null) { + removeSuccess=eventDispatch.clearEventHandlers(eventType); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess=eventDispatch.removeEventHandler(eventType, handler); + status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method=asyncMethodNames[entry]; + var name=method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; + +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if (rows==1 && cols==1) { + ret=[vbArr]; + } else { + ret=[]; + for (var row=0; row < rows; row++) { + var rowArr=[]; + for (var col=0; col < cols; col++) { + var datum=vbArr[row * cols+col]; + if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[]; + var dynamicTypes={}; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if (dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if (array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + }; + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray; + value=toArraySupported ? arg.toArray() : arg || {}; + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +}; + +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); + +OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [ + { + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 }, + { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 } + ] + }, + { + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 } + ] + } +]); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 }, + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 } + ] +}); +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + function fromSafeArray(value) { + var ret=value; + if (value !=null && value.toArray) { + var arrayResult=value.toArray(); + for (var i=0; i < arrayResult.length; i++) { + arrayResult[i]=fromSafeArray(arrayResult[i]); + } + ret=arrayResult; + } + return ret; + } + try { + if (args.onCalling) { + args.onCalling(); + } + var startTime=(new Date()).getTime(); + OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) { + var payload=result[OSF.DDA.SafeArray.Response.Payload]; + payload=fromSafeArray(payload); + if (payload !=null) { + if (!args._chunkResultData) { + args._chunkResultData=new Array(); + } + + args._chunkResultData[payload[0]]=payload[1]; + } + } else { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + if (args._chunkResultData) { + payload=fromSafeArray(payload); + if (payload !=null) { + var expectedChunkCount=payload[payload.length - 1]; + if (args._chunkResultData.length==expectedChunkCount) { + payload[payload.length - 1]=args._chunkResultData; + } else { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + } + } else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + }); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; + +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; + +OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo=hostInfo; + this._webAppState=webAppState; + this._context=context; + this._settings=settings; + this._hostFacade=hostFacade; + this._initializeSettings=this.initializeSettings; +}; +OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) { + var settings; + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings=(typeof (JSON) !=="undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings=(typeof (JSON) !=="undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings=new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings=new OSF.DDA.Settings(deserializedSettings); + } + return settings; +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + var license=new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler=(OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler)); + var getDelegateMethods, parameterMap; + getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); +}; +OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { + return OSF.DDA.RichInitializationReason[appContext.get_reason()]; +}; + +OSF.DDA.DispIdHost.getClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + + if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) { + var readSerializedSettings=function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings); + } + if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) { + var writeSerializedSettings=function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings); + } + return delegateMethods; +}; + +var OSFRichclient; +(function (OSFRichclient) { + var RichClientHostController=(function () { + function RichClientHostController() { + } + RichClientHostController.prototype.execute=function (id, params, callback) { + window.external.Execute(id, params, callback); + }; + RichClientHostController.prototype.registerEvent=function (id, targetId, handler, callback) { + window.external.RegisterEvent(id, targetId, handler, callback); + }; + RichClientHostController.prototype.unregisterEvent=function (id, targetId, callback) { + window.external.UnregisterEvent(id, targetId, callback); + }; + return RichClientHostController; + })(); + OSFRichclient.RichClientHostController=RichClientHostController; +})(OSFRichclient || (OSFRichclient={})); +OSF.ClientHostController=new OSFRichclient.RichClientHostController(); + +var OfficeExt; +(function (OfficeExt) { + (function (OfficeTheme) { + var OfficeThemeManager=(function () { + function OfficeThemeManager() { + this._osfOfficeTheme=null; + this._osfOfficeThemeTimeStamp=null; + } + OfficeThemeManager.prototype.getOfficeTheme=function () { + if (OSF.DDA._OsfControlContext) { + if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0); + } + } else { + var startTime=(new Date()).getTime(); + var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo(); + var endTime=(new Date()).getTime(); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime)); + } + + this._osfOfficeTheme=JSON.parse(osfOfficeTheme); + for (var color in this._osfOfficeTheme) { + this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]); + } + this._osfOfficeThemeTimeStamp=endTime; + } + return this._osfOfficeTheme; + } + }; + + OfficeThemeManager.instance=function () { + if (OfficeThemeManager._instance==null) { + OfficeThemeManager._instance=new OfficeThemeManager(); + } + return OfficeThemeManager._instance; + }; + OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5000; + + OfficeThemeManager._instance=null; + return OfficeThemeManager; + })(); + OfficeTheme.OfficeThemeManager=OfficeThemeManager; + + OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA); + OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme; + })(OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={})); + var OfficeTheme=OfficeExt.OfficeTheme; +})(OfficeExt || (OfficeExt={})); + +OSF.DDA.ClientSettingsManager={ + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + try { + response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name: Strings.OfficeOM.L_InternalError, message: ex }; + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Read(keys, values); + if (onReceiving) { + onReceiving(); + } + var serializedSettings={}; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + return serializedSettings; + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) { + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Write(keys, values); + if (onReceiving) { + onReceiving(); + } + } +}; + +OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported) { + var serializedSettings=OSF.DDA.ClientSettingsManager.read(); + var settings=this.deserializeSettings(serializedSettings, refreshSupported); + return settings; +}; +OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var returnedContext; + var context=OSF.DDA._OsfControlContext=window.external.GetContext(); + var appType=context.GetAppType(); + var appTypeSupported=false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry]==appType) { + appTypeSupported=true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type "+appType; + } + var id=context.GetSolutionRef(); + var version=context.GetAppVersionMajor(); + var minorVersion=context.GetAppVersionMinor(); + var UILocale=context.GetAppUILocale(); + var dataLocale=context.GetAppDataLocale(); + var docUrl=context.GetDocUrl(); + var clientMode=context.GetAppCapabilities(); + var reason=context.GetActivationMode(); + var osfControlType=context.GetControlIntegrationLevel(); + var settings=[]; + var eToken; + try { + eToken=context.GetSolutionToken(); + } catch (ex) { + } + var correlationId; + + if (typeof context.GetCorrelationId !=="undefined") { + correlationId=context.GetCorrelationId(); + } + var appInstanceId; + if (typeof context.GetInstanceId !=="undefined") { + appInstanceId=context.GetInstanceId(); + } + var touchEnabled; + if (typeof context.GetTouchEnabled !=="undefined") { + touchEnabled=context.GetTouchEnabled(); + } + var commerceAllowed; + if (typeof context.GetCommerceAllowed !=="undefined") { + commerceAllowed=context.GetCommerceAllowed(); + } + var requirementMatrix; + if (typeof context.GetSupportedMatrix !=="undefined") { + requirementMatrix=context.GetSupportedMatrix(); + } + eToken=eToken ? eToken.toString() : ""; + returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData=(function () { + function BaseUsageData(table) { + this._table=table; + this._fields={}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields=function () { + }; + BaseUsageData.prototype.SetSerializedField=function (key, value) { + if (typeof (value) !=="undefined" && value !==null) { + this._serializedFields[key]=value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow=function () { + this._serializedFields={}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData=BaseUsageData; + var AppActivatedUsageData=(function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"]=value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData=AppActivatedUsageData; + var ScriptLoadUsageData=(function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData=ScriptLoadUsageData; + var AppClosedUsageData=(function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"]=value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData=AppClosedUsageData; + var APIUsageUsageData=(function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"]=value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData=APIUsageUsageData; + var AppInitializationUsageData=(function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"]=value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData=AppInitializationUsageData; +})(OSFLog || (OSFLog={})); + +var Logger; +(function (Logger) { + "use strict"; + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"]=0]="info"; + TraceLevel[TraceLevel["warning"]=1]="warning"; + TraceLevel[TraceLevel["error"]=2]="error"; + })(Logger.TraceLevel || (Logger.TraceLevel={})); + var TraceLevel=Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"]=0]="none"; + SendFlag[SendFlag["flush"]=1]="flush"; + })(Logger.SendFlag || (Logger.SendFlag={})); + var SendFlag=Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData=allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs=JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog=sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy=(function () { + function ULSEndpointProxy() { + var _this=this; + this.proxyFrame=null; + this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer=[]; + this.proxyFrameReady=false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog=function (log) { + if (this.proxyFrameReady===true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame=function () { + if (this.proxyFrame==null) { + this.proxyFrame=document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) { + var _this=this; + if (e.data==="ProxyFrameReadyToLog") { + this.proxyFrameReady=true; + for (var i=0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length=0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data==="ProxyFrameReadyToInit") { + var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr=JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger=Logger; + } + + Logger.ulsEndpoint=creatULSEndpoint(); +})(Logger || (Logger={})); + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId=OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId=""; + + ; + + var AppInfo=(function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event=(function () { + function Event(name, handler) { + this.name=name; + this.handler=handler; + } + return Event; + })(); + var AppStorage=(function () { + function AppStorage() { + this.clientIDKey="Office API client"; + this.logIdSetKey="Office App Log Id Set"; + } + AppStorage.prototype.getClientId=function () { + var clientId=this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <=0 || clientId.length > 40) { + clientId=OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog=function (logId, log) { + var logIdSet=this.getValue(this.logIdSetKey); + logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog=function (callback, clean) { + var logIdSet=this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids=logIdSet.split(";"); + for (var id in ids) { + var logId=ids[id]; + var log=this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + var value=""; + if (osfLocalStorage) { + value=osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue=function (key, value) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger=(function () { + function AppLogger() { + } + AppLogger.prototype.LogData=function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData=function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo=new AppInfo(); + appInfo.hostVersion=context.get_appVersion(); + appInfo.appId=context.get_id(); + appInfo.host=context.get_appName(); + appInfo.browser=window.navigator.userAgent; + appInfo.correlationId=context.get_correlationId(); + appInfo.clientId=(new AppStorage()).getClientId(); + var index=location.href.indexOf("?"); + appInfo.appURL=(index==-1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId=""; + appInfo.userId=""; + try { + xmlContent=decodeURIComponent(token); + parser=new DOMParser(); + xmlDoc=parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent=null; + xmlDoc=null; + parser=null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime=new Date(); + + var lastFocus=null; + + var focusTime=0; + var finished=false; + var adjustFocusTime=function () { + if (document.hasFocus()) { + if (lastFocus==null) { + lastFocus=new Date(); + } + } else if (lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + }; + var eventList=[]; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction=function () { + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length=0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished=true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize=initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data=new OSFLog.AppActivatedUsageData(); + data.SessionId=sessionId; + data.AppId=appInfo.appId; + data.AssetId=appInfo.assetId; + data.AppURL=appInfo.appURL; + data.UserId=appInfo.userId; + data.ClientId=appInfo.clientId; + data.Browser=appInfo.browser; + data.Host=appInfo.host; + data.HostVersion=appInfo.hostVersion; + data.CorrelationId=appInfo.correlationId; + data.AppSizeWidth=window.innerWidth; + data.AppSizeHeight=window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated=onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data=new OSFLog.ScriptLoadUsageData(); + data.CorrelationId=appCorrelationId; + data.SessionId=sessionId; + data.ScriptId=scriptId; + data.StartTime=msStartTime; + data.ResponseTime=msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone=onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data=new OSFLog.APIUsageUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.APIType=apiType; + data.APIID=id; + data.Parameters=parameters; + data.ResponseTime=msResponseTime; + data.ErrorType=errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone=onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters=null; + if (args) { + if (typeof args=="number") { + parameters=String(args); + } else if (typeof args==="object") { + for (var index in args) { + if (parameters !==null) { + parameters+=","; + } else { + parameters=""; + } + if (typeof args[index]=="number") { + parameters+=String(args[index]); + } + } + } else { + parameters=""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone=onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone=onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone=onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone=onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data=new OSFLog.AppClosedUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.FocusTime=focusTime; + data.OpenTime=openTime; + data.AppSizeFinalWidth=window.innerWidth; + data.AppSizeFinalHeight=window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed=onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId=correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data=new OSFLog.AppInitializationUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.SuccessCode=isException ? 1 : 0; + data.Message=message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException=logAppException; + OSF.AppTelemetry=OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry={})); + +Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data==null || data==undefined) { + return null; + } + try { + for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data=[data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers=fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ? [] : fixData(value); + } + } + }); + this.headers=headers; + this.rows=rows; +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; + +Microsoft.Office.WebExtension.CoercionType={ + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim=0; + for (var index=0; index < obj.length; index++) { + dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim+1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data==null || data==undefined) + return null; + var sourceType=null; + var runtimeType=typeof data; + if (data.rows !==undefined) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType !=destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length==1 && matrix[0].length==1) + return ""+matrix[0][0]; + var val=""; + for (var i=0; i < matrix.length; i++) { + val+=matrix[i].join("\t")+"\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret=text.split("\n"); + for (var i=0; i < ret.length; i++) + ret[i]=ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers=""; + if (table.headers !=null) { + headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n"; + } + + var rows=OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows=="") { + headers=headers.substring(0, headers.length - 1); + } + return headers+rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix=table.rows; + if (table.headers !=null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value=null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value==null) { + value=OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType==undefined) { + sourceType=OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) { + data=OSF.DDA.OMFactory.manufactureTableData(data); + } + data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data==undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageLeft, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageTop, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageWidth, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageHeight, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 } + ] +}); +OSF.DDA.SettingsManager={ + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret={}; + for (var key in settingsCollection) { + var value=settingsCollection[key]; + try { + if (JSON) { + value=JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value=Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key]=value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret={}; + serializedSettings=serializedSettings || {}; + for (var key in serializedSettings) { + var value=serializedSettings[key]; + try { + if (JSON) { + value=JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) { + d=new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key]=value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings=function OSF_DDA_Settings(settings) { + settings=settings || {}; + + var cacheSessionSettings=function (settings) { + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting=settings[name]; + return typeof (setting)==='undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name]=value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType={}; + +OSF.EventDispatch=function OSF_EventDispatch(eventTypes) { + this._eventHandlers={}; + for (var entry in eventTypes) { + var eventType=eventTypes[entry]; + this._eventHandlers[eventType]=[]; + } +}; +OSF.EventDispatch.prototype={ + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events=[]; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported=false; + for (var eventName in this._eventHandlers) { + if (event==eventName) { + isSupported=true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h]===handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler !="function") { + return false; + } + var handlers=this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index=0; index < handlers.length; index++) { + if (handlers[index]===handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType]=[]; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type==undefined) + return false; + var eventType=eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers=this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args=new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args=new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args=new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args=new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args=new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); + +Microsoft.Office.WebExtension.BindingType={ + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties={ + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id=bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t=typeof onError; + if (t !="undefined" && t !="function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback=onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype={ + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me=this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches=[]; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et=Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches=docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id]=new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch=bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime(); +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id=bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding=new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp=function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject=OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject=OSF.DDA.TableBinding; + } + binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding=new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) { + data=OSF.DDA.OMFactory.manufactureTableData(data); + } + data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data==undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); + +OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) { + OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Matrix + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + } + }); +}; +OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: 0 }, + { name: OSF.DDA.BindingProperties.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 } + ], + invertible: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: OSF.DDA.BindingProperties.RowCount, value: 0 }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddColumnsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties={ + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) { + OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperty(this, "type", { + value: Microsoft.Office.WebExtension.BindingType.Text + }); +}; +OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.PromptText, + value: { + "types": ["string"], + "calculate": function () { + return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.SampleData, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: function (bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: 2 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + BindingSelectionChanged: "bindingSelectionChanged", + BindingDataChanged: "bindingDataChanged" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" }); +OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged + }, + "binding": { + value: bindingInstance + } + }); + for (var prop in subset) { + OSF.OUtil.defineEnumerableProperty(this, prop, { + value: subset[prop] + }); + } +}; +OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingDataChanged + }, + "binding": { + value: bindingInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }] +}); + +Microsoft.Office.WebExtension.GoToType={ + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode={ + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index={ + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ + ExecuteRichApiRequestAsync: "executeRichApiRequestAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.Data, + types: ["object"] + } + ], + supportedOptions: [] +}); +OSF.OUtil.setNamespace("RichApi", OSF.DDA); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 } + ], + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.FilePropertiesDescriptor={ + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.ClearFormatsAsync, + am.SetTableOptionsAsync, + am.SetFormatsAsync + ]); + OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding); + +(function () { + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + privateStateCallbacks: [] + }); + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var Parameters=Microsoft.Office.WebExtension.Parameters; + + if (callArgs[Parameters.StartRow]==0 && callArgs[Parameters.StartColumn]==0 && OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 && OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) { + delete callArgs[Parameters.StartRow]; + delete callArgs[Parameters.StartColumn]; + delete callArgs[Parameters.CellFormat]; + delete callArgs[Parameters.TableOptions]; + } + if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) || (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) || callArgs[Parameters.CellFormat] || callArgs[Parameters.TableOptions])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: function (obj) { + return obj.id; + } + } + ] + }); + OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.setTableOptionsAsync.apply(binding, args); + }); + return this; + }, OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.setFormatsAsync.apply(binding, args); + }); + return this; + }, OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.clearFormatsAsync.apply(binding, args); + }); + return this; + }; +})(); +(function () { + function getObjectId(obj) { + return obj.id; + } + OSF.DDA.AsyncMethodNames.addNames({ + ClearFormatsAsync: "clearFormatsAsync", + SetTableOptionsAsync: "setTableOptionsAsync", + SetFormatsAsync: "setFormatsAsync" + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.TableOptions, + "defaultValue": [] + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetFormatsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CellFormat, + "defaultValue": [] + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +Microsoft.Office.WebExtension.Table={ + All: 0, + Data: 1, + Headers: 2 +}; +(function () { + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearFormatsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] + }); + + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 1 } + ] + }); + + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetFormatsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 1 } + ] + }); + + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 } + ] + }); + OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }, + { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 }, + { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 } + ] + }); + var tableOptionProperties={ + headerRow: 0, + bandedRows: 1, + firstColumn: 2, + lastColumn: 3, + bandedColumns: 4, + filterButton: 5, + style: 6, + totalRow: 7 + }; + var cellProperties={ + row: 0, + column: 1 + }; + var formatProperties={ + alignHorizontal: { text: "alignHorizontal", type: 1 }, + alignVertical: { text: "alignVertical", type: 2 }, + backgroundColor: { text: "backgroundColor", type: 101 }, + borderStyle: { text: "borderStyle", type: 201 }, + borderColor: { text: "borderColor", type: 202 }, + borderTopStyle: { text: "borderTopStyle", type: 203 }, + borderTopColor: { text: "borderTopColor", type: 204 }, + borderBottomStyle: { text: "borderBottomStyle", type: 205 }, + borderBottomColor: { text: "borderBottomColor", type: 206 }, + borderLeftStyle: { text: "borderLeftStyle", type: 207 }, + borderLeftColor: { text: "borderLeftColor", type: 208 }, + borderRightStyle: { text: "borderRightStyle", type: 209 }, + borderRightColor: { text: "borderRightColor", type: 210 }, + borderOutlineStyle: { text: "borderOutlineStyle", type: 211 }, + borderOutlineColor: { text: "borderOutlineColor", type: 212 }, + borderInlineStyle: { text: "borderInlineStyle", type: 213 }, + borderInlineColor: { text: "borderInlineColor", type: 214 }, + fontFamily: { text: "fontFamily", type: 301 }, + fontStyle: { text: "fontStyle", type: 302 }, + fontSize: { text: "fontSize", type: 303 }, + fontUnderlineStyle: { text: "fontUnderlineStyle", type: 304 }, + fontColor: { text: "fontColor", type: 305 }, + fontDirection: { text: "fontDirection", type: 306 }, + fontStrikethrough: { text: "fontStrikethrough", type: 307 }, + fontSuperscript: { text: "fontSuperscript", type: 308 }, + fontSubscript: { text: "fontSubscript", type: 309 }, + fontNormal: { text: "fontNormal", type: 310 }, + indentLeft: { text: "indentLeft", type: 401 }, + indentRight: { text: "indentRight", type: 402 }, + numberFormat: { text: "numberFormat", type: 501 }, + width: { text: "width", type: 701 }, + height: { text: "height", type: 702 }, + wrapping: { text: "wrapping", type: 703 } + }; + var borderStyleSet=[ + { name: "none", value: 0 }, + { name: "thin", value: 1 }, + { name: "medium", value: 2 }, + { name: "dashed", value: 3 }, + { name: "dotted", value: 4 }, + { name: "thick", value: 5 }, + { name: "double", value: 6 }, + { name: "hair", value: 7 }, + { name: "medium dashed", value: 8 }, + { name: "dash dot", value: 9 }, + { name: "medium dash dot", value: 10 }, + { name: "dash dot dot", value: 11 }, + { name: "medium dash dot dot", value: 12 }, + { name: "slant dash dot", value: 13 } + ]; + var colorSet=[ + { name: "none", value: 0 }, + { name: "black", value: 1 }, + { name: "blue", value: 2 }, + { name: "gray", value: 3 }, + { name: "green", value: 4 }, + { name: "orange", value: 5 }, + { name: "pink", value: 6 }, + { name: "purple", value: 7 }, + { name: "red", value: 8 }, + { name: "teal", value: 9 }, + { name: "turquoise", value: 10 }, + { name: "violet", value: 11 }, + { name: "white", value: 12 }, + { name: "yellow", value: 13 }, + { name: "automatic", value: 14 } + ]; + var ns=OSF.DDA.SafeArray.Delegate.ParameterMap; + ns.define({ + type: formatProperties.alignHorizontal.text, + toHost: [ + { name: "general", value: 0 }, + { name: "left", value: 1 }, + { name: "center", value: 2 }, + { name: "right", value: 3 }, + { name: "fill", value: 4 }, + { name: "justify", value: 5 }, + { name: "center across selection", value: 6 }, + { name: "distributed", value: 7 } + ] }); + ns.define({ + type: formatProperties.alignVertical.text, + toHost: [ + { name: "top", value: 0 }, + { name: "center", value: 1 }, + { name: "bottom", value: 2 }, + { name: "justify", value: 3 }, + { name: "distributed", value: 4 } + ] }); + ns.define({ + type: formatProperties.backgroundColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderTopStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderTopColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderBottomStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderBottomColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderLeftStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderLeftColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderRightStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderRightColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderOutlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderOutlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.borderInlineStyle.text, + toHost: borderStyleSet + }); + ns.define({ + type: formatProperties.borderInlineColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontStyle.text, + toHost: [ + { name: "regular", value: 0 }, + { name: "italic", value: 1 }, + { name: "bold", value: 2 }, + { name: "bold italic", value: 3 } + ] }); + ns.define({ + type: formatProperties.fontUnderlineStyle.text, + toHost: [ + { name: "none", value: 0 }, + { name: "single", value: 1 }, + { name: "double", value: 2 }, + { name: "single accounting", value: 3 }, + { name: "double accounting", value: 4 } + ] }); + ns.define({ + type: formatProperties.fontColor.text, + toHost: colorSet + }); + ns.define({ + type: formatProperties.fontDirection.text, + toHost: [ + { name: "context", value: 0 }, + { name: "left-to-right", value: 1 }, + { name: "right-to-left", value: 2 } + ] }); + ns.define({ + type: formatProperties.width.text, + toHost: [ + { name: "auto fit", value: -1 } + ] }); + ns.define({ + type: formatProperties.height.text, + toHost: [ + { name: "auto fit", value: -1 } + ] }); + ns.define({ + type: Microsoft.Office.WebExtension.Parameters.TableOptions, + toHost: [ + { name: "headerRow", value: 0 }, + { name: "bandedRows", value: 1 }, + { name: "firstColumn", value: 2 }, + { name: "lastColumn", value: 3 }, + { name: "bandedColumns", value: 4 }, + { name: "filterButton", value: 5 }, + { name: "style", value: 6 }, + { name: "totalRow", value: 7 } + ] }); + ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={ + toHost: function (data) { + for (var entry in data) { + if (data[entry].format) { + data[entry].format=ns.doMapValues(data[entry].format, "toHost"); + } + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat, { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) { + var textCells="cells"; + var textFormat="format"; + var posCells=0; + var posFormat=1; + var ret=[]; + for (var index in cellFormats) { + var cfOld=cellFormats[index]; + var cfNew=[]; + if (typeof (cfOld[textCells]) !=='undefined') { + var cellsOld=cfOld[textCells]; + var cellsNew; + if (typeof cfOld[textCells]==="object") { + cellsNew=[]; + for (var entry in cellsOld) { + if (typeof (cellProperties[entry]) !=='undefined') { + cellsNew[cellProperties[entry]]=cellsOld[entry]; + } + } + } else { + cellsNew=cellsOld; + } + cfNew[posCells]=cellsNew; + } + if (cfOld[textFormat]) { + var formatOld=cfOld[textFormat]; + var formatNew=[]; + for (var entry2 in formatOld) { + if (typeof (formatProperties[entry2]) !=='undefined') { + formatNew.push([ + formatProperties[entry2].type, + formatOld[entry2] + ]); + } + } + cfNew[posFormat]=formatNew; + } + ret[index]=cfNew; + } + return ret; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) { + return hostArgs; + } + }); + ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions, { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) { + var ret=[]; + for (var entry in tableOptions) { + if (typeof (tableOptionProperties[entry]) !=='undefined') { + ret[tableOptionProperties[entry]]=tableOptions[entry]; + } + } + return ret; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) { + return hostArgs; + } + }); +})(); +OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) { + var bf=new OSF.DDA.BindingFacade(this); + OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]); + OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(false)); + OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]); + appReady(); +}; + +var OfficeExtension; +(function (OfficeExtension) { + var Action=(function () { + function Action(actionInfo, isWriteOperation) { + this.m_actionInfo=actionInfo; + this.m_isWriteOperation=isWriteOperation; + } + Object.defineProperty(Action.prototype, "actionInfo", { + get: function () { + return this.m_actionInfo; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Action.prototype, "isWriteOperation", { + get: function () { + return this.m_isWriteOperation; + }, + enumerable: true, + configurable: true + }); + return Action; + })(); + OfficeExtension.Action=Action; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ActionFactory=(function () { + function ActionFactory() { + } + ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 4 , + Name: propertyName, + ObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var args=[value]; + var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args); + OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths); + var ret=new OfficeExtension.Action(actionInfo, true); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths); + return ret; + }; + ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 3 , + Name: methodName, + ObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args); + OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths); + var isWriteOperation=operationType !=1 ; + var ret=new OfficeExtension.Action(actionInfo, isWriteOperation); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths); + return ret; + }; + ActionFactory.createQueryAction=function (context, parent, queryOption) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 2 , + Name: "", + ObjectPathId: parent._objectPath.objectPathInfo.Id, + }; + actionInfo.QueryInfo=queryOption; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + return ret; + }; + ActionFactory.createInstantiateAction=function (context, obj) { + OfficeExtension.Utility.validateObjectPath(obj); + var actionInfo={ + Id: context._nextId(), + ActionType: 1 , + Name: "", + ObjectPathId: obj._objectPath.objectPathInfo.Id + }; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(obj._objectPath); + context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj)); + return ret; + }; + ActionFactory.createTraceAction=function (context, message) { + var actionInfo={ + Id: context._nextId(), + ActionType: 5 , + Name: "Trace", + ObjectPathId: 0 + }; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addTrace(actionInfo.Id, message); + return ret; + }; + return ActionFactory; + })(); + OfficeExtension.ActionFactory=ActionFactory; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientObject=(function () { + function ClientObject(context, objectPath) { + OfficeExtension.Utility.checkArgumentNull(context, "context"); + this.m_context=context; + this.m_objectPath=objectPath; + if (this.m_objectPath) { + if (!context._processingResult) { + OfficeExtension.ActionFactory.createInstantiateAction(context, this); + if ((context._autoCleanup) && (this._KeepReference)) { + context.trackedObjects._autoAdd(this); + } + } + } + } + Object.defineProperty(ClientObject.prototype, "context", { + get: function () { + return this.m_context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientObject.prototype, "_objectPath", { + get: function () { + return this.m_objectPath; + }, + set: function (value) { + this.m_objectPath=value; + }, + enumerable: true, + configurable: true + }); + ClientObject.prototype._handleResult=function (value) { + }; + return ClientObject; + })(); + OfficeExtension.ClientObject=ClientObject; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientRequest=(function () { + function ClientRequest(context) { + this.m_context=context; + this.m_actions=[]; + this.m_actionResultHandler={}; + this.m_referencedObjectPaths={}; + this.m_flags=0 ; + this.m_traceInfos={}; + } + Object.defineProperty(ClientRequest.prototype, "flags", { + get: function () { + return this.m_flags; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientRequest.prototype, "traceInfos", { + get: function () { + return this.m_traceInfos; + }, + enumerable: true, + configurable: true + }); + ClientRequest.prototype.addAction=function (action) { + if (action.isWriteOperation) { + this.m_flags=this.m_flags | 1 ; + } + this.m_actions.push(action); + }; + Object.defineProperty(ClientRequest.prototype, "hasActions", { + get: function () { + return this.m_actions.length > 0; + }, + enumerable: true, + configurable: true + }); + ClientRequest.prototype.addTrace=function (actionId, message) { + this.m_traceInfos[actionId]=message; + }; + ClientRequest.prototype.addReferencedObjectPath=function (objectPath) { + if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) { + return; + } + if (!objectPath.isValid) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath)); + } + while (objectPath) { + if (objectPath.isWriteOperation) { + this.m_flags=this.m_flags | 1 ; + } + this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath; + if (objectPath.objectPathInfo.ObjectPathType==3 ) { + this.addReferencedObjectPaths(objectPath.argumentObjectPaths); + } + objectPath=objectPath.parentObjectPath; + } + }; + ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) { + if (objectPaths) { + for (var i=0; i < objectPaths.length; i++) { + this.addReferencedObjectPath(objectPaths[i]); + } + } + }; + ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) { + this.m_actionResultHandler[action.actionInfo.Id]=resultHandler; + }; + ClientRequest.prototype.buildRequestMessageBody=function () { + var objectPaths={}; + for (var i in this.m_referencedObjectPaths) { + objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo; + } + var actions=[]; + for (var index=0; index < this.m_actions.length; index++) { + actions.push(this.m_actions[index].actionInfo); + } + var ret={ + Actions: actions, + ObjectPaths: objectPaths + }; + return ret; + }; + ClientRequest.prototype.processResponse=function (msg) { + if (msg && msg.Results) { + for (var i=0; i < msg.Results.length; i++) { + var actionResult=msg.Results[i]; + var handler=this.m_actionResultHandler[actionResult.ActionId]; + if (handler) { + handler._handleResult(actionResult.Value); + } + } + } + }; + ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () { + for (var i in this.m_referencedObjectPaths) { + if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) { + this.m_referencedObjectPaths[i].isValid=false; + } + } + }; + return ClientRequest; + })(); + OfficeExtension.ClientRequest=ClientRequest; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientRequestContext=(function () { + function ClientRequestContext(url) { + this.m_nextId=0; + this.m_url=url; + if (OfficeExtension.Utility.isNullOrEmptyString(this.m_url)) { + this.m_url=OfficeExtension.Constants.localDocument; + } + this._processingResult=false; + this._customData=OfficeExtension.Constants.iterativeExecutor; + this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor(); + this.sync=this.sync.bind(this); + } + Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", { + get: function () { + if (this.m_pendingRequest==null) { + this.m_pendingRequest=new OfficeExtension.ClientRequest(this); + } + return this.m_pendingRequest; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", { + get: function () { + if (!this.m_trackedObjects) { + this.m_trackedObjects=new OfficeExtension.TrackedObjects(this); + } + return this.m_trackedObjects; + }, + enumerable: true, + configurable: true + }); + ClientRequestContext.prototype.load=function (clientObj, option) { + OfficeExtension.Utility.validateContext(this, clientObj); + var queryOption={}; + if (typeof (option)=="string") { + var select=option; + queryOption.Select=this.parseSelectExpand(select); + } + else if (Array.isArray(option)) { + queryOption.Select=option; + } + else if (typeof (option)=="object") { + var loadOption=option; + if (typeof (loadOption.select)=="string") { + queryOption.Select=this.parseSelectExpand(loadOption.select); + } + else if (Array.isArray(loadOption.select)) { + queryOption.Select=loadOption.select; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select"); + } + if (typeof (loadOption.expand)=="string") { + queryOption.Expand=this.parseSelectExpand(loadOption.expand); + } + else if (Array.isArray(loadOption.expand)) { + queryOption.Expand=loadOption.expand; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand"); + } + if (typeof (loadOption.top)=="number") { + queryOption.Top=loadOption.top; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top"); + } + if (typeof (loadOption.skip)=="number") { + queryOption.Skip=loadOption.skip; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip"); + } + } + else if (!OfficeExtension.Utility.isNullOrUndefined(option)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option"); + } + var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption); + this._pendingRequest.addActionResultHandler(action, clientObj); + }; + ClientRequestContext.prototype.trace=function (message) { + OfficeExtension.ActionFactory.createTraceAction(this, message); + }; + ClientRequestContext.prototype.parseSelectExpand=function (select) { + var args=[]; + if (!OfficeExtension.Utility.isNullOrEmptyString(select)) { + var propertyNames=select.split(","); + for (var i=0; i < propertyNames.length; i++) { + var propertyName=propertyNames[i]; + propertyName=propertyName.trim(); + args.push(propertyName); + } + } + return args; + }; + ClientRequestContext.prototype.syncPrivate=function (doneCallback, failCallback) { + var req=this._pendingRequest; + if (!req.hasActions) { + doneCallback(); + return; + } + this.m_pendingRequest=null; + var msgBody=req.buildRequestMessageBody(); + var requestFlags=req.flags; + var requestExecutor=this._requestExecutor; + if (!requestExecutor) { + requestExecutor=new OfficeExtension.OfficeJsRequestExecutor(); + } + var requestExecutorRequestMessage={ + Url: this.m_url, + Headers: null, + Body: msgBody + }; + req.invalidatePendingInvalidObjectPaths(); + var thisObj=this; + requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage, function (response) { + var error; + var traceMessages=new Array(); + if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) { + error=new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {}); + } + else if (response.Body && response.Body.Error) { + error=new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, { + errorLocation: response.Body.Error.Location + }); + } + if (response.Body && response.Body.TraceIds) { + var traceMessageMap=req.traceInfos; + for (var i=0; i < response.Body.TraceIds.length; i++) { + var traceId=response.Body.TraceIds[i]; + var message=traceMessageMap[traceId]; + traceMessages.push(message); + } + } + if (error) { + failCallback(error); + return; + } + else { + thisObj._processingResult=true; + try { + req.processResponse(response.Body); + } + finally { + thisObj._processingResult=false; + } + doneCallback(); + return; + } + }); + }; + ClientRequestContext.prototype.sync=function (passThroughValue) { + var _this=this; + OfficeExtension._EnsurePromise(); + return new OfficeExtension['Promise'](function (resolve, reject) { + _this.syncPrivate(function () { + resolve(passThroughValue); + }, function (error) { + reject(error); + }); + }); + }; + ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) { + if (numCleanupAttempts===void 0) { numCleanupAttempts=3; } + if (retryDelay===void 0) { retryDelay=5000; } + OfficeExtension._EnsurePromise(); + var starterPromise=new OfficeExtension['Promise'](function (resolve, reject) { + resolve(); + }); + var ctx; + var succeeded=false; + var resultOrError; + return starterPromise.then(function () { + ctx=ctxInitializer(); + ctx._autoCleanup=true; + var batchResult=batch(ctx); + if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise); + } + return batchResult; + }).then(function (batchResult) { + return ctx.sync(batchResult); + }).then(function (result) { + succeeded=true; + resultOrError=result; + }).catch(function (error) { + resultOrError=error; + }).then(function () { + var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList(); + ctx._autoCleanup=false; + for (var key in itemsToRemove) { + itemsToRemove[key]._objectPath.isValid=false; + } + var cleanupCounter=0; + attemptCleanup(); + function attemptCleanup() { + cleanupCounter++; + for (var key in itemsToRemove) { + ctx.trackedObjects.remove(itemsToRemove[key]); + } + ctx.sync().then(function () { + if (onCleanupSuccess) { + onCleanupSuccess(cleanupCounter); + } + }).catch(function () { + if (onCleanupFailure) { + onCleanupFailure(cleanupCounter); + } + if (cleanupCounter < numCleanupAttempts) { + setTimeout(function () { + attemptCleanup(); + }, retryDelay); + } + }); + } + }).then(function () { + if (succeeded) { + return resultOrError; + } + else { + throw resultOrError; + } + }); + }; + ClientRequestContext.prototype._nextId=function () { + return++this.m_nextId; + }; + return ClientRequestContext; + })(); + OfficeExtension.ClientRequestContext=ClientRequestContext; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (ClientRequestFlags) { + ClientRequestFlags[ClientRequestFlags["None"]=0]="None"; + ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation"; + })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={})); + var ClientRequestFlags=OfficeExtension.ClientRequestFlags; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientResult=(function () { + function ClientResult() { + } + Object.defineProperty(ClientResult.prototype, "value", { + get: function () { + return this.m_value; + }, + enumerable: true, + configurable: true + }); + ClientResult.prototype._handleResult=function (value) { + this.m_value=value; + }; + return ClientResult; + })(); + OfficeExtension.ClientResult=ClientResult; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var Constants=(function () { + function Constants() { + } + Constants.getItemAt="GetItemAt"; + Constants.id="Id"; + Constants.idPrivate="_Id"; + Constants.index="_Index"; + Constants.items="_Items"; + Constants.iterativeExecutor="IterativeExecutor"; + Constants.localDocument="http://document.localhost/"; + Constants.localDocumentApiPrefix="http://document.localhost/_api/"; + Constants.referenceId="_ReferenceId"; + return Constants; + })(); + OfficeExtension.Constants=Constants; +})(OfficeExtension || (OfficeExtension={})); +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var OfficeExtension; +(function (OfficeExtension) { + var _Internal; + (function (_Internal) { + var RuntimeError=(function (_super) { + __extends(RuntimeError, _super); + function RuntimeError(code, message, traceMessages, debugInfo) { + _super.call(this, message); + this.name="OfficeExtension.Error"; + this.code=code; + this.message=message; + this.traceMessages=traceMessages; + this.debugInfo=debugInfo; + } + RuntimeError.prototype.toString=function () { + return this.code+': '+this.message; + }; + return RuntimeError; + })(Error); + _Internal.RuntimeError=RuntimeError; + })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={})); + OfficeExtension.Error=OfficeExtension._Internal.RuntimeError; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ErrorCodes=(function () { + function ErrorCodes() { + } + ErrorCodes.accessDenied="AccessDenied"; + ErrorCodes.generalException="GeneralException"; + ErrorCodes.activityLimitReached="ActivityLimitReached"; + return ErrorCodes; + })(); + OfficeExtension.ErrorCodes=ErrorCodes; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var InstantiateActionResultHandler=(function () { + function InstantiateActionResultHandler(clientObject) { + this.m_clientObject=clientObject; + } + InstantiateActionResultHandler.prototype._handleResult=function (value) { + OfficeExtension.Utility.fixObjectPathIfNecessary(this.m_clientObject, value); + if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this.m_clientObject._initReferenceId) { + this.m_clientObject._initReferenceId(value[OfficeExtension.Constants.referenceId]); + } + }; + return InstantiateActionResultHandler; + })(); + OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (RichApiRequestMessageIndex) { + RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags"; + })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={})); + var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex; + (function (RichApiResponseMessageIndex) { + RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode"; + RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers"; + RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body"; + })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={})); + var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex; + ; + (function (ActionType) { + ActionType[ActionType["Instantiate"]=1]="Instantiate"; + ActionType[ActionType["Query"]=2]="Query"; + ActionType[ActionType["Method"]=3]="Method"; + ActionType[ActionType["SetProperty"]=4]="SetProperty"; + ActionType[ActionType["Trace"]=5]="Trace"; + })(OfficeExtension.ActionType || (OfficeExtension.ActionType={})); + var ActionType=OfficeExtension.ActionType; + (function (ObjectPathType) { + ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject"; + ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject"; + ObjectPathType[ObjectPathType["Method"]=3]="Method"; + ObjectPathType[ObjectPathType["Property"]=4]="Property"; + ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer"; + ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId"; + })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={})); + var ObjectPathType=OfficeExtension.ObjectPathType; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ObjectPath=(function () { + function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) { + this.m_objectPathInfo=objectPathInfo; + this.m_parentObjectPath=parentObjectPath; + this.m_isWriteOperation=false; + this.m_isCollection=isCollection; + this.m_isInvalidAfterRequest=isInvalidAfterRequest; + this.m_isValid=true; + } + Object.defineProperty(ObjectPath.prototype, "objectPathInfo", { + get: function () { + return this.m_objectPathInfo; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isWriteOperation", { + get: function () { + return this.m_isWriteOperation; + }, + set: function (value) { + this.m_isWriteOperation=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isCollection", { + get: function () { + return this.m_isCollection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", { + get: function () { + return this.m_isInvalidAfterRequest; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "parentObjectPath", { + get: function () { + return this.m_parentObjectPath; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", { + get: function () { + return this.m_argumentObjectPaths; + }, + set: function (value) { + this.m_argumentObjectPaths=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isValid", { + get: function () { + return this.m_isValid; + }, + set: function (value) { + this.m_isValid=value; + }, + enumerable: true, + configurable: true + }); + ObjectPath.prototype.updateUsingObjectData=function (value) { + var referenceId=value[OfficeExtension.Constants.referenceId]; + if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) { + this.m_isInvalidAfterRequest=false; + this.m_isValid=true; + this.m_objectPathInfo.ObjectPathType=6 ; + this.m_objectPathInfo.Name=referenceId; + this.m_objectPathInfo.ArgumentInfo={}; + this.m_parentObjectPath=null; + this.m_argumentObjectPaths=null; + return; + } + if (this.parentObjectPath && this.parentObjectPath.isCollection) { + var id=value[OfficeExtension.Constants.id]; + if (OfficeExtension.Utility.isNullOrUndefined(id)) { + id=value[OfficeExtension.Constants.idPrivate]; + } + if (!OfficeExtension.Utility.isNullOrUndefined(id)) { + this.m_isInvalidAfterRequest=false; + this.m_isValid=true; + this.m_objectPathInfo.ObjectPathType=5 ; + this.m_objectPathInfo.Name=""; + this.m_objectPathInfo.ArgumentInfo={}; + this.m_objectPathInfo.ArgumentInfo.Arguments=[id]; + this.m_argumentObjectPaths=null; + return; + } + } + }; + return ObjectPath; + })(); + OfficeExtension.ObjectPath=ObjectPath; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ObjectPathFactory=(function () { + function ObjectPathFactory() { + } + ObjectPathFactory.createGlobalObjectObjectPath=function (context) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false); + }; + ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false); + }; + ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 4 , + Name: propertyName, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + }; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest); + }; + ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=args; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parentObjectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=args; + return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false); + }; + ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 3 , + Name: methodName, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args); + var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest); + ret.argumentObjectPaths=argumentObjectPaths; + ret.isWriteOperation=(operationType !=1 ); + return ret; + }; + ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) { + var id=childItem[OfficeExtension.Constants.id]; + if (OfficeExtension.Utility.isNullOrUndefined(id)) { + id=childItem[OfficeExtension.Constants.idPrivate]; + } + var objectPathInfo=objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=[id]; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) { + var indexFromServer=childItem[OfficeExtension.Constants.index]; + if (indexFromServer) { + index=indexFromServer; + } + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 3 , + Name: OfficeExtension.Constants.getItemAt, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=[index]; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createReferenceIdObjectPath=function (context, referenceId) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 6 , Name: referenceId }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false); + }; + return ObjectPathFactory; + })(); + OfficeExtension.ObjectPathFactory=ObjectPathFactory; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var OfficeJsRequestExecutor=(function () { + function OfficeJsRequestExecutor() { + } + OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage, callback) { + var requestMessageText=JSON.stringify(requestMessage.Body); + OfficeExtension.Utility.log("Request:"); + OfficeExtension.Utility.log(requestMessageText); + var messageSafearray=OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", null, requestMessageText); + OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) { + OfficeExtension.Utility.log("Response:"); + OfficeExtension.Utility.log(JSON.stringify(result)); + var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null }; + if (result.status=="succeeded") { + var bodyText=OfficeExtension.RichApiMessageUtility.getResponseBody(result); + response.Body=JSON.parse(bodyText); + response.Headers=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result); + callback(response); + } + else { + response.ErrorCode=OfficeExtension.ErrorCodes.generalException; + if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability) { + response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied; + } + else if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached) { + response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached; + } + response.ErrorMessage=result.error.message; + callback(response); + } + }); + }; + OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability=7000; + OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached=5102; + return OfficeJsRequestExecutor; + })(); + OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var OfficeXHRSettings=(function () { + function OfficeXHRSettings() { + } + return OfficeXHRSettings; + })(); + OfficeExtension.OfficeXHRSettings=OfficeXHRSettings; + function resetXHRFactory(oldFactory) { + OfficeXHR.settings.oldxhr=oldFactory; + return officeXHRFactory; + } + OfficeExtension.resetXHRFactory=resetXHRFactory; + function officeXHRFactory() { + return new OfficeXHR; + } + OfficeExtension.officeXHRFactory=officeXHRFactory; + var OfficeXHR=(function () { + function OfficeXHR() { + } + OfficeXHR.prototype.open=function (method, url) { + this.m_method=method; + this.m_url=url; + if (this.m_url.toLowerCase().indexOf(OfficeExtension.Constants.localDocumentApiPrefix)==0) { + this.m_url=this.m_url.substr(OfficeExtension.Constants.localDocumentApiPrefix.length); + } + else { + this.m_innerXhr=OfficeXHR.settings.oldxhr(); + var thisObj=this; + this.m_innerXhr.onreadystatechange=function () { + thisObj.innerXhrOnreadystatechage(); + }; + this.m_innerXhr.open(method, this.m_url); + } + }; + OfficeXHR.prototype.abort=function () { + if (this.m_innerXhr) { + this.m_innerXhr.abort(); + } + }; + OfficeXHR.prototype.send=function (body) { + if (this.m_innerXhr) { + this.m_innerXhr.send(body); + } + else { + var thisObj=this; + var requestFlags=0 ; + if (!OfficeExtension.Utility.isReadonlyRestRequest(this.m_method)) { + requestFlags=1 ; + } + var execFunction=OfficeXHR.settings.executeRichApiRequestAsync; + if (!execFunction) { + execFunction=OSF.DDA.RichApi.executeRichApiRequestAsync; + } + execFunction(OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray('', requestFlags, this.m_method, this.m_url, this.m_requestHeaders, body), function (asyncResult) { + thisObj.officeContextRequestCallback(asyncResult); + }); + } + }; + OfficeXHR.prototype.setRequestHeader=function (header, value) { + if (this.m_innerXhr) { + this.m_innerXhr.setRequestHeader(header, value); + } + else { + if (!this.m_requestHeaders) { + this.m_requestHeaders={}; + } + this.m_requestHeaders[header]=value; + } + }; + OfficeXHR.prototype.getResponseHeader=function (header) { + if (this.m_responseHeaders) { + return this.m_responseHeaders[header.toUpperCase()]; + } + return null; + }; + OfficeXHR.prototype.getAllResponseHeaders=function () { + return this.m_allResponseHeaders; + }; + OfficeXHR.prototype.overrideMimeType=function (mimeType) { + if (this.m_innerXhr) { + this.m_innerXhr.overrideMimeType(mimeType); + } + }; + OfficeXHR.prototype.innerXhrOnreadystatechage=function () { + this.readyState=this.m_innerXhr.readyState; + if (this.readyState==OfficeXHR.DONE) { + this.status=this.m_innerXhr.status; + this.statusText=this.m_innerXhr.statusText; + this.responseText=this.m_innerXhr.responseText; + this.response=this.m_innerXhr.response; + this.responseType=this.m_innerXhr.responseType; + this.setAllResponseHeaders(this.m_innerXhr.getAllResponseHeaders()); + } + if (this.onreadystatechange) { + this.onreadystatechange(); + } + }; + OfficeXHR.prototype.officeContextRequestCallback=function (result) { + this.readyState=OfficeXHR.DONE; + if (result.status=="succeeded") { + this.status=OfficeExtension.RichApiMessageUtility.getResponseStatusCode(result); + this.m_responseHeaders=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result); + console.debug("ResponseHeaders="+JSON.stringify(this.m_responseHeaders)); + this.responseText=OfficeExtension.RichApiMessageUtility.getResponseBody(result); + console.debug("ResponseText="+this.responseText); + this.response=this.responseText; + } + else { + this.status=500; + this.statusText="Internal Error"; + } + if (this.onreadystatechange) { + this.onreadystatechange(); + } + }; + OfficeXHR.prototype.setAllResponseHeaders=function (allResponseHeaders) { + this.m_allResponseHeaders=allResponseHeaders; + this.m_responseHeaders={}; + if (this.m_allResponseHeaders !=null) { + var regex=new RegExp("\r?\n"); + var entries=this.m_allResponseHeaders.split(regex); + for (var i=0; i < entries.length; i++) { + var entry=entries[i]; + if (entry !=null) { + var index=entry.indexOf(':'); + if (index > 0) { + var key=entry.substr(0, index); + var value=entry.substr(index+1); + key=OfficeExtension.Utility.trim(key); + value=OfficeExtension.Utility.trim(value); + this.m_responseHeaders[key.toUpperCase()]=value; + } + } + } + } + }; + OfficeXHR.UNSENT=0; + OfficeXHR.OPENED=1; + OfficeXHR.DONE=4; + OfficeXHR.settings=new OfficeXHRSettings(); + return OfficeXHR; + })(); + OfficeExtension.OfficeXHR=OfficeXHR; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + function _EnsurePromise() { + if (!OfficeExtension["Promise"]) { + PromiseImpl.Init(); + } + } + OfficeExtension._EnsurePromise=_EnsurePromise; + var PromiseImpl; + (function (PromiseImpl) { + function Init() { + (function () { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x==='function' || (typeof x==='object' && x !==null); + } + function lib$es6$promise$utils$$isFunction(x) { + return typeof x==='function'; + } + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x==='object' && x !==null; + } + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray=function (x) { + return Object.prototype.toString.call(x)==='[object Array]'; + }; + } + else { + lib$es6$promise$utils$$_isArray=Array.isArray; + } + var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len=0; + var lib$es6$promise$asap$$toString={}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + var lib$es6$promise$asap$$asap=function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg; + lib$es6$promise$asap$$len+=2; + if (lib$es6$promise$asap$$len===2) { + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } + else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + }; + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn=scheduleFn; + } + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap=asapFn; + } + var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]'; + var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined'; + function lib$es6$promise$asap$$useNextTick() { + var nextTick=process.nextTick; + var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/); + if (Array.isArray(version) && version[1]==='0' && version[2]==='10') { + nextTick=setImmediate; + } + return function () { + nextTick(lib$es6$promise$asap$$flush); + }; + } + function lib$es6$promise$asap$$useVertxTimer() { + return function () { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + function lib$es6$promise$asap$$useMutationObserver() { + var iterations=0; + var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node=document.createTextNode(''); + observer.observe(node, { characterData: true }); + return function () { + node.data=(iterations=++iterations % 2); + }; + } + function lib$es6$promise$asap$$useMessageChannel() { + var channel=new MessageChannel(); + channel.port1.onmessage=lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + function lib$es6$promise$asap$$useSetTimeout() { + return function () { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + var lib$es6$promise$asap$$queue=new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i=0; i < lib$es6$promise$asap$$len; i+=2) { + var callback=lib$es6$promise$asap$$queue[i]; + var arg=lib$es6$promise$asap$$queue[i+1]; + callback(arg); + lib$es6$promise$asap$$queue[i]=undefined; + lib$es6$promise$asap$$queue[i+1]=undefined; + } + lib$es6$promise$asap$$len=0; + } + function lib$es6$promise$asap$$attemptVertex() { + try { + var r=require; + var vertx=r('vertx'); + lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } + catch (e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + var lib$es6$promise$asap$$scheduleFlush; + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick(); + } + else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver(); + } + else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel(); + } + else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex(); + } + else { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout(); + } + function lib$es6$promise$$internal$$noop() { + } + var lib$es6$promise$$internal$$PENDING=void 0; + var lib$es6$promise$$internal$$FULFILLED=1; + var lib$es6$promise$$internal$$REJECTED=2; + var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject(); + function lib$es6$promise$$internal$$selfFullfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } + catch (error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error=error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } + catch (e) { + return e; + } + } + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function (promise) { + var sealed=false; + var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) { + if (sealed) { + return; + } + sealed=true; + if (thenable !==value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed=true; + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: '+(promise._label || ' unknown promise')); + if (!sealed && error) { + sealed=true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state===lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } + else if (thenable._state===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } + else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function (reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor===promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } + else { + var then=lib$es6$promise$$internal$$getThen(maybeThenable); + if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } + else if (then===undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } + else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise===value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment()); + } + else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } + else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + lib$es6$promise$$internal$$publish(promise); + } + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + return; + } + promise._result=value; + promise._state=lib$es6$promise$$internal$$FULFILLED; + if (promise._subscribers.length !==0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + return; + } + promise._state=lib$es6$promise$$internal$$REJECTED; + promise._result=reason; + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers=parent._subscribers; + var length=subscribers.length; + parent._onerror=null; + subscribers[length]=child; + subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment; + subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection; + if (length===0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + function lib$es6$promise$$internal$$publish(promise) { + var subscribers=promise._subscribers; + var settled=promise._state; + if (subscribers.length===0) { + return; + } + var child, callback, detail=promise._result; + for (var i=0; i < subscribers.length; i+=3) { + child=subscribers[i]; + callback=subscribers[i+settled]; + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } + else { + callback(detail); + } + } + promise._subscribers.length=0; + } + function lib$es6$promise$$internal$$ErrorObject() { + this.error=null; + } + var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject(); + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } + catch (e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed; + if (hasCallback) { + value=lib$es6$promise$$internal$$tryCatch(callback, detail); + if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed=true; + error=value.error; + value=null; + } + else { + succeeded=true; + } + if (promise===value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + } + else { + value=detail; + succeeded=true; + } + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + } + else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } + else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } + else if (settled===lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } + else if (settled===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + catch (e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator=this; + enumerator._instanceConstructor=Constructor; + enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop); + if (enumerator._validateInput(input)) { + enumerator._input=input; + enumerator.length=input.length; + enumerator._remaining=input.length; + enumerator._init(); + if (enumerator.length===0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + else { + enumerator.length=enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining===0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } + else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) { + return lib$es6$promise$utils$$isArray(input); + }; + lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () { + return new OfficeExtension.Error('Array Methods must be provided an Array'); + }; + lib$es6$promise$enumerator$$Enumerator.prototype._init=function () { + this._result=new Array(this.length); + }; + var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator; + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () { + var enumerator=this; + var length=enumerator.length; + var promise=enumerator.promise; + var input=enumerator._input; + for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) { + var enumerator=this; + var c=enumerator._instanceConstructor; + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) { + entry._onerror=null; + enumerator._settledAt(entry._state, i, entry._result); + } + else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } + else { + enumerator._remaining--; + enumerator._result[i]=entry; + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) { + var enumerator=this; + var promise=enumerator.promise; + if (promise._state===lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + if (state===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + else { + enumerator._result[i]=value; + } + } + if (enumerator._remaining===0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) { + var enumerator=this; + lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function (reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + var Constructor=this; + var promise=new Constructor(lib$es6$promise$$internal$$noop); + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + var length=entries.length; + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + return promise; + } + var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + var Constructor=this; + if (object && typeof object==='object' && object.constructor===Constructor) { + return object; + } + var promise=new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + var Constructor=this; + var promise=new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject; + var lib$es6$promise$promise$$counter=0; + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise; + function lib$es6$promise$promise$$Promise(resolver) { + this._id=lib$es6$promise$promise$$counter++; + this._state=undefined; + this._result=undefined; + this._subscribers=[]; + if (lib$es6$promise$$internal$$noop !==resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap; + lib$es6$promise$promise$$Promise.prototype={ + constructor: lib$es6$promise$promise$$Promise, + then: function (onFulfillment, onRejection) { + var parent=this; + var state=parent._state; + if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + var child=new this.constructor(lib$es6$promise$$internal$$noop); + var result=parent._result; + if (state) { + var callback=arguments[state - 1]; + lib$es6$promise$asap$$asap(function () { + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } + else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + return child; + }, + 'catch': function (onRejection) { + return this.then(null, onRejection); + } + }; + OfficeExtension["Promise"]=lib$es6$promise$promise$$default; + }).call(this); + } + PromiseImpl.Init=Init; + })(PromiseImpl || (PromiseImpl={})); +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (OperationType) { + OperationType[OperationType["Default"]=0]="Default"; + OperationType[OperationType["Read"]=1]="Read"; + })(OfficeExtension.OperationType || (OfficeExtension.OperationType={})); + var OperationType=OfficeExtension.OperationType; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var TrackedObjects=(function () { + function TrackedObjects(context) { + this._autoCleanupList={}; + this.m_context=context; + } + TrackedObjects.prototype.add=function (param) { + var _this=this; + if (Array.isArray(param)) { + param.forEach(function (item) { return _this._addCommon(item, true); }); + } + else { + this._addCommon(param, true); + } + }; + TrackedObjects.prototype._autoAdd=function (object) { + this._addCommon(object, false); + this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object; + }; + TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) { + var referenceId=object[OfficeExtension.Constants.referenceId]; + if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) { + object._KeepReference(); + OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object); + if (isExplicitlyAdded && this.m_context._autoCleanup) { + delete this._autoCleanupList[object._objectPath.objectPathInfo.Id]; + } + } + }; + TrackedObjects.prototype.remove=function (param) { + var _this=this; + if (Array.isArray(param)) { + param.forEach(function (item) { return _this._removeCommon(item); }); + } + else { + this._removeCommon(param); + } + }; + TrackedObjects.prototype._removeCommon=function (object) { + var referenceId=object[OfficeExtension.Constants.referenceId]; + if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) { + var rootObject=this.m_context._rootObject; + if (rootObject._RemoveReference) { + rootObject._RemoveReference(referenceId); + } + } + }; + TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () { + var list=this._autoCleanupList; + this._autoCleanupList={}; + return list; + }; + return TrackedObjects; + })(); + OfficeExtension.TrackedObjects=TrackedObjects; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ResourceStrings=(function () { + function ResourceStrings() { + } + ResourceStrings.invalidObjectPath="InvalidObjectPath"; + ResourceStrings.propertyNotLoaded="PropertyNotLoaded"; + ResourceStrings.invalidRequestContext="InvalidRequestContext"; + ResourceStrings.invalidArgument="InvalidArgument"; + ResourceStrings.runMustReturnPromise="RunMustReturnPromise"; + return ResourceStrings; + })(); + OfficeExtension.ResourceStrings=ResourceStrings; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var RichApiMessageUtility=(function () { + function RichApiMessageUtility() { + } + RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) { + var headerArray=[]; + if (headers) { + for (var headerName in headers) { + headerArray.push(headerName); + headerArray.push(headers[headerName]); + } + } + var appPermission=0; + var solutionId=""; + var instanceId=""; + var marketplaceType=""; + return [ + customData, + method, + path, + headerArray, + body, + appPermission, + requestFlags, + solutionId, + instanceId, + marketplaceType + ]; + }; + RichApiMessageUtility.getResponseBody=function (result) { + return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseHeaders=function (result) { + return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) { + var ret=data[2 ]; + if (typeof (ret)==="string") { + return ret; + } + var arr=ret; + return arr.join(""); + }; + RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) { + var arrayHeader=data[1 ]; + if (!arrayHeader) { + return null; + } + var headers={}; + for (var i=0; i < arrayHeader.length - 1; i+=2) { + headers[arrayHeader[i]]=arrayHeader[i+1]; + } + return headers; + }; + RichApiMessageUtility.getResponseStatusCode=function (result) { + return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) { + return data[0 ]; + }; + return RichApiMessageUtility; + })(); + OfficeExtension.RichApiMessageUtility=RichApiMessageUtility; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var Utility=(function () { + function Utility() { + } + Utility.checkArgumentNull=function (value, name) { + }; + Utility.isNullOrUndefined=function (value) { + if (value===null) { + return true; + } + if (typeof (value)==="undefined") { + return true; + } + return false; + }; + Utility.isUndefined=function (value) { + if (typeof (value)==="undefined") { + return true; + } + return false; + }; + Utility.isNullOrEmptyString=function (value) { + if (value===null) { + return true; + } + if (typeof (value)==="undefined") { + return true; + } + if (value.length==0) { + return true; + } + return false; + }; + Utility.trim=function (str) { + return str.replace(new RegExp("^\\s+|\\s+$", "g"), ""); + }; + Utility.caseInsensitiveCompareString=function (str1, str2) { + if (Utility.isNullOrUndefined(str1)) { + return Utility.isNullOrUndefined(str2); + } + else { + if (Utility.isNullOrUndefined(str2)) { + return false; + } + else { + return str1.toUpperCase()==str2.toUpperCase(); + } + } + }; + Utility.isReadonlyRestRequest=function (method) { + return Utility.caseInsensitiveCompareString(method, "GET"); + }; + Utility.setMethodArguments=function (context, argumentInfo, args) { + if (Utility.isNullOrUndefined(args)) { + return null; + } + var referencedObjectPaths=new Array(); + var referencedObjectPathIds=new Array(); + var hasOne=false; + for (var i=0; i < args.length; i++) { + if (args[i] instanceof OfficeExtension.ClientObject) { + var clientObject=args[i]; + Utility.validateContext(context, clientObject); + args[i]=clientObject._objectPath.objectPathInfo.Id; + referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id); + referencedObjectPaths.push(clientObject._objectPath); + hasOne=true; + } + else { + referencedObjectPathIds.push(0); + } + } + argumentInfo.Arguments=args; + if (hasOne) { + argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds; + return referencedObjectPaths; + } + return null; + }; + Utility.fixObjectPathIfNecessary=function (clientObject, value) { + if (clientObject && clientObject._objectPath && value) { + clientObject._objectPath.updateUsingObjectData(value); + } + }; + Utility.validateObjectPath=function (clientObject) { + var objectPath=clientObject._objectPath; + while (objectPath) { + if (!objectPath.isValid) { + var pathExpression=Utility.getObjectPathExpression(objectPath); + Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression); + } + objectPath=objectPath.parentObjectPath; + } + }; + Utility.validateReferencedObjectPaths=function (objectPaths) { + if (objectPaths) { + for (var i=0; i < objectPaths.length; i++) { + var objectPath=objectPaths[i]; + while (objectPath) { + if (!objectPath.isValid) { + var pathExpression=Utility.getObjectPathExpression(objectPath); + Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression); + } + objectPath=objectPath.parentObjectPath; + } + } + } + }; + Utility.validateContext=function (context, obj) { + if (obj && obj.context !==context) { + Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext); + } + }; + Utility.log=function (message) { + if (Utility._logEnabled && window.console && window.console.log) { + window.console.log(message); + } + }; + Utility.load=function (clientObj, option) { + clientObj.context.load(clientObj, option); + }; + Utility.throwError=function (resourceId, arg) { + throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), {}); + }; + Utility.createRuntimeError=function (code, message, location) { + return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location }); + }; + Utility._getResourceString=function (resourceId, arg) { + var ret=resourceId; + if (window.Strings && window.Strings.OfficeOM) { + var stringName="L_"+resourceId; + var stringValue=window.Strings.OfficeOM[stringName]; + if (stringValue) { + ret=stringValue; + } + } + if (!Utility.isNullOrUndefined(arg)) { + ret=ret.replace("{0}", arg); + } + return ret; + }; + Utility.throwIfNotLoaded=function (propertyName, fieldValue) { + if (Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) { + Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName); + } + }; + Utility.getObjectPathExpression=function (objectPath) { + var ret=""; + while (objectPath) { + switch (objectPath.objectPathInfo.ObjectPathType) { + case 1 : + ret=ret; + break; + case 2 : + ret="new()"+(ret.length > 0 ? "." : "")+ret; + break; + case 3 : + ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret; + break; + case 4 : + ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret; + break; + case 5 : + ret="getItem()"+(ret.length > 0 ? "." : "")+ret; + break; + case 6 : + ret="_reference()"+(ret.length > 0 ? "." : "")+ret; + break; + } + objectPath=objectPath.parentObjectPath; + } + return ret; + }; + Utility._createPromiseFromResult=function (value) { + OfficeExtension._EnsurePromise(); + return new OfficeExtension['Promise'](function (resolve, reject) { + resolve(value); + }); + }; + Utility._addActionResultHandler=function (clientObj, action, resultHandler) { + clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler); + }; + Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) { + for (var i=0; i < propertyNames.length - 1; i+=2) { + if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) { + clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]); + } + } + }; + Utility.normalizeName=function (name) { + return name.substr(0, 1).toLowerCase()+name.substr(1); + }; + Utility._logEnabled=false; + Utility.s_underscoreCharCode="_".charCodeAt(0); + return Utility; + })(); + OfficeExtension.Utility=Utility; +})(OfficeExtension || (OfficeExtension={})); + +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var Excel; +(function (Excel) { + var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath; + var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath; + var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath; + var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath; + var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer; + var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt; + var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction; + var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction; + var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined; + var _isUndefined=OfficeExtension.Utility.isUndefined; + var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded; + var _load=OfficeExtension.Utility.load; + var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary; + var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler; + var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults; + var Application=(function (_super) { + __extends(Application, _super); + function Application() { + _super.apply(this, arguments); + } + Object.defineProperty(Application.prototype, "calculationMode", { + get: function () { + _throwIfNotLoaded("calculationMode", this.m_calculationMode); + return this.m_calculationMode; + }, + enumerable: true, + configurable: true + }); + Application.prototype.calculate=function (calculationType) { + _createMethodAction(this.context, this, "Calculate", 0 , [calculationType]); + }; + Application.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["CalculationMode"])) { + this.m_calculationMode=obj["CalculationMode"]; + } + }; + Application.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Application; + })(OfficeExtension.ClientObject); + Excel.Application=Application; + var Workbook=(function (_super) { + __extends(Workbook, _super); + function Workbook() { + _super.apply(this, arguments); + } + Object.defineProperty(Workbook.prototype, "application", { + get: function () { + if (!this.m_application) { + this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false)); + } + return this.m_application; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "bindings", { + get: function () { + if (!this.m_bindings) { + this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false)); + } + return this.m_bindings; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "names", { + get: function () { + if (!this.m_names) { + this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false)); + } + return this.m_names; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "tables", { + get: function () { + if (!this.m_tables) { + this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false)); + } + return this.m_tables; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Workbook.prototype, "worksheets", { + get: function () { + if (!this.m_worksheets) { + this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false)); + } + return this.m_worksheets; + }, + enumerable: true, + configurable: true + }); + Workbook.prototype.getSelectedRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", 1 , [], false, true)); + }; + Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) { + var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", 1 , [bstrReferenceId]); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) { + var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", 1 , [bstrReferenceId]); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Workbook.prototype._GetReferenceCount=function () { + var action=_createMethodAction(this.context, this, "_GetReferenceCount", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Workbook.prototype._RemoveAllReferences=function () { + _createMethodAction(this.context, this, "_RemoveAllReferences", 1 , []); + }; + Workbook.prototype._RemoveReference=function (bstrReferenceId) { + _createMethodAction(this.context, this, "_RemoveReference", 1 , [bstrReferenceId]); + }; + Workbook.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "names", "Names", "tables", "Tables", "worksheets", "Worksheets"]); + }; + Workbook.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Workbook; + })(OfficeExtension.ClientObject); + Excel.Workbook=Workbook; + var Worksheet=(function (_super) { + __extends(Worksheet, _super); + function Worksheet() { + _super.apply(this, arguments); + } + Object.defineProperty(Worksheet.prototype, "charts", { + get: function () { + if (!this.m_charts) { + this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false)); + } + return this.m_charts; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "tables", { + get: function () { + if (!this.m_tables) { + this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false)); + } + return this.m_tables; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "position", { + get: function () { + _throwIfNotLoaded("position", this.m_position); + return this.m_position; + }, + set: function (value) { + this.m_position=value; + _createSetPropertyAction(this.context, this, "Position", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Worksheet.prototype, "visibility", { + get: function () { + _throwIfNotLoaded("visibility", this.m_visibility); + return this.m_visibility; + }, + enumerable: true, + configurable: true + }); + Worksheet.prototype.activate=function () { + _createMethodAction(this.context, this, "Activate", 1 , []); + }; + Worksheet.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Worksheet.prototype.getCell=function (row, column) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", 1 , [row, column], false, true)); + }; + Worksheet.prototype.getRange=function (address) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [address], false, true)); + }; + Worksheet.prototype.getUsedRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", 1 , [], false, true)); + }; + Worksheet.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Position"])) { + this.m_position=obj["Position"]; + } + if (!_isUndefined(obj["Visibility"])) { + this.m_visibility=obj["Visibility"]; + } + _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "tables", "Tables"]); + }; + Worksheet.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Worksheet; + })(OfficeExtension.ClientObject); + Excel.Worksheet=Worksheet; + var WorksheetCollection=(function (_super) { + __extends(WorksheetCollection, _super); + function WorksheetCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(WorksheetCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + WorksheetCollection.prototype.add=function (name) { + return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [name], false, true)); + }; + WorksheetCollection.prototype.getActiveWorksheet=function () { + return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", 1 , [], false, false)); + }; + WorksheetCollection.prototype.getItem=function (key) { + return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key])); + }; + WorksheetCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + WorksheetCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return WorksheetCollection; + })(OfficeExtension.ClientObject); + Excel.WorksheetCollection=WorksheetCollection; + var Range=(function (_super) { + __extends(Range, _super); + function Range() { + _super.apply(this, arguments); + } + Object.defineProperty(Range.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "worksheet", { + get: function () { + if (!this.m_worksheet) { + this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false)); + } + return this.m_worksheet; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "address", { + get: function () { + _throwIfNotLoaded("address", this.m_address); + return this.m_address; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "addressLocal", { + get: function () { + _throwIfNotLoaded("addressLocal", this.m_addressLocal); + return this.m_addressLocal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "cellCount", { + get: function () { + _throwIfNotLoaded("cellCount", this.m_cellCount); + return this.m_cellCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "columnCount", { + get: function () { + _throwIfNotLoaded("columnCount", this.m_columnCount); + return this.m_columnCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "columnIndex", { + get: function () { + _throwIfNotLoaded("columnIndex", this.m_columnIndex); + return this.m_columnIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "formulas", { + get: function () { + _throwIfNotLoaded("formulas", this.m_formulas); + return this.m_formulas; + }, + set: function (value) { + this.m_formulas=value; + _createSetPropertyAction(this.context, this, "Formulas", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "formulasLocal", { + get: function () { + _throwIfNotLoaded("formulasLocal", this.m_formulasLocal); + return this.m_formulasLocal; + }, + set: function (value) { + this.m_formulasLocal=value; + _createSetPropertyAction(this.context, this, "FormulasLocal", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "numberFormat", { + get: function () { + _throwIfNotLoaded("numberFormat", this.m_numberFormat); + return this.m_numberFormat; + }, + set: function (value) { + this.m_numberFormat=value; + _createSetPropertyAction(this.context, this, "NumberFormat", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "rowCount", { + get: function () { + _throwIfNotLoaded("rowCount", this.m_rowCount); + return this.m_rowCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "rowIndex", { + get: function () { + _throwIfNotLoaded("rowIndex", this.m_rowIndex); + return this.m_rowIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "valueTypes", { + get: function () { + _throwIfNotLoaded("valueTypes", this.m_valueTypes); + return this.m_valueTypes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "values", { + get: function () { + _throwIfNotLoaded("values", this.m_values); + return this.m_values; + }, + set: function (value) { + this.m_values=value; + _createSetPropertyAction(this.context, this, "Values", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + Range.prototype.clear=function (applyTo) { + _createMethodAction(this.context, this, "Clear", 0 , [applyTo]); + }; + Range.prototype.delete=function (shift) { + _createMethodAction(this.context, this, "Delete", 0 , [shift]); + }; + Range.prototype.getBoundingRect=function (anotherRange) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", 1 , [anotherRange], false, true)); + }; + Range.prototype.getCell=function (row, column) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", 1 , [row, column], false, true)); + }; + Range.prototype.getColumn=function (column) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", 1 , [column], false, true)); + }; + Range.prototype.getEntireColumn=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", 1 , [], false, true)); + }; + Range.prototype.getEntireRow=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", 1 , [], false, true)); + }; + Range.prototype.getIntersection=function (anotherRange) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", 1 , [anotherRange], false, true)); + }; + Range.prototype.getLastCell=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", 1 , [], false, true)); + }; + Range.prototype.getLastColumn=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", 1 , [], false, true)); + }; + Range.prototype.getLastRow=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", 1 , [], false, true)); + }; + Range.prototype.getOffsetRange=function (rowOffset, columnOffset) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", 1 , [rowOffset, columnOffset], false, true)); + }; + Range.prototype.getRow=function (row) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", 1 , [row], false, true)); + }; + Range.prototype.getUsedRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", 1 , [], false, true)); + }; + Range.prototype.insert=function (shift) { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", 0 , [shift], false, true)); + }; + Range.prototype.select=function () { + _createMethodAction(this.context, this, "Select", 1 , []); + }; + Range.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + Range.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Address"])) { + this.m_address=obj["Address"]; + } + if (!_isUndefined(obj["AddressLocal"])) { + this.m_addressLocal=obj["AddressLocal"]; + } + if (!_isUndefined(obj["CellCount"])) { + this.m_cellCount=obj["CellCount"]; + } + if (!_isUndefined(obj["ColumnCount"])) { + this.m_columnCount=obj["ColumnCount"]; + } + if (!_isUndefined(obj["ColumnIndex"])) { + this.m_columnIndex=obj["ColumnIndex"]; + } + if (!_isUndefined(obj["Formulas"])) { + this.m_formulas=obj["Formulas"]; + } + if (!_isUndefined(obj["FormulasLocal"])) { + this.m_formulasLocal=obj["FormulasLocal"]; + } + if (!_isUndefined(obj["NumberFormat"])) { + this.m_numberFormat=obj["NumberFormat"]; + } + if (!_isUndefined(obj["RowCount"])) { + this.m_rowCount=obj["RowCount"]; + } + if (!_isUndefined(obj["RowIndex"])) { + this.m_rowIndex=obj["RowIndex"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["ValueTypes"])) { + this.m_valueTypes=obj["ValueTypes"]; + } + if (!_isUndefined(obj["Values"])) { + this.m_values=obj["Values"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format", "worksheet", "Worksheet"]); + }; + Range.prototype.load=function (option) { + _load(this, option); + return this; + }; + Range.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return Range; + })(OfficeExtension.ClientObject); + Excel.Range=Range; + var NamedItemCollection=(function (_super) { + __extends(NamedItemCollection, _super); + function NamedItemCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(NamedItemCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + NamedItemCollection.prototype.getItem=function (name) { + return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name])); + }; + NamedItemCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + NamedItemCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return NamedItemCollection; + })(OfficeExtension.ClientObject); + Excel.NamedItemCollection=NamedItemCollection; + var NamedItem=(function (_super) { + __extends(NamedItem, _super); + function NamedItem() { + _super.apply(this, arguments); + } + Object.defineProperty(NamedItem.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "type", { + get: function () { + _throwIfNotLoaded("type", this.m_type); + return this.m_type; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "value", { + get: function () { + _throwIfNotLoaded("value", this.m_value); + return this.m_value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NamedItem.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + NamedItem.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + NamedItem.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Type"])) { + this.m_type=obj["Type"]; + } + if (!_isUndefined(obj["Value"])) { + this.m_value=obj["Value"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + }; + NamedItem.prototype.load=function (option) { + _load(this, option); + return this; + }; + return NamedItem; + })(OfficeExtension.ClientObject); + Excel.NamedItem=NamedItem; + var Binding=(function (_super) { + __extends(Binding, _super); + function Binding() { + _super.apply(this, arguments); + } + Object.defineProperty(Binding.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "type", { + get: function () { + _throwIfNotLoaded("type", this.m_type); + return this.m_type; + }, + enumerable: true, + configurable: true + }); + Binding.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, false)); + }; + Binding.prototype.getTable=function () { + return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", 1 , [], false, false)); + }; + Binding.prototype.getText=function () { + var action=_createMethodAction(this.context, this, "GetText", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Binding.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Type"])) { + this.m_type=obj["Type"]; + } + }; + Binding.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Binding; + })(OfficeExtension.ClientObject); + Excel.Binding=Binding; + var BindingCollection=(function (_super) { + __extends(BindingCollection, _super); + function BindingCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(BindingCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BindingCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + BindingCollection.prototype.getItem=function (id) { + return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id])); + }; + BindingCollection.prototype.getItemAt=function (index) { + return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + BindingCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + BindingCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return BindingCollection; + })(OfficeExtension.ClientObject); + Excel.BindingCollection=BindingCollection; + var TableCollection=(function (_super) { + __extends(TableCollection, _super); + function TableCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(TableCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + TableCollection.prototype.add=function (address, hasHeaders) { + return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [address, hasHeaders], false, true)); + }; + TableCollection.prototype.getItem=function (key) { + return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key])); + }; + TableCollection.prototype.getItemAt=function (index) { + return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + TableCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + TableCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableCollection; + })(OfficeExtension.ClientObject); + Excel.TableCollection=TableCollection; + var Table=(function (_super) { + __extends(Table, _super); + function Table() { + _super.apply(this, arguments); + } + Object.defineProperty(Table.prototype, "columns", { + get: function () { + if (!this.m_columns) { + this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false)); + } + return this.m_columns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "rows", { + get: function () { + if (!this.m_rows) { + this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false)); + } + return this.m_rows; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "showHeaders", { + get: function () { + _throwIfNotLoaded("showHeaders", this.m_showHeaders); + return this.m_showHeaders; + }, + set: function (value) { + this.m_showHeaders=value; + _createSetPropertyAction(this.context, this, "ShowHeaders", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "showTotals", { + get: function () { + _throwIfNotLoaded("showTotals", this.m_showTotals); + return this.m_showTotals; + }, + set: function (value) { + this.m_showTotals=value; + _createSetPropertyAction(this.context, this, "ShowTotals", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Table.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Table.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Table.prototype.getDataBodyRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", 1 , [], false, true)); + }; + Table.prototype.getHeaderRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", 1 , [], false, true)); + }; + Table.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + Table.prototype.getTotalRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", 1 , [], false, true)); + }; + Table.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["ShowHeaders"])) { + this.m_showHeaders=obj["ShowHeaders"]; + } + if (!_isUndefined(obj["ShowTotals"])) { + this.m_showTotals=obj["ShowTotals"]; + } + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows"]); + }; + Table.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Table; + })(OfficeExtension.ClientObject); + Excel.Table=Table; + var TableColumnCollection=(function (_super) { + __extends(TableColumnCollection, _super); + function TableColumnCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(TableColumnCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumnCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + TableColumnCollection.prototype.add=function (index, values) { + return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [index, values], false, true)); + }; + TableColumnCollection.prototype.getItem=function (key) { + return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key])); + }; + TableColumnCollection.prototype.getItemAt=function (index) { + return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + TableColumnCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + TableColumnCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableColumnCollection; + })(OfficeExtension.ClientObject); + Excel.TableColumnCollection=TableColumnCollection; + var TableColumn=(function (_super) { + __extends(TableColumn, _super); + function TableColumn() { + _super.apply(this, arguments); + } + Object.defineProperty(TableColumn.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumn.prototype, "index", { + get: function () { + _throwIfNotLoaded("index", this.m_index); + return this.m_index; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumn.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableColumn.prototype, "values", { + get: function () { + _throwIfNotLoaded("values", this.m_values); + return this.m_values; + }, + set: function (value) { + this.m_values=value; + _createSetPropertyAction(this.context, this, "Values", value); + }, + enumerable: true, + configurable: true + }); + TableColumn.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + TableColumn.prototype.getDataBodyRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", 1 , [], false, true)); + }; + TableColumn.prototype.getHeaderRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", 1 , [], false, true)); + }; + TableColumn.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + TableColumn.prototype.getTotalRowRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", 1 , [], false, true)); + }; + TableColumn.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["Index"])) { + this.m_index=obj["Index"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Values"])) { + this.m_values=obj["Values"]; + } + }; + TableColumn.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableColumn; + })(OfficeExtension.ClientObject); + Excel.TableColumn=TableColumn; + var TableRowCollection=(function (_super) { + __extends(TableRowCollection, _super); + function TableRowCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(TableRowCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableRowCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + TableRowCollection.prototype.add=function (index, values) { + return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [index, values], false, true)); + }; + TableRowCollection.prototype.getItemAt=function (index) { + return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + TableRowCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + TableRowCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableRowCollection; + })(OfficeExtension.ClientObject); + Excel.TableRowCollection=TableRowCollection; + var TableRow=(function (_super) { + __extends(TableRow, _super); + function TableRow() { + _super.apply(this, arguments); + } + Object.defineProperty(TableRow.prototype, "index", { + get: function () { + _throwIfNotLoaded("index", this.m_index); + return this.m_index; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableRow.prototype, "values", { + get: function () { + _throwIfNotLoaded("values", this.m_values); + return this.m_values; + }, + set: function (value) { + this.m_values=value; + _createSetPropertyAction(this.context, this, "Values", value); + }, + enumerable: true, + configurable: true + }); + TableRow.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + TableRow.prototype.getRange=function () { + return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true)); + }; + TableRow.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Index"])) { + this.m_index=obj["Index"]; + } + if (!_isUndefined(obj["Values"])) { + this.m_values=obj["Values"]; + } + }; + TableRow.prototype.load=function (option) { + _load(this, option); + return this; + }; + return TableRow; + })(OfficeExtension.ClientObject); + Excel.TableRow=TableRow; + var RangeFormat=(function (_super) { + __extends(RangeFormat, _super); + function RangeFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeFormat.prototype, "borders", { + get: function () { + if (!this.m_borders) { + this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false)); + } + return this.m_borders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", { + get: function () { + _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment); + return this.m_horizontalAlignment; + }, + set: function (value) { + this.m_horizontalAlignment=value; + _createSetPropertyAction(this.context, this, "HorizontalAlignment", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "verticalAlignment", { + get: function () { + _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment); + return this.m_verticalAlignment; + }, + set: function (value) { + this.m_verticalAlignment=value; + _createSetPropertyAction(this.context, this, "VerticalAlignment", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFormat.prototype, "wrapText", { + get: function () { + _throwIfNotLoaded("wrapText", this.m_wrapText); + return this.m_wrapText; + }, + set: function (value) { + this.m_wrapText=value; + _createSetPropertyAction(this.context, this, "WrapText", value); + }, + enumerable: true, + configurable: true + }); + RangeFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["HorizontalAlignment"])) { + this.m_horizontalAlignment=obj["HorizontalAlignment"]; + } + if (!_isUndefined(obj["VerticalAlignment"])) { + this.m_verticalAlignment=obj["VerticalAlignment"]; + } + if (!_isUndefined(obj["WrapText"])) { + this.m_wrapText=obj["WrapText"]; + } + _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font"]); + }; + RangeFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeFormat; + })(OfficeExtension.ClientObject); + Excel.RangeFormat=RangeFormat; + var RangeFill=(function (_super) { + __extends(RangeFill, _super); + function RangeFill() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeFill.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + RangeFill.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + RangeFill.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + }; + RangeFill.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeFill; + })(OfficeExtension.ClientObject); + Excel.RangeFill=RangeFill; + var RangeBorder=(function (_super) { + __extends(RangeBorder, _super); + function RangeBorder() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeBorder.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorder.prototype, "sideIndex", { + get: function () { + _throwIfNotLoaded("sideIndex", this.m_sideIndex); + return this.m_sideIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorder.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorder.prototype, "weight", { + get: function () { + _throwIfNotLoaded("weight", this.m_weight); + return this.m_weight; + }, + set: function (value) { + this.m_weight=value; + _createSetPropertyAction(this.context, this, "Weight", value); + }, + enumerable: true, + configurable: true + }); + RangeBorder.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["SideIndex"])) { + this.m_sideIndex=obj["SideIndex"]; + } + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + if (!_isUndefined(obj["Weight"])) { + this.m_weight=obj["Weight"]; + } + }; + RangeBorder.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeBorder; + })(OfficeExtension.ClientObject); + Excel.RangeBorder=RangeBorder; + var RangeBorderCollection=(function (_super) { + __extends(RangeBorderCollection, _super); + function RangeBorderCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeBorderCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeBorderCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + RangeBorderCollection.prototype.getItem=function (index) { + return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index])); + }; + RangeBorderCollection.prototype.getItemAt=function (index) { + return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + RangeBorderCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + RangeBorderCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeBorderCollection; + })(OfficeExtension.ClientObject); + Excel.RangeBorderCollection=RangeBorderCollection; + var RangeFont=(function (_super) { + __extends(RangeFont, _super); + function RangeFont() { + _super.apply(this, arguments); + } + Object.defineProperty(RangeFont.prototype, "bold", { + get: function () { + _throwIfNotLoaded("bold", this.m_bold); + return this.m_bold; + }, + set: function (value) { + this.m_bold=value; + _createSetPropertyAction(this.context, this, "Bold", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "italic", { + get: function () { + _throwIfNotLoaded("italic", this.m_italic); + return this.m_italic; + }, + set: function (value) { + this.m_italic=value; + _createSetPropertyAction(this.context, this, "Italic", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "size", { + get: function () { + _throwIfNotLoaded("size", this.m_size); + return this.m_size; + }, + set: function (value) { + this.m_size=value; + _createSetPropertyAction(this.context, this, "Size", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RangeFont.prototype, "underline", { + get: function () { + _throwIfNotLoaded("underline", this.m_underline); + return this.m_underline; + }, + set: function (value) { + this.m_underline=value; + _createSetPropertyAction(this.context, this, "Underline", value); + }, + enumerable: true, + configurable: true + }); + RangeFont.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Bold"])) { + this.m_bold=obj["Bold"]; + } + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["Italic"])) { + this.m_italic=obj["Italic"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Size"])) { + this.m_size=obj["Size"]; + } + if (!_isUndefined(obj["Underline"])) { + this.m_underline=obj["Underline"]; + } + }; + RangeFont.prototype.load=function (option) { + _load(this, option); + return this; + }; + return RangeFont; + })(OfficeExtension.ClientObject); + Excel.RangeFont=RangeFont; + var ChartCollection=(function (_super) { + __extends(ChartCollection, _super); + function ChartCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + ChartCollection.prototype.add=function (type, sourceData, seriesBy) { + if (!(sourceData instanceof Range)) { + throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add"); + } + return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [type, sourceData, seriesBy], false, true)); + }; + ChartCollection.prototype.getItem=function (name) { + return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", 1 , [name], false, false)); + }; + ChartCollection.prototype.getItemAt=function (index) { + return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + ChartCollection.prototype._GetItem=function (id) { + return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [id])); + }; + ChartCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ChartCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartCollection; + })(OfficeExtension.ClientObject); + Excel.ChartCollection=ChartCollection; + var Chart=(function (_super) { + __extends(Chart, _super); + function Chart() { + _super.apply(this, arguments); + } + Object.defineProperty(Chart.prototype, "axes", { + get: function () { + if (!this.m_axes) { + this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false)); + } + return this.m_axes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "dataLabels", { + get: function () { + if (!this.m_dataLabels) { + this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false)); + } + return this.m_dataLabels; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "legend", { + get: function () { + if (!this.m_legend) { + this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false)); + } + return this.m_legend; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "series", { + get: function () { + if (!this.m_series) { + this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false)); + } + return this.m_series; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "title", { + get: function () { + if (!this.m_title) { + this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false)); + } + return this.m_title; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "height", { + get: function () { + _throwIfNotLoaded("height", this.m_height); + return this.m_height; + }, + set: function (value) { + this.m_height=value; + _createSetPropertyAction(this.context, this, "Height", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "left", { + get: function () { + _throwIfNotLoaded("left", this.m_left); + return this.m_left; + }, + set: function (value) { + this.m_left=value; + _createSetPropertyAction(this.context, this, "Left", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "top", { + get: function () { + _throwIfNotLoaded("top", this.m_top); + return this.m_top; + }, + set: function (value) { + this.m_top=value; + _createSetPropertyAction(this.context, this, "Top", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "width", { + get: function () { + _throwIfNotLoaded("width", this.m_width); + return this.m_width; + }, + set: function (value) { + this.m_width=value; + _createSetPropertyAction(this.context, this, "Width", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Chart.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + Chart.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Chart.prototype.setData=function (sourceData, seriesBy) { + if (!(sourceData instanceof Range)) { + throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData"); + } + _createMethodAction(this.context, this, "SetData", 0 , [sourceData, seriesBy]); + }; + Chart.prototype.setPosition=function (startCell, endCell) { + _createMethodAction(this.context, this, "SetPosition", 0 , [startCell, endCell]); + }; + Chart.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Height"])) { + this.m_height=obj["Height"]; + } + if (!_isUndefined(obj["Left"])) { + this.m_left=obj["Left"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Top"])) { + this.m_top=obj["Top"]; + } + if (!_isUndefined(obj["Width"])) { + this.m_width=obj["Width"]; + } + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title"]); + }; + Chart.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Chart; + })(OfficeExtension.ClientObject); + Excel.Chart=Chart; + var ChartAreaFormat=(function (_super) { + __extends(ChartAreaFormat, _super); + function ChartAreaFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAreaFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAreaFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartAreaFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartAreaFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAreaFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAreaFormat=ChartAreaFormat; + var ChartSeriesCollection=(function (_super) { + __extends(ChartSeriesCollection, _super); + function ChartSeriesCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartSeriesCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeriesCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + ChartSeriesCollection.prototype.getItemAt=function (index) { + return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + ChartSeriesCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ChartSeriesCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartSeriesCollection; + })(OfficeExtension.ClientObject); + Excel.ChartSeriesCollection=ChartSeriesCollection; + var ChartSeries=(function (_super) { + __extends(ChartSeries, _super); + function ChartSeries() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartSeries.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeries.prototype, "points", { + get: function () { + if (!this.m_points) { + this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false)); + } + return this.m_points; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeries.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + ChartSeries.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]); + }; + ChartSeries.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartSeries; + })(OfficeExtension.ClientObject); + Excel.ChartSeries=ChartSeries; + var ChartSeriesFormat=(function (_super) { + __extends(ChartSeriesFormat, _super); + function ChartSeriesFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartSeriesFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartSeriesFormat.prototype, "line", { + get: function () { + if (!this.m_line) { + this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false)); + } + return this.m_line; + }, + enumerable: true, + configurable: true + }); + ChartSeriesFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]); + }; + ChartSeriesFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartSeriesFormat; + })(OfficeExtension.ClientObject); + Excel.ChartSeriesFormat=ChartSeriesFormat; + var ChartPointsCollection=(function (_super) { + __extends(ChartPointsCollection, _super); + function ChartPointsCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartPointsCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartPointsCollection.prototype, "count", { + get: function () { + _throwIfNotLoaded("count", this.m_count); + return this.m_count; + }, + enumerable: true, + configurable: true + }); + ChartPointsCollection.prototype.getItemAt=function (index) { + return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false)); + }; + ChartPointsCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Count"])) { + this.m_count=obj["Count"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i)); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ChartPointsCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartPointsCollection; + })(OfficeExtension.ClientObject); + Excel.ChartPointsCollection=ChartPointsCollection; + var ChartPoint=(function (_super) { + __extends(ChartPoint, _super); + function ChartPoint() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartPoint.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartPoint.prototype, "value", { + get: function () { + _throwIfNotLoaded("value", this.m_value); + return this.m_value; + }, + enumerable: true, + configurable: true + }); + ChartPoint.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Value"])) { + this.m_value=obj["Value"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartPoint.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartPoint; + })(OfficeExtension.ClientObject); + Excel.ChartPoint=ChartPoint; + var ChartPointFormat=(function (_super) { + __extends(ChartPointFormat, _super); + function ChartPointFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartPointFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + ChartPointFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]); + }; + ChartPointFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartPointFormat; + })(OfficeExtension.ClientObject); + Excel.ChartPointFormat=ChartPointFormat; + var ChartAxes=(function (_super) { + __extends(ChartAxes, _super); + function ChartAxes() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxes.prototype, "categoryAxis", { + get: function () { + if (!this.m_categoryAxis) { + this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false)); + } + return this.m_categoryAxis; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxes.prototype, "seriesAxis", { + get: function () { + if (!this.m_seriesAxis) { + this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false)); + } + return this.m_seriesAxis; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxes.prototype, "valueAxis", { + get: function () { + if (!this.m_valueAxis) { + this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false)); + } + return this.m_valueAxis; + }, + enumerable: true, + configurable: true + }); + ChartAxes.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]); + }; + ChartAxes.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxes; + })(OfficeExtension.ClientObject); + Excel.ChartAxes=ChartAxes; + var ChartAxis=(function (_super) { + __extends(ChartAxis, _super); + function ChartAxis() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxis.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "majorGridlines", { + get: function () { + if (!this.m_majorGridlines) { + this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false)); + } + return this.m_majorGridlines; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "minorGridlines", { + get: function () { + if (!this.m_minorGridlines) { + this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false)); + } + return this.m_minorGridlines; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "title", { + get: function () { + if (!this.m_title) { + this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false)); + } + return this.m_title; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "majorUnit", { + get: function () { + _throwIfNotLoaded("majorUnit", this.m_majorUnit); + return this.m_majorUnit; + }, + set: function (value) { + this.m_majorUnit=value; + _createSetPropertyAction(this.context, this, "MajorUnit", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "maximum", { + get: function () { + _throwIfNotLoaded("maximum", this.m_maximum); + return this.m_maximum; + }, + set: function (value) { + this.m_maximum=value; + _createSetPropertyAction(this.context, this, "Maximum", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "minimum", { + get: function () { + _throwIfNotLoaded("minimum", this.m_minimum); + return this.m_minimum; + }, + set: function (value) { + this.m_minimum=value; + _createSetPropertyAction(this.context, this, "Minimum", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxis.prototype, "minorUnit", { + get: function () { + _throwIfNotLoaded("minorUnit", this.m_minorUnit); + return this.m_minorUnit; + }, + set: function (value) { + this.m_minorUnit=value; + _createSetPropertyAction(this.context, this, "MinorUnit", value); + }, + enumerable: true, + configurable: true + }); + ChartAxis.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["MajorUnit"])) { + this.m_majorUnit=obj["MajorUnit"]; + } + if (!_isUndefined(obj["Maximum"])) { + this.m_maximum=obj["Maximum"]; + } + if (!_isUndefined(obj["Minimum"])) { + this.m_minimum=obj["Minimum"]; + } + if (!_isUndefined(obj["MinorUnit"])) { + this.m_minorUnit=obj["MinorUnit"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]); + }; + ChartAxis.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxis; + })(OfficeExtension.ClientObject); + Excel.ChartAxis=ChartAxis; + var ChartAxisFormat=(function (_super) { + __extends(ChartAxisFormat, _super); + function ChartAxisFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxisFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxisFormat.prototype, "line", { + get: function () { + if (!this.m_line) { + this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false)); + } + return this.m_line; + }, + enumerable: true, + configurable: true + }); + ChartAxisFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]); + }; + ChartAxisFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxisFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAxisFormat=ChartAxisFormat; + var ChartAxisTitle=(function (_super) { + __extends(ChartAxisTitle, _super); + function ChartAxisTitle() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxisTitle.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxisTitle.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + set: function (value) { + this.m_text=value; + _createSetPropertyAction(this.context, this, "Text", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartAxisTitle.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartAxisTitle.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartAxisTitle.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxisTitle; + })(OfficeExtension.ClientObject); + Excel.ChartAxisTitle=ChartAxisTitle; + var ChartAxisTitleFormat=(function (_super) { + __extends(ChartAxisTitleFormat, _super); + function ChartAxisTitleFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartAxisTitleFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartAxisTitleFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["font", "Font"]); + }; + ChartAxisTitleFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartAxisTitleFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAxisTitleFormat=ChartAxisTitleFormat; + var ChartDataLabels=(function (_super) { + __extends(ChartDataLabels, _super); + function ChartDataLabels() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartDataLabels.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "position", { + get: function () { + _throwIfNotLoaded("position", this.m_position); + return this.m_position; + }, + set: function (value) { + this.m_position=value; + _createSetPropertyAction(this.context, this, "Position", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "separator", { + get: function () { + _throwIfNotLoaded("separator", this.m_separator); + return this.m_separator; + }, + set: function (value) { + this.m_separator=value; + _createSetPropertyAction(this.context, this, "Separator", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", { + get: function () { + _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize); + return this.m_showBubbleSize; + }, + set: function (value) { + this.m_showBubbleSize=value; + _createSetPropertyAction(this.context, this, "ShowBubbleSize", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", { + get: function () { + _throwIfNotLoaded("showCategoryName", this.m_showCategoryName); + return this.m_showCategoryName; + }, + set: function (value) { + this.m_showCategoryName=value; + _createSetPropertyAction(this.context, this, "ShowCategoryName", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", { + get: function () { + _throwIfNotLoaded("showLegendKey", this.m_showLegendKey); + return this.m_showLegendKey; + }, + set: function (value) { + this.m_showLegendKey=value; + _createSetPropertyAction(this.context, this, "ShowLegendKey", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showPercentage", { + get: function () { + _throwIfNotLoaded("showPercentage", this.m_showPercentage); + return this.m_showPercentage; + }, + set: function (value) { + this.m_showPercentage=value; + _createSetPropertyAction(this.context, this, "ShowPercentage", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", { + get: function () { + _throwIfNotLoaded("showSeriesName", this.m_showSeriesName); + return this.m_showSeriesName; + }, + set: function (value) { + this.m_showSeriesName=value; + _createSetPropertyAction(this.context, this, "ShowSeriesName", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabels.prototype, "showValue", { + get: function () { + _throwIfNotLoaded("showValue", this.m_showValue); + return this.m_showValue; + }, + set: function (value) { + this.m_showValue=value; + _createSetPropertyAction(this.context, this, "ShowValue", value); + }, + enumerable: true, + configurable: true + }); + ChartDataLabels.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Position"])) { + this.m_position=obj["Position"]; + } + if (!_isUndefined(obj["Separator"])) { + this.m_separator=obj["Separator"]; + } + if (!_isUndefined(obj["ShowBubbleSize"])) { + this.m_showBubbleSize=obj["ShowBubbleSize"]; + } + if (!_isUndefined(obj["ShowCategoryName"])) { + this.m_showCategoryName=obj["ShowCategoryName"]; + } + if (!_isUndefined(obj["ShowLegendKey"])) { + this.m_showLegendKey=obj["ShowLegendKey"]; + } + if (!_isUndefined(obj["ShowPercentage"])) { + this.m_showPercentage=obj["ShowPercentage"]; + } + if (!_isUndefined(obj["ShowSeriesName"])) { + this.m_showSeriesName=obj["ShowSeriesName"]; + } + if (!_isUndefined(obj["ShowValue"])) { + this.m_showValue=obj["ShowValue"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartDataLabels.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartDataLabels; + })(OfficeExtension.ClientObject); + Excel.ChartDataLabels=ChartDataLabels; + var ChartDataLabelFormat=(function (_super) { + __extends(ChartDataLabelFormat, _super); + function ChartDataLabelFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartDataLabelFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartDataLabelFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartDataLabelFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartDataLabelFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartDataLabelFormat; + })(OfficeExtension.ClientObject); + Excel.ChartDataLabelFormat=ChartDataLabelFormat; + var ChartGridlines=(function (_super) { + __extends(ChartGridlines, _super); + function ChartGridlines() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartGridlines.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartGridlines.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartGridlines.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartGridlines.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartGridlines; + })(OfficeExtension.ClientObject); + Excel.ChartGridlines=ChartGridlines; + var ChartGridlinesFormat=(function (_super) { + __extends(ChartGridlinesFormat, _super); + function ChartGridlinesFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartGridlinesFormat.prototype, "line", { + get: function () { + if (!this.m_line) { + this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false)); + } + return this.m_line; + }, + enumerable: true, + configurable: true + }); + ChartGridlinesFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["line", "Line"]); + }; + ChartGridlinesFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartGridlinesFormat; + })(OfficeExtension.ClientObject); + Excel.ChartGridlinesFormat=ChartGridlinesFormat; + var ChartLegend=(function (_super) { + __extends(ChartLegend, _super); + function ChartLegend() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartLegend.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegend.prototype, "overlay", { + get: function () { + _throwIfNotLoaded("overlay", this.m_overlay); + return this.m_overlay; + }, + set: function (value) { + this.m_overlay=value; + _createSetPropertyAction(this.context, this, "Overlay", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegend.prototype, "position", { + get: function () { + _throwIfNotLoaded("position", this.m_position); + return this.m_position; + }, + set: function (value) { + this.m_position=value; + _createSetPropertyAction(this.context, this, "Position", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegend.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartLegend.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Overlay"])) { + this.m_overlay=obj["Overlay"]; + } + if (!_isUndefined(obj["Position"])) { + this.m_position=obj["Position"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartLegend.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartLegend; + })(OfficeExtension.ClientObject); + Excel.ChartLegend=ChartLegend; + var ChartLegendFormat=(function (_super) { + __extends(ChartLegendFormat, _super); + function ChartLegendFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartLegendFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartLegendFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartLegendFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartLegendFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartLegendFormat; + })(OfficeExtension.ClientObject); + Excel.ChartLegendFormat=ChartLegendFormat; + var ChartTitle=(function (_super) { + __extends(ChartTitle, _super); + function ChartTitle() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartTitle.prototype, "format", { + get: function () { + if (!this.m_format) { + this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false)); + } + return this.m_format; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitle.prototype, "overlay", { + get: function () { + _throwIfNotLoaded("overlay", this.m_overlay); + return this.m_overlay; + }, + set: function (value) { + this.m_overlay=value; + _createSetPropertyAction(this.context, this, "Overlay", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitle.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + set: function (value) { + this.m_text=value; + _createSetPropertyAction(this.context, this, "Text", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitle.prototype, "visible", { + get: function () { + _throwIfNotLoaded("visible", this.m_visible); + return this.m_visible; + }, + set: function (value) { + this.m_visible=value; + _createSetPropertyAction(this.context, this, "Visible", value); + }, + enumerable: true, + configurable: true + }); + ChartTitle.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Overlay"])) { + this.m_overlay=obj["Overlay"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["Visible"])) { + this.m_visible=obj["Visible"]; + } + _handleNavigationPropertyResults(this, obj, ["format", "Format"]); + }; + ChartTitle.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartTitle; + })(OfficeExtension.ClientObject); + Excel.ChartTitle=ChartTitle; + var ChartTitleFormat=(function (_super) { + __extends(ChartTitleFormat, _super); + function ChartTitleFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartTitleFormat.prototype, "fill", { + get: function () { + if (!this.m_fill) { + this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false)); + } + return this.m_fill; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartTitleFormat.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + ChartTitleFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]); + }; + ChartTitleFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartTitleFormat; + })(OfficeExtension.ClientObject); + Excel.ChartTitleFormat=ChartTitleFormat; + var ChartFill=(function (_super) { + __extends(ChartFill, _super); + function ChartFill() { + _super.apply(this, arguments); + } + ChartFill.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + ChartFill.prototype.setSolidColor=function (color) { + _createMethodAction(this.context, this, "SetSolidColor", 0 , [color]); + }; + ChartFill.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + }; + ChartFill.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartFill; + })(OfficeExtension.ClientObject); + Excel.ChartFill=ChartFill; + var ChartLineFormat=(function (_super) { + __extends(ChartLineFormat, _super); + function ChartLineFormat() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartLineFormat.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + ChartLineFormat.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + ChartLineFormat.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + }; + ChartLineFormat.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartLineFormat; + })(OfficeExtension.ClientObject); + Excel.ChartLineFormat=ChartLineFormat; + var ChartFont=(function (_super) { + __extends(ChartFont, _super); + function ChartFont() { + _super.apply(this, arguments); + } + Object.defineProperty(ChartFont.prototype, "bold", { + get: function () { + _throwIfNotLoaded("bold", this.m_bold); + return this.m_bold; + }, + set: function (value) { + this.m_bold=value; + _createSetPropertyAction(this.context, this, "Bold", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "italic", { + get: function () { + _throwIfNotLoaded("italic", this.m_italic); + return this.m_italic; + }, + set: function (value) { + this.m_italic=value; + _createSetPropertyAction(this.context, this, "Italic", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "size", { + get: function () { + _throwIfNotLoaded("size", this.m_size); + return this.m_size; + }, + set: function (value) { + this.m_size=value; + _createSetPropertyAction(this.context, this, "Size", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ChartFont.prototype, "underline", { + get: function () { + _throwIfNotLoaded("underline", this.m_underline); + return this.m_underline; + }, + set: function (value) { + this.m_underline=value; + _createSetPropertyAction(this.context, this, "Underline", value); + }, + enumerable: true, + configurable: true + }); + ChartFont.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Bold"])) { + this.m_bold=obj["Bold"]; + } + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["Italic"])) { + this.m_italic=obj["Italic"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Size"])) { + this.m_size=obj["Size"]; + } + if (!_isUndefined(obj["Underline"])) { + this.m_underline=obj["Underline"]; + } + }; + ChartFont.prototype.load=function (option) { + _load(this, option); + return this; + }; + return ChartFont; + })(OfficeExtension.ClientObject); + Excel.ChartFont=ChartFont; + var BindingType; + (function (BindingType) { + BindingType.range="Range"; + BindingType.table="Table"; + BindingType.text="Text"; + })(BindingType=Excel.BindingType || (Excel.BindingType={})); + var BorderIndex; + (function (BorderIndex) { + BorderIndex.edgeTop="EdgeTop"; + BorderIndex.edgeBottom="EdgeBottom"; + BorderIndex.edgeLeft="EdgeLeft"; + BorderIndex.edgeRight="EdgeRight"; + BorderIndex.insideVertical="InsideVertical"; + BorderIndex.insideHorizontal="InsideHorizontal"; + BorderIndex.diagonalDown="DiagonalDown"; + BorderIndex.diagonalUp="DiagonalUp"; + })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={})); + var BorderLineStyle; + (function (BorderLineStyle) { + BorderLineStyle.none="None"; + BorderLineStyle.continuous="Continuous"; + BorderLineStyle.dash="Dash"; + BorderLineStyle.dashDot="DashDot"; + BorderLineStyle.dashDotDot="DashDotDot"; + BorderLineStyle.dot="Dot"; + BorderLineStyle.double="Double"; + BorderLineStyle.slantDashDot="SlantDashDot"; + })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={})); + var BorderWeight; + (function (BorderWeight) { + BorderWeight.hairline="Hairline"; + BorderWeight.thin="Thin"; + BorderWeight.medium="Medium"; + BorderWeight.thick="Thick"; + })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={})); + var CalculationMode; + (function (CalculationMode) { + CalculationMode.automatic="Automatic"; + CalculationMode.automaticExceptTables="AutomaticExceptTables"; + CalculationMode.manual="Manual"; + })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={})); + var CalculationType; + (function (CalculationType) { + CalculationType.recalculate="Recalculate"; + CalculationType.full="Full"; + CalculationType.fullRebuild="FullRebuild"; + })(CalculationType=Excel.CalculationType || (Excel.CalculationType={})); + var ClearApplyTo; + (function (ClearApplyTo) { + ClearApplyTo.all="All"; + ClearApplyTo.formats="Formats"; + ClearApplyTo.contents="Contents"; + })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={})); + var ChartDataLabelPosition; + (function (ChartDataLabelPosition) { + ChartDataLabelPosition.invalid="Invalid"; + ChartDataLabelPosition.none="None"; + ChartDataLabelPosition.center="Center"; + ChartDataLabelPosition.insideEnd="InsideEnd"; + ChartDataLabelPosition.insideBase="InsideBase"; + ChartDataLabelPosition.outsideEnd="OutsideEnd"; + ChartDataLabelPosition.left="Left"; + ChartDataLabelPosition.right="Right"; + ChartDataLabelPosition.top="Top"; + ChartDataLabelPosition.bottom="Bottom"; + ChartDataLabelPosition.bestFit="BestFit"; + ChartDataLabelPosition.callout="Callout"; + })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={})); + var ChartLegendPosition; + (function (ChartLegendPosition) { + ChartLegendPosition.invalid="Invalid"; + ChartLegendPosition.top="Top"; + ChartLegendPosition.bottom="Bottom"; + ChartLegendPosition.left="Left"; + ChartLegendPosition.right="Right"; + ChartLegendPosition.corner="Corner"; + ChartLegendPosition.custom="Custom"; + })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={})); + var ChartSeriesBy; + (function (ChartSeriesBy) { + ChartSeriesBy.auto="Auto"; + ChartSeriesBy.columns="Columns"; + ChartSeriesBy.rows="Rows"; + })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={})); + var ChartType; + (function (ChartType) { + ChartType.invalid="Invalid"; + ChartType.columnClustered="ColumnClustered"; + ChartType.columnStacked="ColumnStacked"; + ChartType.columnStacked100="ColumnStacked100"; + ChartType._3DColumnClustered="3DColumnClustered"; + ChartType._3DColumnStacked="3DColumnStacked"; + ChartType._3DColumnStacked100="3DColumnStacked100"; + ChartType.barClustered="BarClustered"; + ChartType.barStacked="BarStacked"; + ChartType.barStacked100="BarStacked100"; + ChartType._3DBarClustered="3DBarClustered"; + ChartType._3DBarStacked="3DBarStacked"; + ChartType._3DBarStacked100="3DBarStacked100"; + ChartType.lineStacked="LineStacked"; + ChartType.lineStacked100="LineStacked100"; + ChartType.lineMarkers="LineMarkers"; + ChartType.lineMarkersStacked="LineMarkersStacked"; + ChartType.lineMarkersStacked100="LineMarkersStacked100"; + ChartType.pieOfPie="PieOfPie"; + ChartType.pieExploded="PieExploded"; + ChartType._3DPieExploded="3DPieExploded"; + ChartType.barOfPie="BarOfPie"; + ChartType.xyscatterSmooth="XYScatterSmooth"; + ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers"; + ChartType.xyscatterLines="XYScatterLines"; + ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers"; + ChartType.areaStacked="AreaStacked"; + ChartType.areaStacked100="AreaStacked100"; + ChartType._3DAreaStacked="3DAreaStacked"; + ChartType._3DAreaStacked100="3DAreaStacked100"; + ChartType.doughnutExploded="DoughnutExploded"; + ChartType.radarMarkers="RadarMarkers"; + ChartType.radarFilled="RadarFilled"; + ChartType.surface="Surface"; + ChartType.surfaceWireframe="SurfaceWireframe"; + ChartType.surfaceTopView="SurfaceTopView"; + ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe"; + ChartType.bubble="Bubble"; + ChartType.bubble3DEffect="Bubble3DEffect"; + ChartType.stockHLC="StockHLC"; + ChartType.stockOHLC="StockOHLC"; + ChartType.stockVHLC="StockVHLC"; + ChartType.stockVOHLC="StockVOHLC"; + ChartType.cylinderColClustered="CylinderColClustered"; + ChartType.cylinderColStacked="CylinderColStacked"; + ChartType.cylinderColStacked100="CylinderColStacked100"; + ChartType.cylinderBarClustered="CylinderBarClustered"; + ChartType.cylinderBarStacked="CylinderBarStacked"; + ChartType.cylinderBarStacked100="CylinderBarStacked100"; + ChartType.cylinderCol="CylinderCol"; + ChartType.coneColClustered="ConeColClustered"; + ChartType.coneColStacked="ConeColStacked"; + ChartType.coneColStacked100="ConeColStacked100"; + ChartType.coneBarClustered="ConeBarClustered"; + ChartType.coneBarStacked="ConeBarStacked"; + ChartType.coneBarStacked100="ConeBarStacked100"; + ChartType.coneCol="ConeCol"; + ChartType.pyramidColClustered="PyramidColClustered"; + ChartType.pyramidColStacked="PyramidColStacked"; + ChartType.pyramidColStacked100="PyramidColStacked100"; + ChartType.pyramidBarClustered="PyramidBarClustered"; + ChartType.pyramidBarStacked="PyramidBarStacked"; + ChartType.pyramidBarStacked100="PyramidBarStacked100"; + ChartType.pyramidCol="PyramidCol"; + ChartType._3DColumn="3DColumn"; + ChartType.line="Line"; + ChartType._3DLine="3DLine"; + ChartType._3DPie="3DPie"; + ChartType.pie="Pie"; + ChartType.xyscatter="XYScatter"; + ChartType._3DArea="3DArea"; + ChartType.area="Area"; + ChartType.doughnut="Doughnut"; + ChartType.radar="Radar"; + })(ChartType=Excel.ChartType || (Excel.ChartType={})); + var ChartUnderlineStyle; + (function (ChartUnderlineStyle) { + ChartUnderlineStyle.none="None"; + ChartUnderlineStyle.single="Single"; + })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={})); + var DeleteShiftDirection; + (function (DeleteShiftDirection) { + DeleteShiftDirection.up="Up"; + DeleteShiftDirection.left="Left"; + })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={})); + var HorizontalAlignment; + (function (HorizontalAlignment) { + HorizontalAlignment.general="General"; + HorizontalAlignment.left="Left"; + HorizontalAlignment.center="Center"; + HorizontalAlignment.right="Right"; + HorizontalAlignment.fill="Fill"; + HorizontalAlignment.justify="Justify"; + HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection"; + HorizontalAlignment.distributed="Distributed"; + })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={})); + var InsertShiftDirection; + (function (InsertShiftDirection) { + InsertShiftDirection.down="Down"; + InsertShiftDirection.right="Right"; + })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={})); + var NamedItemType; + (function (NamedItemType) { + NamedItemType.string="String"; + NamedItemType.integer="Integer"; + NamedItemType.double="Double"; + NamedItemType.boolean="Boolean"; + NamedItemType.range="Range"; + })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={})); + var RangeUnderlineStyle; + (function (RangeUnderlineStyle) { + RangeUnderlineStyle.none="None"; + RangeUnderlineStyle.single="Single"; + RangeUnderlineStyle.double="Double"; + RangeUnderlineStyle.singleAccountant="SingleAccountant"; + RangeUnderlineStyle.doubleAccountant="DoubleAccountant"; + })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={})); + var SheetVisibility; + (function (SheetVisibility) { + SheetVisibility.visible="Visible"; + SheetVisibility.hidden="Hidden"; + SheetVisibility.veryHidden="VeryHidden"; + })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={})); + var RangeValueType; + (function (RangeValueType) { + RangeValueType.unknown="Unknown"; + RangeValueType.empty="Empty"; + RangeValueType.string="String"; + RangeValueType.integer="Integer"; + RangeValueType.double="Double"; + RangeValueType.boolean="Boolean"; + RangeValueType.error="Error"; + })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={})); + var VerticalAlignment; + (function (VerticalAlignment) { + VerticalAlignment.top="Top"; + VerticalAlignment.center="Center"; + VerticalAlignment.bottom="Bottom"; + VerticalAlignment.justify="Justify"; + VerticalAlignment.distributed="Distributed"; + })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={})); + var ErrorCodes; + (function (ErrorCodes) { + ErrorCodes.accessDenied="AccessDenied"; + ErrorCodes.generalException="GeneralException"; + ErrorCodes.insertDeleteConflict="InsertDeleteConflict"; + ErrorCodes.invalidArgument="InvalidArgument"; + ErrorCodes.invalidBinding="InvalidBinding"; + ErrorCodes.invalidOperation="InvalidOperation"; + ErrorCodes.invalidReference="InvalidReference"; + ErrorCodes.invalidSelection="InvalidSelection"; + ErrorCodes.itemAlreadyExists="ItemAlreadyExists"; + ErrorCodes.itemNotFound="ItemNotFound"; + ErrorCodes.notImplemented="NotImplemented"; + ErrorCodes.unsupportedOperation="UnsupportedOperation"; + })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={})); +})(Excel || (Excel={})); +var Excel; +(function (Excel) { + var RequestContext=(function (_super) { + __extends(RequestContext, _super); + function RequestContext(url) { + _super.call(this, url); + this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this)); + this._rootObject=this.m_workbook; + } + Object.defineProperty(RequestContext.prototype, "workbook", { + get: function () { + return this.m_workbook; + }, + enumerable: true, + configurable: true + }); + return RequestContext; + })(OfficeExtension.ClientRequestContext); + Excel.RequestContext=RequestContext; + function run(batch) { + return OfficeExtension.ClientRequestContext._run(function () { return new Excel.RequestContext(); }, batch); + } + Excel.run=run; +})(Excel || (Excel={})); + + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-win32-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-win32-16.00.js new file mode 100644 index 000000000..7fef16134 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excel-win32-16.00.js @@ -0,0 +1,19 @@ +/* Excel specific API library */ +/* Version: 16.0.6216.3006 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/* +* @overview es6-promise - a tiny implementation of Promises/A+. +* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) +* @license Licensed under MIT license +* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE +* @version 2.3.0 +*/ + +var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},OsfMsAjaxFactory,OSF,msAjaxCDNPath,OSFRichclient,OfficeExt,OSFLog,Logger,OSFAppTelemetry,OfficeExtension,Excel;(function(n){var t=function(){function t(){}var i=null,n=!0;return t.prototype.isMsAjaxLoaded=function(){var t="function",i="undefined";return typeof Sys!==i&&typeof Type!==i&&Sys.StringBuilder&&typeof Sys.StringBuilder===t&&Type.registerNamespace&&typeof Type.registerNamespace===t&&Type.registerClass&&typeof Type.registerClass===t&&typeof Function._validateParams===t?n:!1},t.prototype.loadMsAjaxFull=function(n){var t=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(t,n)},Object.defineProperty(t.prototype,"msAjaxError",{get:function(){var n=this;return n._msAjaxError==i&&n.isMsAjaxLoaded()&&(n._msAjaxError=Error),n._msAjaxError},set:function(n){this._msAjaxError=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxSerializer",{get:function(){var n=this;return n._msAjaxSerializer==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer),n._msAjaxSerializer},set:function(n){this._msAjaxSerializer=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxString",{get:function(){var n=this;return n._msAjaxString==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=String),n._msAjaxString},set:function(n){this._msAjaxString=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxDebug",{get:function(){var n=this;return n._msAjaxDebug==i&&n.isMsAjaxLoaded()&&(n._msAjaxDebug=Sys.Debug),n._msAjaxDebug},set:function(n){this._msAjaxDebug=n},enumerable:n,configurable:n}),t}();n.MicrosoftAjaxFactory=t})(OfficeExt||(OfficeExt={}));OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory;OSF=OSF||{},function(n){var t=function(){function n(n){this._internalStorage=n}return n.prototype.getItem=function(n){try{return this._internalStorage&&this._internalStorage.getItem(n)}catch(t){return null}},n.prototype.setItem=function(n,t){try{this._internalStorage&&this._internalStorage.setItem(n,t)}catch(i){}},n.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(n){}},n.prototype.removeItem=function(n){try{this._internalStorage&&this._internalStorage.removeItem(n)}catch(t){}},n.prototype.getKeysWithPrefix=function(n){var r=[],u,t,i;try{for(u=this._internalStorage&&this._internalStorage.length||0,t=0;t1?s[s.length-1]:t,h=d(),e,o,c;return!r&&h&&(e=window.name.indexOf(i),e>-1&&(o=window.name.indexOf(";",e),o==-1&&(o=window.name.length),c=window.name.substring(e,o),f?h.setItem(c,f):f=h.getItem(c))),f},getConversationId:function(){var i=window.location.search,n=t,r;return i&&(r=i.indexOf("&"),n=r>0?i.substring(1,r):i.substr(1),n&&n.charAt(n.length-1)==="="&&(n=n.substring(0,n.length-1),n&&(n=decodeURIComponent(n)))),n},getInfoItems:function(n){var t=n.split("$");return typeof t[1]==e&&(t=n.split("|")),t},getConversationUrl:function(){var t="",r=OSF.OUtil.parseXdmInfo(i),n;return r&&(n=OSF.OUtil.getInfoItems(r),n!=undefined&&n.length>=3&&(t=n[2])),t},validateParamObject:function(t,r){var u=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:n},{name:"expectedProperties",type:Object,mayBeNull:n},{name:"callback",type:Function,mayBeNull:i}]),f;if(u)throw u;for(f in r)if(u=Function._validateParameter(t[f],r[f],f),u)throw u;},writeProfilerMark:function(n){window.msWriteProfilerMark&&(window.msWriteProfilerMark(n),OsfMsAjaxFactory.msAjaxDebug.trace(n))},outputDebug:function(n){typeof Sys!==e&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(n)},defineNondefaultProperty:function(n,t,r,u){var e,f;r=r||{};for(e in u)f=u[e],r[f]==undefined&&(r[f]=i);return Object.defineProperty(n,t,r),n},defineNondefaultProperties:function(n,t,i){t=t||{};for(var r in t)OSF.OUtil.defineNondefaultProperty(n,r,t[r],i);return n},defineEnumerableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[f])},defineEnumerableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[f])},defineMutableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[y,f,v])},defineMutableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[y,f,v])},finalizeProperties:function(t,r){var e,u;r=r||{};for(var o=Object.getOwnPropertyNames(t),s=o.length,f=0;f>8,f=e&255,i[t++]=r>>2,i[t++]=(r&3)<<4|u>>4,i[t++]=(u&15)<<2|f>>6,i[t++]=f&63,isNaN(e)||(r=e>>8,u=s&255,f=s>>8,i[t++]=r>>2,i[t++]=(r&3)<<4|u>>4,i[t++]=(u&15)<<2|f>>6,i[t++]=f&63),isNaN(e)?i[t-1]=64:isNaN(s)&&(i[t-2]=64,i[t-1]=64),h=0;h0;t++)(t==8||t==12||t==16||t==20)&&(i+="-"),i+=n[r%16],r=Math.floor(r/16);for(;t<32;t++)(t==8||t==12||t==16||t==20)&&(i+="-"),i+=n[Math.floor(Math.random()*16)];return i}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){var b=this;b._id=n;b._appName=t;b._appVersion=i;b._appUILocale=r;b._dataLocale=u;b._docUrl=f;b._clientMode=e;b._settings=o;b._reason=s;b._osfControlType=h;b._eToken=c;b._correlationId=l;b._appInstanceId=a;b._touchEnabled=v;b._commerceAllowed=y;b._appMinorVersion=p;b._requirementMatrix=w;b.get_id=function(){return this._id};b.get_appName=function(){return this._appName};b.get_appVersion=function(){return this._appVersion};b.get_appUILocale=function(){return this._appUILocale};b.get_dataLocale=function(){return this._dataLocale};b.get_docUrl=function(){return this._docUrl};b.get_clientMode=function(){return this._clientMode};b.get_bindings=function(){return this._bindings};b.get_settings=function(){return this._settings};b.get_reason=function(){return this._reason};b.get_osfControlType=function(){return this._osfControlType};b.get_eToken=function(){return this._eToken};b.get_correlationId=function(){return this._correlationId};b.get_appInstanceId=function(){return this._appInstanceId};b.get_touchEnabled=function(){return this._touchEnabled};b.get_commerceAllowed=function(){return this._commerceAllowed};b.get_appMinorVersion=function(){return this._appMinorVersion};b.get_requirementMatrix=function(){return this._requirementMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",ImageLeft:"imageLeft",ImageTop:"imageTop",ImageWidth:"imageWidth",ImageHeight:"imageHeight",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(n,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged?n+"_"+t:t};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var n={};return{getErrorArgs:function(t){return n[t]||n[this.errorCodes.ooeInternalError]},addErrorMessage:function(t,i){n[t]=i},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(t){n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:t.L_APICallFailed,message:t.L_ActivityLimitReached};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported}}}}(),function(n){(function(n){var t=1.1,r=function(){function n(n){this.isSetSupported=function(n,t){var u,i,r;return n==undefined?!1:(t==undefined&&(t=0),u=this._setMap,i=u._sets,i.hasOwnProperty(n.toLowerCase())?(r=i[n.toLowerCase()],r>0&&r>=t):!1)};this._setMap=n}return n}(),i,f,e,o,s,h,c,l,a,u,v,y,p,w,b,k,d;n.RequirementMatrix=r;i=function(){function n(n){this._sets=n}return n}();n.DefaultSetRequirement=i;f=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,excelapi:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t})}return __extends(i,n),i}(i);n.ExcelClientDefaultSetRequirement=f;e=function(n){function t(){n.call(this,{mailbox:1.3})}return __extends(t,n),t}(i);n.OutlookClientDefaultSetRequirement=e;o=function(n){function i(){n.call(this,{bindingevents:t,compressedfile:t,customxmlparts:t,documentevents:t,file:t,htmlcoercion:t,matrixbindings:t,matrixcoercion:t,ooxmlcoercion:t,pdffile:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,textfile:t,wordapi:t})}return __extends(i,n),i}(i);n.WordClientDefaultSetRequirement=o;s=function(n){function i(){n.call(this,{activeview:t,compressedfile:t,documentevents:t,file:t,pdffile:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.PowerpointClientDefaultSetRequirement=s;h=function(n){function i(){n.call(this,{selection:t,textcoercion:t})}return __extends(i,n),i}(i);n.ProjectClientDefaultSetRequirement=h;c=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,file:t})}return __extends(i,n),i}(i);n.ExcelWebDefaultSetRequirement=c;l=function(n){function i(){n.call(this,{customxmlparts:t,documentevents:t,file:t,ooxmlcoercion:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.WordWebDefaultSetRequirement=l;a=function(n){function i(){n.call(this,{activeview:t,settings:t})}return __extends(i,n),i}(i);n.PowerpointWebDefaultSetRequirement=a;u=function(n){function t(){n.call(this,{mailbox:1.3})}return __extends(t,n),t}(i);n.OutlookWebDefaultSetRequirement=u;v=function(n){function i(){n.call(this,{activeview:t,documentevents:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.SwayWebDefaultSetRequirement=v;y=function(n){function i(){n.call(this,{bindingevents:t,partialtablebindings:t,settings:t,tablebindings:t,tablecoercion:t})}return __extends(i,n),i}(i);n.AccessWebDefaultSetRequirement=y;p=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t})}return __extends(i,n),i}(i);n.ExcelIOSDefaultSetRequirement=p;w=function(n){function i(){n.call(this,{bindingevents:t,compressedfile:t,customxmlparts:t,documentevents:t,file:t,htmlcoercion:t,matrixbindings:t,matrixcoercion:t,ooxmlcoercion:t,pdffile:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,textfile:t})}return __extends(i,n),i}(i);n.WordIOSDefaultSetRequirement=w;b=function(n){function i(){n.call(this,{activeview:t,compressedfile:t,documentevents:t,file:t,pdffile:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.PowerpointIOSDefaultSetRequirement=b;k=function(n){function i(){n.call(this,{mailbox:t})}return __extends(i,n),i}(i);n.OutlookIOSDefaultSetRequirement=k;d=function(){function n(){}return n.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)},n.getDefaultRequirementMatrix=function(t){var u,s,f,e,h,o;return this.initializeDefaultSetMatrix(),u=undefined,t.get_requirementMatrix()!=undefined&&typeof JSON!="undefined"?(s=JSON.parse(t.get_requirementMatrix()),u=new r(new i(s))):(f=t.get_appMinorVersion(),e="",e=f<10?"0"+f:""+f,h=t.get_appVersion()+"."+e,o=t.get_appName()+"-"+h,u=n.DefaultSetArrayMatrix!=undefined&&n.DefaultSetArrayMatrix[o]!=undefined?new r(n.DefaultSetArrayMatrix[o]):new r(new i({}))),u},n.initializeDefaultSetMatrix=function(){n.DefaultSetArrayMatrix[n.Excel_RCLIENT_1600]=new f;n.DefaultSetArrayMatrix[n.Word_RCLIENT_1600]=new o;n.DefaultSetArrayMatrix[n.PowerPoint_RCLIENT_1600]=new s;n.DefaultSetArrayMatrix[n.Outlook_RCLIENT_1600]=new e;n.DefaultSetArrayMatrix[n.Excel_WAC_1600]=new c;n.DefaultSetArrayMatrix[n.Word_WAC_1600]=new l;n.DefaultSetArrayMatrix[n.Outlook_WAC_1600]=new u;n.DefaultSetArrayMatrix[n.Outlook_WAC_1601]=new u;n.DefaultSetArrayMatrix[n.Project_RCLIENT_1600]=new h;n.DefaultSetArrayMatrix[n.Access_WAC_1600]=new y;n.DefaultSetArrayMatrix[n.PowerPoint_WAC_1600]=new a;n.DefaultSetArrayMatrix[n.Excel_IOS_1600]=new p;n.DefaultSetArrayMatrix[n.SWAY_WAC_1600]=new v;n.DefaultSetArrayMatrix[n.Word_IOS_1600]=new w;n.DefaultSetArrayMatrix[n.PowerPoint_IOS_1600]=new b;n.DefaultSetArrayMatrix[n.Outlook_IOS_1600]=new k},n.Excel_RCLIENT_1600="1-16.00",n.Word_RCLIENT_1600="2-16.00",n.PowerPoint_RCLIENT_1600="4-16.00",n.Outlook_RCLIENT_1600="8-16.00",n.Excel_WAC_1600="16-16.00",n.Word_WAC_1600="32-16.00",n.Outlook_WAC_1600="64-16.00",n.Outlook_WAC_1601="64-16.01",n.Project_RCLIENT_1600="128-16.00",n.Access_WAC_1600="256-16.00",n.PowerPoint_WAC_1600="512-16.00",n.Excel_IOS_1600="1024-16.01",n.SWAY_WAC_1600="2048-16.00",n.Word_IOS_1600="4096-16.00",n.PowerPoint_IOS_1600="8192-16.00",n.Outlook_IOS_1600="65536-16.00",n.DefaultSetArrayMatrix={},n}();n.RequirementsMatrixFactory=d})(n.Requirement||(n.Requirement={}));var t=n.Requirement}(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var t,n=!1;return{enableShortcut:function(){n||(window.Office?t=window.Office:OSF.OUtil.setNamespace("Office",window),window.Office=Microsoft.Office.WebExtension,n=!0)},disableShortcut:function(){n&&(t?window.Office=t:OSF.OUtil.unsetNamespace("Office",window),n=!1)}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(n){n?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(n,t){var i,r,o,u,f,e;if(n&&typeof n=="string"&&(r=n.indexOf("#"),r!=-1)){o=n.substring(0,r);u=n.substring(r+1);switch(o){case"binding":case"bindings":u&&(i=new OSF.DDA.BindingPromise(u))}}if(i)return i.onFail=t,i;else if(t)if(f=typeof t,f=="function")e={},e[Microsoft.Office.WebExtension.Parameters.Callback]=t,OSF.DDA.issueAsyncResult(e,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,f);};OSF.DDA.Context=function(n,t,i,r,u){var f=this,e,o;OSF.OUtil.defineEnumerableProperties(f,{contentLanguage:{value:n.get_dataLocale()},displayLanguage:{value:n.get_appUILocale()},touchEnabled:{value:n.get_touchEnabled()},commerceAllowed:{value:n.get_commerceAllowed()}});t&&OSF.OUtil.defineEnumerableProperty(f,"document",{value:t});i&&OSF.OUtil.defineEnumerableProperty(f,"license",{value:i});r&&(e=r.displayName||"appOM",delete r.displayName,OSF.OUtil.defineEnumerableProperty(f,e,{value:r}));u&&OSF.OUtil.defineEnumerableProperty(f,"officeTheme",{get:function(){return u()}});o=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(n);OSF.OUtil.defineEnumerableProperty(f,"requirements",{value:o})};OSF.DDA.OutlookContext=function(n,t,i,r,u){OSF.DDA.OutlookContext.uber.constructor.call(this,n,null,i,r,u);t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(n,t){var i;switch(n.get_clientMode()){case OSF.ClientMode.ReadOnly:i=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:i=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t});OSF.OUtil.defineMutableProperties(this,{mode:{value:i},url:{value:n.get_docUrl()}})};OSF.DDA.JsomDocument=function(n,t,i){var r=this,u;OSF.DDA.JsomDocument.uber.constructor.call(r,n,i);t&&OSF.OUtil.defineEnumerableProperty(r,"bindings",{get:function(){return t}});u=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(r,[u.GetSelectedDataAsync,u.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(r,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var n;return OSF&&OSF._OfficeAppFactory&&(n=OSF._OfficeAppFactory.getContext()),n}});OSF.DDA.License=function(n){OSF.OUtil.defineEnumerableProperty(this,"value",{value:n})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(n){var t,i;for(t in n)i={},OSF.OUtil.defineEnumerableProperties(i,{id:{value:t},displayName:{value:n[t]}}),OSF.DDA.AsyncMethodNames[t]=i};OSF.DDA.AsyncMethodCall=function(n,t,i,r,u,f,e){function c(n,t){var u,i,r;for(u in n){if(i=n[u],r=t[u],i["enum"])switch(typeof r){case"string":if(OSF.OUtil.listContainsValue(i["enum"],r))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw s();}if(i.types&&!OSF.OUtil.listContainsValue(i.types,typeof r))throw s();}}function l(t,i,r){var f,u,h,e,l,a;if(t.lengtho+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(a=n.length-1;a>=o;a--){v=n[a];switch(typeof v){case"object":if(f)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else f=v;break;case h:if(l)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else l=v;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);}}f=f||{};for(y in t)OSF.OUtil.listContainsKey(f,y)||(e=undefined,s=t[y],s.calculate&&i&&(e=s.calculate(i,r,u)),e||s.defaultValue===undefined||(e=s.defaultValue),f[y]=e);if(l)if(f[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else f[Microsoft.Office.WebExtension.Parameters.Callback]=l;return c(t,f),f}var h="function",o=n.length,s=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,e)});this.verifyAndExtractCall=function(n,t,r){var e=l(n,t,r),c=a(n,e,t,r),u={},o,s,h;for(o in e)u[o]=e[o];for(s in c)u[s]=c[s];for(h in i)u[h]=i[h](t,r);return f&&(u=f(u,t,r)),u};this.processResponse=function(n,t,i,f){return n==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?r?r(t,i,f):t:u?u(n,t):OSF.DDA.ErrorCodeManager.getErrorArgs(n)};this.getCallArgs=function(n){for(var t,u,r,i=n.length-1;i>=o;i--){r=n[i];switch(typeof r){case"object":t=r;break;case h:u=r}}return t=t||{},u&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=u),t}};OSF.DDA.AsyncMethodCallFactory=function(){function n(n){var i=null,r,t;if(n)for(i={},r=n.length,t=0;t0&&t.push(u)}}catch(s){}return t}var i=[],t={};t[Microsoft.Office.WebExtension.Parameters.Data]=function(){var t=0,i=1;return{toHost:function(n){if(typeof n!="string"&&n[OSF.DDA.TableDataProperties.TableRows]!==undefined){var r=[];r[t]=n[OSF.DDA.TableDataProperties.TableRows];r[i]=n[OSF.DDA.TableDataProperties.TableHeaders];n=r}return n},fromHost:function(r){var f,e,u;return r.toArray?(e=r.dimensions(),e===2?f=n(r):(u=r.toArray(),u.length===2&&(u[0]!=null&&u[0].toArray||u[1]!=null&&u[1].toArray)?(f={},f[OSF.DDA.TableDataProperties.TableRows]=n(u[t]),f[OSF.DDA.TableDataProperties.TableHeaders]=n(u[i])):f=u)):f=r,f}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,i,t);this.unpack=function(n,i){var r,u;return this.isComplexType(n)||OSF.DDA.ListType.isListType(n)?(u=(i||typeof i=="unknown")&&i.toArray,r=u?i.toArray():i||{}):r=this.isDynamicType(n)?t[n].fromHost(i):i,r}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(n){function t(n){var i=n,f,r,u;if(OSF.OUtil.isArray(n))for(f=i.length,r=0;r2)for(u=[],o=1;o40)&&(n=OSF.OUtil.Guid.generateNewGuid(),t.setValue(t.clientIDKey,n)),n},n.prototype.saveLog=function(n,t){var i=this,r=i.getValue(i.logIdSetKey);r=(r&&r.length>0?r+";":"")+n;i.setValue(i.logIdSetKey,r);i.setValue(n,t)},n.prototype.enumerateLog=function(n,t){var i=this,e=i.getValue(i.logIdSetKey),u,o,r,f;if(e){u=e.split(";");for(o in u)r=u[o],f=i.getValue(r),f&&(n&&n(r,f),t&&i.remove(r));t&&i.remove(i.logIdSetKey)}},n.prototype.getValue=function(n){var t=OSF.OUtil.getLocalStorage(),i="";return t&&(i=t.getItem(n)),i},n.prototype.setValue=function(n,t){var i=OSF.OUtil.getLocalStorage();i&&i.setItem(n,t)},n.prototype.remove=function(n){var t=OSF.OUtil.getLocalStorage();if(t)try{t.removeItem(n)}catch(i){}},n}(),f=function(){function n(){}return n.prototype.LogData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n.SerializeRow(),OSF.Logger.SendFlag.none)},n.prototype.LogRawData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n,OSF.Logger.SendFlag.none)},n}();n.initialize=c;n.onAppActivated=l;n.onScriptDone=a;n.onCallDone=v;n.onMethodDone=y;n.onPropertyDone=p;n.onEventDone=w;n.onRegisterDone=b;n.onAppClosed=k;n.setOsfControlAppCorrelationId=d;n.doAppInitializationLogging=s;n.logAppCommonMessage=g;n.logAppException=nt;OSF.AppTelemetry=n}(OSFAppTelemetry||(OSFAppTelemetry={}));Microsoft.Office.WebExtension.TableData=function(n,t){function i(n){if(n==null||n==undefined)return null;try{for(var t=OSF.DDA.DataCoercion.findArrayDimensionality(n,2);t<2;t++)n=[n];return n}catch(i){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{get:function(){return t},set:function(n){t=i(n)}},rows:{get:function(){return n},set:function(t){n=t==null||OSF.OUtil.isArray(t)&&t.length==0?[]:i(t)}}});this.headers=t;this.rows=n};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureTableData=function(n){return new Microsoft.Office.WebExtension.TableData(n[OSF.DDA.TableDataProperties.TableRows],n[OSF.DDA.TableDataProperties.TableHeaders])};Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"};OSF.DDA.DataCoercion=function(){var n=null;return{findArrayDimensionality:function(n){if(OSF.OUtil.isArray(n)){for(var t=0,i=0;i6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix&&(i=new Date(parseInt(t.slice(5,-1))),i)?i:t}):Sys.Serialization.JavaScriptSerializer.deserialize(t,!0);r[i]=t}catch(u){}}return r}};OSF.DDA.Settings=function(n){var t="name",i;n=n||{};i=function(n){var i=OSF.OUtil.getSessionStorage(),t,r;i&&(t=OSF.DDA.SettingsManager.serializeSettings(n),r=JSON?JSON.stringify(t):Sys.Serialization.JavaScriptSerializer.serialize(t),i.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),r))};OSF.OUtil.defineEnumerableProperties(this,{get:{value:function(i){var u=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1}]),r;if(u)throw u;return r=n[i],typeof r=="undefined"?null:r}},set:{value:function(r,u){var f=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1},{name:"value",mayBeNull:!0}]);if(f)throw f;n[r]=u;i(n)}},remove:{value:function(r){var u=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1}]);if(u)throw u;delete n[r];i(n)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],n)};OSF.DDA.RefreshableSettings=function(n){OSF.DDA.RefreshableSettings.uber.constructor.call(this,n);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],n);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(n){var t,i;this._eventHandlers={};for(t in n)i=n[t],this._eventHandlers[i]=[]};OSF.EventDispatch.prototype={getSupportedEvents:function(){var n=[];for(var t in this._eventHandlers)n.push(t);return n},supportsEvent:function(n){var t=!1;for(var i in this._eventHandlers)if(n==i){t=!0;break}return t},hasEventHandler:function(n,t){var i=this._eventHandlers[n],r;if(i&&i.length>0)for(r in i)if(i[r]===t)return!0;return!1},addEventHandler:function(n,t){if(typeof t!="function")return!1;var i=this._eventHandlers[n];return i&&!this.hasEventHandler(n,t)?(i.push(t),!0):!1},removeEventHandler:function(n,t){var i=this._eventHandlers[n],r;if(i&&i.length>0)for(r=0;r0?(this._eventHandlers[n]=[],!0):!1},getEventHandlerCount:function(n){return this._eventHandlers[n]!=undefined?this._eventHandlers[n].length:-1},fireEvent:function(n){var t,i,r;if(n.type==undefined)return!1;if(t=n.type,t&&this._eventHandlers[t]){i=this._eventHandlers[t];for(r in i)i[r](n);return!0}else return!1}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(n,t,i){var u=this,r;switch(n){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:r=new OSF.DDA.DocumentSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:r=new OSF.DDA.BindingSelectionChangedEventArgs(u.manufactureBinding(i,t.document),i[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:r=new OSF.DDA.BindingDataChangedEventArgs(u.manufactureBinding(i,t.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:r=new OSF.DDA.SettingsChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:r=new OSF.DDA.ActiveViewChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:r=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:r=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:r=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(i);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:r=new OSF.DDA.NodeInsertedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:r=new OSF.DDA.NodeReplacedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:r=new OSF.DDA.NodeDeletedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:r=new OSF.DDA.TaskSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:r=new OSF.DDA.ResourceSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:r=new OSF.DDA.ViewSelectionChangedEventArgs(t);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,n));}return r};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:n}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n){var t=n[OSF.DDA.SettingsManager.SerializedSettings];return OSF.DDA.SettingsManager.deserializeSettings(t)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:!0}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(n,t){return OSF.DDA.SettingsManager.serializeSettings(t)}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SettingsManager.SerializedSettings},{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType};OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.BindingPromise=function(n,t){this._id=n;OSF.OUtil.defineEnumerableProperty(this,"onFail",{get:function(){return t},set:function(n){var i=typeof n;if(i!="undefined"&&i!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,i);t=n}})};OSF.DDA.BindingPromise.prototype={_fetch:function(n){var t=this,i;return t.binding?n&&n(t.binding):t._binding||(i=t,Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(t._id,function(t){t.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded?(OSF.OUtil.defineEnumerableProperty(i,"binding",{value:t.value}),n&&n(i.binding)):i.onFail&&i.onFail(t)})),t},getDataAsync:function(){var n=arguments;return this._fetch(function(t){t.getDataAsync.apply(t,n)}),this},setDataAsync:function(){var n=arguments;return this._fetch(function(t){t.setDataAsync.apply(t,n)}),this},addHandlerAsync:function(){var n=arguments;return this._fetch(function(t){t.addHandlerAsync.apply(t,n)}),this},removeHandlerAsync:function(){var n=arguments;return this._fetch(function(t){t.removeHandlerAsync.apply(t,n)}),this}};OSF.DDA.BindingFacade=function(n){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:n});var t=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[t.AddFromSelectionAsync,t.AddFromNamedItemAsync,t.GetAllAsync,t.GetByIdAsync,t.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(n,t){OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:n}})};OSF.DDA.Binding=function(n,t){var r,u,i,f;OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:n}});r=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[r.GetDataAsync,r.SetDataAsync]);u=Microsoft.Office.WebExtension.EventType;i=t.bindings._eventDispatches;i[n]||(i[n]=new OSF.EventDispatch([u.BindingSelectionChanged,u.BindingDataChanged]));f=i[n];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.generateBindingId=function(){return"UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureBinding=function(n,t){var r=n[OSF.DDA.BindingProperties.Id],u=n[OSF.DDA.BindingProperties.RowCount],f=n[OSF.DDA.BindingProperties.ColumnCount],s=n[OSF.DDA.BindingProperties.HasHeaders],i,e,o;switch(n[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:i=new OSF.DDA.TextBinding(r,t);break;case Microsoft.Office.WebExtension.BindingType.Matrix:i=new OSF.DDA.MatrixBinding(r,t,u,f);break;case Microsoft.Office.WebExtension.BindingType.Table:e=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument};o=e()&&OSF.DDA.ExcelTableBinding?OSF.DDA.ExcelTableBinding:OSF.DDA.TableBinding;i=new o(r,t,u,f,s);break;default:i=new OSF.DDA.UnknownBinding(r,t)}return i};OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"}),function(){function u(n){return OSF.DDA.OMFactory.manufactureBinding(n,Microsoft.Office.WebExtension.context.document)}function f(n){return n.id}function e(n,t,i){var u=n[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&u&&(u[OSF.DDA.TableDataProperties.TableRows]!=undefined||u[OSF.DDA.TableDataProperties.TableHeaders]!=undefined)&&(u=OSF.DDA.OMFactory.manufactureTableData(u)),u=OSF.DDA.DataCoercion.coerceData(u,i[Microsoft.Office.WebExtension.Parameters.CoercionType]),u==undefined?r:u}var t="number",i="object",n="string",r=null;OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[n],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}}],privateStateCallbacks:[],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[n]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[n],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return!0}}],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n){return OSF.OUtil.mapList(n[OSF.DDA.ListDescriptors.BindingList],u)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[n]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[n]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n,t,i){var r=i[Microsoft.Office.WebExtension.Parameters.Id];delete t._eventDispatches[r]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n,t){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[i,n],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[t],defaultValue:0}}],checkCallArgs:function(n,t){if(n[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&n[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&n[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&n[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0&&(delete n[Microsoft.Office.WebExtension.Parameters.StartRow],delete n[Microsoft.Office.WebExtension.Parameters.StartColumn],delete n[Microsoft.Office.WebExtension.Parameters.RowCount],delete n[Microsoft.Office.WebExtension.Parameters.ColumnCount]),n[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[Microsoft.Office.WebExtension.Parameters.StartRow]||n[Microsoft.Office.WebExtension.Parameters.StartColumn]||n[Microsoft.Office.WebExtension.Parameters.RowCount]||n[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[n,i,t,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[i,n],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}}],checkCallArgs:function(n,t){if(n[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&n[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&(delete n[Microsoft.Office.WebExtension.Parameters.StartRow],delete n[Microsoft.Office.WebExtension.Parameters.StartColumn]),n[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[Microsoft.Office.WebExtension.Parameters.StartRow]||n[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}]})}();OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.MatrixBinding=function(n,t,i,r){OSF.DDA.MatrixBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:i?i:0},columnCount:{value:r?r:0}})};OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:0},{name:OSF.DDA.BindingProperties.Type,value:1},{name:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,value:2}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:0},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:1},{name:Microsoft.Office.WebExtension.BindingType.Table,value:2}],invertible:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:0},{name:Microsoft.Office.WebExtension.Parameters.Id,value:1},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:2},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:2},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:3},{name:OSF.DDA.PropertyDescriptors.Subset,value:4}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.Data,value:2},{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,fromHost:[{name:OSF.DDA.BindingProperties.RowCount,value:0},{name:OSF.DDA.BindingProperties.ColumnCount,value:1},{name:OSF.DDA.BindingProperties.HasHeaders,value:2}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,toHost:[{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:0},{name:OSF.DDA.SafeArray.UniqueArguments.Run,value:1}],canonical:!0,isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Offset,toHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:0},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:1}],canonical:!0,isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Run,toHost:[{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:0},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:1}],canonical:!0,isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{TableDataProperties:"TableDataProperties"});OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.DDA.TableBinding=function(n,t,i,r,u){OSF.DDA.TableBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:i?i:0},columnCount:{value:r?r:0},hasHeaders:{value:u?u:!1}});var f=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[f.AddRowsAsync,f.AddColumnsAsync,f.DeleteAllDataValuesAsync])};OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddRowsAsync:"addRowsAsync",AddColumnsAsync:"addColumnsAsync",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync"}),function(){function n(n){return n.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]})}();OSF.DDA.TextBinding=function(n,t){OSF.DDA.TextBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})};OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddFromPromptAsync:"addFromPromptAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromPromptAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:{types:["string"],calculate:function(){return Strings.OfficeOM.L_AddBindingFromPromptDefaultText}}},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:function(n){return OSF.DDA.OMFactory.manufactureBinding(n,Microsoft.Office.WebExtension.context.document)}});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:1},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:2}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"});OSF.DDA.DocumentSelectionChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:n}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{BindingSelectionChangedEvent:"BindingSelectionChangedEvent"});OSF.DDA.BindingSelectionChangedEventArgs=function(n,t){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:n}});for(var i in t)OSF.OUtil.defineEnumerableProperty(this,i,{value:t[i]})};OSF.DDA.BindingDataChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:n}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0},{name:OSF.DDA.PropertyDescriptors.Subset,value:1}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType,{OnlyVisible:"onlyVisible"});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.OnlyVisible,value:1}]});Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"};Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"};Microsoft.Office.WebExtension.Index={First:"first",Last:"last",Next:"next",Previous:"previous"};OSF.DDA.AsyncMethodNames.addNames({GoToByIdAsync:"goToByIdAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GoToByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string","number"]},{name:Microsoft.Office.WebExtension.Parameters.GoToType,"enum":Microsoft.Office.WebExtension.GoToType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:{"enum":Microsoft.Office.WebExtension.SelectionMode,defaultValue:Microsoft.Office.WebExtension.SelectionMode.Default}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:0},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:1},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:2},{name:Microsoft.Office.WebExtension.GoToType.Index,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:0},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:1},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:1},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:2}]});OSF.DDA.AsyncMethodNames.addNames({ExecuteRichApiRequestAsync:"executeRichApiRequestAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[]});OSF.OUtil.setNamespace("RichApi",OSF.DDA);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:0}],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"});Microsoft.Office.WebExtension.FileProperties=function(n){OSF.OUtil.defineEnumerableProperties(this,{url:{value:n[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(n){return new Microsoft.Office.WebExtension.FileProperties(n)}});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:OSF.DDA.FilePropertiesDescriptor.Url,value:0}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.ExcelTableBinding=function(n,t,i,r,u){var f=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[f.ClearFormatsAsync,f.SetTableOptionsAsync,f.SetFormatsAsync]);OSF.DDA.ExcelTableBinding.uber.constructor.call(this,n,t,i,r,u);OSF.OUtil.finalizeProperties(this)};OSF.OUtil.extend(OSF.DDA.ExcelTableBinding,OSF.DDA.TableBinding),function(){var t="number",n="object",i="string";OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[i,n,t,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:[n],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:[n],defaultValue:[]}}],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[i,n,t,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[n,i],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[n],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:[n],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:[n],defaultValue:[]}}],checkCallArgs:function(n,t){var i=Microsoft.Office.WebExtension.Parameters;if(n[i.StartRow]==0&&n[i.StartColumn]==0&&OSF.OUtil.isArray(n[i.CellFormat])&&n[i.CellFormat].length===0&&OSF.OUtil.isArray(n[i.TableOptions])&&n[i.TableOptions].length===0&&(delete n[i.StartRow],delete n[i.StartColumn],delete n[i.CellFormat],delete n[i.TableOptions]),n[i.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[i.StartRow]&&n[i.StartRow]!=0||n[i.StartColumn]&&n[i.StartColumn]!=0||n[i.CellFormat]||n[i.TableOptions]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:function(n){return n.id}}]});OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function(){var n=arguments;return this._fetch(function(t){t.setTableOptionsAsync.apply(t,n)}),this};OSF.DDA.BindingPromise.prototype.setFormatsAsync=function(){var n=arguments;return this._fetch(function(t){t.setFormatsAsync.apply(t,n)}),this};OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function(){var n=arguments;return this._fetch(function(t){t.clearFormatsAsync.apply(t,n)}),this}}(),function(){function n(n){return n.id}OSF.DDA.AsyncMethodNames.addNames({ClearFormatsAsync:"clearFormatsAsync",SetTableOptionsAsync:"setTableOptionsAsync",SetFormatsAsync:"setFormatsAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ClearFormatsAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TableOptions,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetFormatsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CellFormat,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]})}();Microsoft.Office.WebExtension.Table={All:0,Data:1,Headers:2},function(){var u="undefined",e="auto fit",o="distributed",f="none";OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearFormatsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetFormatsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:2},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.Data,value:2},{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:3},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:4},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:5}]});var s={headerRow:0,bandedRows:1,firstColumn:2,lastColumn:3,bandedColumns:4,filterButton:5,style:6,totalRow:7},h={row:0,column:1},t={alignHorizontal:{text:"alignHorizontal",type:1},alignVertical:{text:"alignVertical",type:2},backgroundColor:{text:"backgroundColor",type:101},borderStyle:{text:"borderStyle",type:201},borderColor:{text:"borderColor",type:202},borderTopStyle:{text:"borderTopStyle",type:203},borderTopColor:{text:"borderTopColor",type:204},borderBottomStyle:{text:"borderBottomStyle",type:205},borderBottomColor:{text:"borderBottomColor",type:206},borderLeftStyle:{text:"borderLeftStyle",type:207},borderLeftColor:{text:"borderLeftColor",type:208},borderRightStyle:{text:"borderRightStyle",type:209},borderRightColor:{text:"borderRightColor",type:210},borderOutlineStyle:{text:"borderOutlineStyle",type:211},borderOutlineColor:{text:"borderOutlineColor",type:212},borderInlineStyle:{text:"borderInlineStyle",type:213},borderInlineColor:{text:"borderInlineColor",type:214},fontFamily:{text:"fontFamily",type:301},fontStyle:{text:"fontStyle",type:302},fontSize:{text:"fontSize",type:303},fontUnderlineStyle:{text:"fontUnderlineStyle",type:304},fontColor:{text:"fontColor",type:305},fontDirection:{text:"fontDirection",type:306},fontStrikethrough:{text:"fontStrikethrough",type:307},fontSuperscript:{text:"fontSuperscript",type:308},fontSubscript:{text:"fontSubscript",type:309},fontNormal:{text:"fontNormal",type:310},indentLeft:{text:"indentLeft",type:401},indentRight:{text:"indentRight",type:402},numberFormat:{text:"numberFormat",type:501},width:{text:"width",type:701},height:{text:"height",type:702},wrapping:{text:"wrapping",type:703}},r=[{name:f,value:0},{name:"thin",value:1},{name:"medium",value:2},{name:"dashed",value:3},{name:"dotted",value:4},{name:"thick",value:5},{name:"double",value:6},{name:"hair",value:7},{name:"medium dashed",value:8},{name:"dash dot",value:9},{name:"medium dash dot",value:10},{name:"dash dot dot",value:11},{name:"medium dash dot dot",value:12},{name:"slant dash dot",value:13}],i=[{name:f,value:0},{name:"black",value:1},{name:"blue",value:2},{name:"gray",value:3},{name:"green",value:4},{name:"orange",value:5},{name:"pink",value:6},{name:"purple",value:7},{name:"red",value:8},{name:"teal",value:9},{name:"turquoise",value:10},{name:"violet",value:11},{name:"white",value:12},{name:"yellow",value:13},{name:"automatic",value:14}],n=OSF.DDA.SafeArray.Delegate.ParameterMap;n.define({type:t.alignHorizontal.text,toHost:[{name:"general",value:0},{name:"left",value:1},{name:"center",value:2},{name:"right",value:3},{name:"fill",value:4},{name:"justify",value:5},{name:"center across selection",value:6},{name:o,value:7}]});n.define({type:t.alignVertical.text,toHost:[{name:"top",value:0},{name:"center",value:1},{name:"bottom",value:2},{name:"justify",value:3},{name:o,value:4}]});n.define({type:t.backgroundColor.text,toHost:i});n.define({type:t.borderStyle.text,toHost:r});n.define({type:t.borderColor.text,toHost:i});n.define({type:t.borderTopStyle.text,toHost:r});n.define({type:t.borderTopColor.text,toHost:i});n.define({type:t.borderBottomStyle.text,toHost:r});n.define({type:t.borderBottomColor.text,toHost:i});n.define({type:t.borderLeftStyle.text,toHost:r});n.define({type:t.borderLeftColor.text,toHost:i});n.define({type:t.borderRightStyle.text,toHost:r});n.define({type:t.borderRightColor.text,toHost:i});n.define({type:t.borderOutlineStyle.text,toHost:r});n.define({type:t.borderOutlineColor.text,toHost:i});n.define({type:t.borderInlineStyle.text,toHost:r});n.define({type:t.borderInlineColor.text,toHost:i});n.define({type:t.fontStyle.text,toHost:[{name:"regular",value:0},{name:"italic",value:1},{name:"bold",value:2},{name:"bold italic",value:3}]});n.define({type:t.fontUnderlineStyle.text,toHost:[{name:f,value:0},{name:"single",value:1},{name:"double",value:2},{name:"single accounting",value:3},{name:"double accounting",value:4}]});n.define({type:t.fontColor.text,toHost:i});n.define({type:t.fontDirection.text,toHost:[{name:"context",value:0},{name:"left-to-right",value:1},{name:"right-to-left",value:2}]});n.define({type:t.width.text,toHost:[{name:e,value:-1}]});n.define({type:t.height.text,toHost:[{name:e,value:-1}]});n.define({type:Microsoft.Office.WebExtension.Parameters.TableOptions,toHost:[{name:"headerRow",value:0},{name:"bandedRows",value:1},{name:"firstColumn",value:2},{name:"lastColumn",value:3},{name:"bandedColumns",value:4},{name:"filterButton",value:5},{name:"style",value:6},{name:"totalRow",value:7}]});n.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={toHost:function(t){for(var i in t)t[i].format&&(t[i].format=n.doMapValues(t[i].format,"toHost"));return t},fromHost:function(n){return n}};n.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat,{toHost:function(n){var c="cells",y="format",w=0,b=1,p=[],l,i,r,f,e,o,a,v,s;for(l in n){if(i=n[l],r=[],typeof i[c]!==u){if(f=i[c],typeof i[c]=="object"){e=[];for(o in f)typeof h[o]!==u&&(e[h[o]]=f[o])}else e=f;r[w]=e}if(i[y]){a=i[y];v=[];for(s in a)typeof t[s]!==u&&v.push([t[s].type,a[s]]);r[b]=v}p[l]=r}return p},fromHost:function(n){return n}});n.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions,{toHost:function(n){var i=[];for(var t in n)typeof s[t]!==u&&(i[s[t]]=n[t]);return i},fromHost:function(n){return n}})}();OSF.DDA.ExcelDocument=function(n,t){var i=this,r=new OSF.DDA.BindingFacade(i);OSF.DDA.DispIdHost.addAsyncMethods(r,[OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);OSF.DDA.DispIdHost.addAsyncMethods(i,[OSF.DDA.AsyncMethodNames.GoToByIdAsync]);OSF.DDA.DispIdHost.addAsyncMethods(i,[OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);OSF.DDA.ExcelDocument.uber.constructor.call(i,n,r,t);OSF.OUtil.finalizeProperties(i)};OSF.OUtil.extend(OSF.DDA.ExcelDocument,OSF.DDA.JsomDocument);OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(n,t){OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);n.doc=new OSF.DDA.ExcelDocument(n,this._initializeSettings(!1));OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi,[OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);t()},function(n){var t=function(){function n(n,t){this.m_actionInfo=n;this.m_isWriteOperation=t}return Object.defineProperty(n.prototype,"actionInfo",{get:function(){return this.m_actionInfo},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isWriteOperation",{get:function(){return this.m_isWriteOperation},enumerable:!0,configurable:!0}),n}();n.Action=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(){}return t.createSetPropertyAction=function(t,i,r,u){var f;n.Utility.validateObjectPath(i);var e={Id:t._nextId(),ActionType:4,Name:r,ObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[u],o=n.Utility.setMethodArguments(t,e.ArgumentInfo,s);return n.Utility.validateReferencedObjectPaths(o),f=new n.Action(e,!0),t._pendingRequest.addAction(f),t._pendingRequest.addReferencedObjectPath(i._objectPath),t._pendingRequest.addReferencedObjectPaths(o),f},t.createMethodAction=function(t,i,r,u,f){var e,o,h,s;return n.Utility.validateObjectPath(i),e={Id:t._nextId(),ActionType:3,Name:r,ObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}},o=n.Utility.setMethodArguments(t,e.ArgumentInfo,f),n.Utility.validateReferencedObjectPaths(o),h=u!=1,s=new n.Action(e,h),t._pendingRequest.addAction(s),t._pendingRequest.addReferencedObjectPath(i._objectPath),t._pendingRequest.addReferencedObjectPaths(o),s},t.createQueryAction=function(t,i,r){var u,f;return n.Utility.validateObjectPath(i),u={Id:t._nextId(),ActionType:2,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id},u.QueryInfo=r,f=new n.Action(u,!1),t._pendingRequest.addAction(f),t._pendingRequest.addReferencedObjectPath(i._objectPath),f},t.createInstantiateAction=function(t,i){n.Utility.validateObjectPath(i);var u={Id:t._nextId(),ActionType:1,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id},r=new n.Action(u,!1);return t._pendingRequest.addAction(r),t._pendingRequest.addReferencedObjectPath(i._objectPath),t._pendingRequest.addActionResultHandler(r,new n.InstantiateActionResultHandler(i)),r},t.createTraceAction=function(t,i){var r={Id:t._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},u=new n.Action(r,!1);return t._pendingRequest.addAction(u),t._pendingRequest.addTrace(r.Id,i),u},t}();n.ActionFactory=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(t,i){n.Utility.checkArgumentNull(t,"context");this.m_context=t;this.m_objectPath=i;this.m_objectPath&&(t._processingResult||(n.ActionFactory.createInstantiateAction(t,this),t._autoCleanup&&this._KeepReference&&t.trackedObjects._autoAdd(this)))}return Object.defineProperty(t.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_objectPath",{get:function(){return this.m_objectPath},set:function(n){this.m_objectPath=n},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(n){},t}();n.ClientObject=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(n){this.m_context=n;this.m_actions=[];this.m_actionResultHandler={};this.m_referencedObjectPaths={};this.m_flags=0;this.m_traceInfos={}}return Object.defineProperty(t.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"traceInfos",{get:function(){return this.m_traceInfos},enumerable:!0,configurable:!0}),t.prototype.addAction=function(n){n.isWriteOperation&&(this.m_flags=this.m_flags|1);this.m_actions.push(n)},Object.defineProperty(t.prototype,"hasActions",{get:function(){return this.m_actions.length>0},enumerable:!0,configurable:!0}),t.prototype.addTrace=function(n,t){this.m_traceInfos[n]=t},t.prototype.addReferencedObjectPath=function(t){if(!this.m_referencedObjectPaths[t.objectPathInfo.Id])for(t.isValid||n.Utility.throwError(n.ResourceStrings.invalidObjectPath,n.Utility.getObjectPathExpression(t));t;)t.isWriteOperation&&(this.m_flags=this.m_flags|1),this.m_referencedObjectPaths[t.objectPathInfo.Id]=t,t.objectPathInfo.ObjectPathType==3&&this.addReferencedObjectPaths(t.argumentObjectPaths),t=t.parentObjectPath},t.prototype.addReferencedObjectPaths=function(n){if(n)for(var t=0;t0&&(f=i.substr(0,u),e=i.substr(u+1),f=n.Utility.trim(f),e=n.Utility.trim(e),this.m_responseHeaders[f.toUpperCase()]=e))},t.UNSENT=0,t.OPENED=1,t.DONE=4,t.settings=new i,t}();n.OfficeXHR=t}(OfficeExtension||(OfficeExtension={})),function(n){function i(){n.Promise||t.Init()}n._EnsurePromise=i;var t;(function(t){function i(){(function(){"use strict";function wt(n){return typeof n=="function"||typeof n=="object"&&n!==null}function b(n){return typeof n=="function"}function bt(n){return typeof n=="object"&&n!==null}function kt(n){k=n}function dt(n){f=n}function ti(){var t=process.nextTick,n=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(n)&&n[1]==="0"&&n[2]==="10"&&(t=setImmediate),function(){t(c)}}function ii(){return function(){tt(c)}}function ri(){var n=0,i=new ut(c),t=document.createTextNode("");return i.observe(t,{characterData:!0}),function(){t.data=n=++n%2}}function ui(){var n=new MessageChannel;return n.port1.onmessage=c,function(){n.port2.postMessage(0)}}function ft(){return function(){setTimeout(c,1)}}function c(){for(var t,i,n=0;n0?".":"")+i;break;case 3:i=t.normalizeName(n.objectPathInfo.Name)+"()"+(i.length>0?".":"")+i;break;case 4:i=t.normalizeName(n.objectPathInfo.Name)+(i.length>0?".":"")+i;break;case 5:i="getItem()"+(i.length>0?".":"")+i;break;case 6:i="_reference()"+(i.length>0?".":"")+i;break}n=n.parentObjectPath}return i},t._createPromiseFromResult=function(t){return n._EnsurePromise(),new n.Promise(function(n,i){n(t)})},t._addActionResultHandler=function(n,t,i){n.context._pendingRequest.addActionResultHandler(t,i)},t._handleNavigationPropertyResults=function(n,i,r){for(var u=0;u=WebkitScriptMessaging.MESSAGE_TIME_DELTA)) { + invokePostMessage(); + this.lastMessageTimestamp=currentTimestamp; + } else { + this.lastMessageTimestamp+=WebkitScriptMessaging.MESSAGE_TIME_DELTA; + setTimeout(function () { + invokePostMessage(); + }, this.lastMessageTimestamp - currentTimestamp); + } + return correlationId; + }; + WebkitScriptMessaging.prototype.generateCorrelationId=function () { +++this.callingIndex; + return this.conversationId+this.callingIndex; + }; + WebkitScriptMessaging.getCurrentTimeMS=function () { + return (new Date).getTime(); + }; + WebkitScriptMessaging.MESSAGE_TIME_DELTA=10; + return WebkitScriptMessaging; + })(); + ScriptMessaging.WebkitScriptMessaging=WebkitScriptMessaging; + })(OSFWebkit.ScriptMessaging || (OSFWebkit.ScriptMessaging={})); + var ScriptMessaging=OSFWebkit.ScriptMessaging; +})(OSFWebkit || (OSFWebkit={})); +OSF.ScriptMessaging=OSFWebkit.ScriptMessaging; +var OSFWebkit; +(function (OSFWebkit) { + OSFWebkit.MessageHandlerName="Agave"; + (function (AppContextProperties) { + AppContextProperties[AppContextProperties["Settings"]=0]="Settings"; + AppContextProperties[AppContextProperties["SolutionReferenceId"]=1]="SolutionReferenceId"; + AppContextProperties[AppContextProperties["AppType"]=2]="AppType"; + AppContextProperties[AppContextProperties["MajorVersion"]=3]="MajorVersion"; + AppContextProperties[AppContextProperties["MinorVersion"]=4]="MinorVersion"; + AppContextProperties[AppContextProperties["RevisionVersion"]=5]="RevisionVersion"; + AppContextProperties[AppContextProperties["APIVersionSequence"]=6]="APIVersionSequence"; + AppContextProperties[AppContextProperties["AppCapabilities"]=7]="AppCapabilities"; + AppContextProperties[AppContextProperties["APPUILocale"]=8]="APPUILocale"; + AppContextProperties[AppContextProperties["AppDataLocale"]=9]="AppDataLocale"; + AppContextProperties[AppContextProperties["BindingCount"]=10]="BindingCount"; + AppContextProperties[AppContextProperties["DocumentUrl"]=11]="DocumentUrl"; + AppContextProperties[AppContextProperties["ActivationMode"]=12]="ActivationMode"; + AppContextProperties[AppContextProperties["ControlIntegrationLevel"]=13]="ControlIntegrationLevel"; + AppContextProperties[AppContextProperties["SolutionToken"]=14]="SolutionToken"; + AppContextProperties[AppContextProperties["APISetVersion"]=15]="APISetVersion"; + AppContextProperties[AppContextProperties["CorrelationId"]=16]="CorrelationId"; + AppContextProperties[AppContextProperties["InstanceId"]=17]="InstanceId"; + })(OSFWebkit.AppContextProperties || (OSFWebkit.AppContextProperties={})); + var AppContextProperties=OSFWebkit.AppContextProperties; + (function (MethodId) { + MethodId[MethodId["Execute"]=1]="Execute"; + MethodId[MethodId["RegisterEvent"]=2]="RegisterEvent"; + MethodId[MethodId["UnregisterEvent"]=3]="UnregisterEvent"; + MethodId[MethodId["WriteSettings"]=4]="WriteSettings"; + MethodId[MethodId["GetContext"]=5]="GetContext"; + })(OSFWebkit.MethodId || (OSFWebkit.MethodId={})); + var MethodId=OSFWebkit.MethodId; + var WebkitHostController=(function () { + function WebkitHostController(hostScriptProxy) { + this.hostScriptProxy=hostScriptProxy; + } + WebkitHostController.prototype.execute=function (id, params, callback) { + var args=params; + if (args==null) { + args=[]; + } + var hostParams={ + id: id, + apiArgs: args + }; + var agaveResponseCallback=function (payload) { + var safeArraySource=payload; + if (OSF.OUtil.isArray(payload) && payload.length >=2) { + var hrStatus=payload[0]; + safeArraySource=payload[1]; + } + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.Execute, hostParams, agaveResponseCallback); + }; + WebkitHostController.prototype.registerEvent=function (id, targetId, handler, callback) { + var agaveEventHandlerCallback=function (payload) { + var safeArraySource=payload; + var eventId=0; + if (OSF.OUtil.isArray(payload) && payload.length >=2) { + safeArraySource=payload[0]; + eventId=payload[1]; + } + if (handler) { + handler(eventId, new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + var agaveResponseCallback=function (payload) { + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(payload)); + } + }; + this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.RegisterEvent, id, targetId, agaveEventHandlerCallback, agaveResponseCallback); + }; + WebkitHostController.prototype.unregisterEvent=function (id, targetId, callback) { + var agaveResponseCallback=function (response) { + callback(new OSFWebkit.WebkitSafeArray(response)); + }; + this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.UnregisterEvent, id, targetId, agaveResponseCallback); + }; + return WebkitHostController; + })(); + OSFWebkit.WebkitHostController=WebkitHostController; +})(OSFWebkit || (OSFWebkit={})); +OSF.Webkit=OSFWebkit; +OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger()); +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +} +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed" +}; +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], + privateState + ); +} +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() { + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id]=dispatch; + } + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], + partId + ); +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], + handle + ); +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.RichClientSettingsManager=(function OSF_DDA$RichClientSettingsManager() { + return { + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onComplete) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper(); + var onReceivedContext=function onReceivedContext(appContext) { + if (onComplete) { + onComplete(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, appContext.get_settings()); + } + }; + OSF._OfficeAppFactory.getWebkitAppContext(null, onReceivedContext); + }, + write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onComplete) { + var hostParams={}; + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + hostParams["keys"]=keys; + hostParams["values"]=values; + if (onCalling) { + onCalling(); + } + var onWriteCompleted=function onWriteCompleted(status) { + if (onComplete) { + onComplete(status[0], null); + } + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.WriteSettings, hostParams, onWriteCompleted); + } + }; +})(); +OSF._OfficeAppFactory.getWebkitAppContext=function OSF__OfficeAppFactory$getWebkitAppContext(wnd, gotAppContext) { + var getInvocationCallback=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(appContext) { + var returnedContext; + var appContextProperties=OSF.Webkit.AppContextProperties; + var appType=appContext[appContextProperties.AppType]; + var appTypeSupported=false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry]==appType) { + appTypeSupported=true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type "+appType; + } + var hostSettings=appContext[appContextProperties.Settings]; + var serializedSettings={}; + var keys=hostSettings[0]; + var values=hostSettings[1]; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + var id=appContext[appContextProperties.SolutionReferenceId]; + var version=appContext[appContextProperties.MajorVersion]; + var clientMode=appContext[appContextProperties.AppCapabilities]; + var UILocale=appContext[appContextProperties.APPUILocale]; + var dataLocale=appContext[appContextProperties.AppDataLocale]; + var docUrl=appContext[appContextProperties.DocumentUrl]; + var reason=appContext[appContextProperties.ActivationMode]; + var osfControlType=appContext[appContextProperties.ControlIntegrationLevel]; + var eToken=appContext[appContextProperties.SolutionToken]; + eToken=eToken ? eToken.toString() : ""; + var correlationId=appContext[appContextProperties.CorrelationId]; + returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, serializedSettings, reason, osfControlType, eToken, correlationId); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.GetContext, [], getInvocationCallback); +} +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + var onComplete=function onComplete(status, response) { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + try { + hostDelegateMethod(args.hostCallArgs, args.onCalling, onComplete); + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name: Strings.OfficeOM.L_InternalError, message: ex }; + onComplete(status, response); + } + }; + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving); + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.write( + hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], + hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], + onCalling, + onReceiving + ); + } + switch (actionId) { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break; + } + return delegateMethods; +} +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if (rows==1 && cols==1) { + ret=[vbArr]; + } else { + ret=[]; + for (var row=0; row < rows; row++) { + var rowArr=[]; + for (var col=0; col < cols; col++) { + var datum=vbArr[row * cols+col]; + if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + OSF.ClientHostController.execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +delete Microsoft.Office.WebExtension.FileType; +OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) { + var bf=new OSF.DDA.BindingFacade(this); + OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]); + OSF.DDA.ExcelDocument.uber.constructor.call(this, + officeAppContext, + bf, + settings + ); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excelios-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excelios-15.js new file mode 100644 index 000000000..9b239adf4 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/excelios-15.js @@ -0,0 +1,11 @@ +/* Excel iOS specific API library */ +/* Version: 15.0.4420.1017 Build Time: 05/04/2015 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType,{OnlyVisible:"onlyVisible"});var OSF=OSF||{},OSFWebkit;(function(b){var a=function(){var a=false;function b(a){this.data=a;this.safeArrayFlag=this.isSafeArray(a)}b.prototype.dimensions=function(){var a=0;if(this.safeArrayFlag)a=this.data[0][0];else if(this.isArray())a=2;return a};b.prototype.getItem=function(){var b=[],a=null;if(this.safeArrayFlag)b=this.toArray();else b=this.data;a=b;for(var c=0;c=a.MESSAGE_TIME_DELTA){f();b.lastMessageTimestamp=d}else{b.lastMessageTimestamp+=a.MESSAGE_TIME_DELTA;setTimeout(function(){f()},b.lastMessageTimestamp-d)}return e};a.prototype.generateCorrelationId=function(){++this.callingIndex;return this.conversationId+this.callingIndex};a.getCurrentTimeMS=function(){return (new Date).getTime()};a.MESSAGE_TIME_DELTA=10;return a}();b.WebkitScriptMessaging=c})(a.ScriptMessaging||(a.ScriptMessaging={}));var b=a.ScriptMessaging})(OSFWebkit||(OSFWebkit={}));OSF.ScriptMessaging=OSFWebkit.ScriptMessaging;var OSFWebkit;(function(a){a.MessageHandlerName="Agave";(function(a){var j="InstanceId",i="CorrelationId",h="APISetVersion",g="SolutionToken",f="ControlIntegrationLevel",e="ActivationMode",d="DocumentUrl",c="BindingCount",b="AppDataLocale",r="APPUILocale",q="AppCapabilities",p="APIVersionSequence",o="RevisionVersion",n="MinorVersion",m="MajorVersion",l="SolutionReferenceId",k="Settings";a[a[k]=0]=k;a[a[l]=1]=l;a[a["AppType"]=2]="AppType";a[a[m]=3]=m;a[a[n]=4]=n;a[a[o]=5]=o;a[a[p]=6]=p;a[a[q]=7]=q;a[a[r]=8]=r;a[a[b]=9]=b;a[a[c]=10]=c;a[a[d]=11]=d;a[a[e]=12]=e;a[a[f]=13]=f;a[a[g]=14]=g;a[a[h]=15]=h;a[a[i]=16]=i;a[a[j]=17]=j})(a.AppContextProperties||(a.AppContextProperties={}));var c=a.AppContextProperties;(function(a){var e="GetContext",d="WriteSettings",c="UnregisterEvent",b="RegisterEvent";a[a["Execute"]=1]="Execute";a[a[b]=2]=b;a[a[c]=3]=c;a[a[d]=4]=d;a[a[e]=5]=e})(a.MethodId||(a.MethodId={}));var d=a.MethodId,b=function(){function b(a){this.hostScriptProxy=a}b.prototype.execute=function(g,f,c){var b=f;if(b==null)b=[];var e={id:g,apiArgs:b},d=function(b){var d=b;if(OSF.OUtil.isArray(b)&&b.length>=2){var e=b[0];d=b[1]}c&&c(new a.WebkitSafeArray(d))};this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.Execute,e,d)};b.prototype.registerEvent=function(g,f,c,b){var d=function(b){var d=b,e=0;if(OSF.OUtil.isArray(b)&&b.length>=2){d=b[0];e=b[1]}c&&c(e,new a.WebkitSafeArray(d))},e=function(c){b&&b(new a.WebkitSafeArray(c))};this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.RegisterEvent,g,f,d,e)};b.prototype.unregisterEvent=function(e,d,c){var b=function(b){c(new a.WebkitSafeArray(b))};this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.UnregisterEvent,e,d,b)};return b}();a.WebkitHostController=b})(OSFWebkit||(OSFWebkit={}));OSF.Webkit=OSFWebkit;OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger());OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.File=function(e,c,b){OSF.OUtil.defineEnumerableProperties(this,{size:{value:c},sliceCount:{value:Math.ceil(c/b)}});var a={};a[OSF.DDA.FileProperties.Handle]=e;a[OSF.DDA.FileProperties.SliceSize]=b;var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDocumentCopyChunkAsync,d.ReleaseDocumentCopyAsync],a)};OSF.DDA.FileSliceOffset="fileSliceoffset";OSF.DDA.CustomXmlParts=function(){this._eventDispatches=[];var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartAsync,a.GetDataPartByIdAsync,a.GetDataPartsByNameSpaceAsync])};OSF.DDA.CustomXmlPart=function(f,b,g){OSF.OUtil.defineEnumerableProperties(this,{builtIn:{value:g},id:{value:b},namespaceManager:{value:new OSF.DDA.CustomXmlPrefixMappings(b)}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[c.DeleteDataPartAsync,c.GetPartNodesAsync,c.GetPartXmlAsync]);var e=f._eventDispatches,a=e[b];if(!a){var d=Microsoft.Office.WebExtension.EventType;a=new OSF.EventDispatch([d.DataNodeDeleted,d.DataNodeInserted,d.DataNodeReplaced]);e[b]=a}OSF.DDA.DispIdHost.addEventSupport(this,a)};OSF.DDA.CustomXmlPrefixMappings=function(b){var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartNamespaceAsync,a.GetDataPartNamespaceAsync,a.GetDataPartPrefixAsync],b)};OSF.DDA.CustomXmlNode=function(d,c,e,b){OSF.OUtil.defineEnumerableProperties(this,{baseName:{value:b},namespaceUri:{value:e},nodeType:{value:c}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.GetRelativeNodesAsync,a.GetNodeValueAsync,a.GetNodeXmlAsync,a.SetNodeValueAsync,a.SetNodeXmlAsync],d)};OSF.DDA.NodeInsertedEventArgs=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeInserted},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeReplacedEventArgs=function(c,b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeReplaced},oldNode:{value:c},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeDeletedEventArgs=function(c,a,b){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeDeleted},oldNode:{value:c},oldNextSibling:{value:a},inUndoRedo:{value:b}})};OSF.DDA.RichClientSettingsManager=function(){return {read:function(b,a){var f=[],e=[];b&&b();var d=OSF._OfficeAppFactory.getInitializationHelper(),c=function(b){a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,b.get_settings())};OSF._OfficeAppFactory.getWebkitAppContext(null,c)},write:function(b,i,d,c){var a={},f=[],e=[];for(var g in b){f.push(g);e.push(b[g])}a["keys"]=f;a["values"]=e;d&&d();var h=function(a){c&&c(a[0],null)};OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.WriteSettings,a,h)}}}();OSF._OfficeAppFactory.getWebkitAppContext=function(c,b){var a=function(c){var f,a=OSF.Webkit.AppContextProperties,g=c[a.AppType],i=false;for(var p in OSF.AppName)if(OSF.AppName[p]==g){i=true;break}if(!i)throw"Unsupported client type "+g;for(var j=c[a.Settings],h={},k=j[0],u=j[1],e=0;e0&&b.push(c)}}}catch(i){}return b}var c=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,a=1;return {toHost:function(b){if(typeof b!="string"&&b[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=b[OSF.DDA.TableDataProperties.TableRows];d[a]=b[OSF.DDA.TableDataProperties.TableHeaders];b=d}return b},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=b(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=b(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=b(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,a);this.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};this.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var e=true,f=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=f.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 1 ? fragmentParts[fragmentParts.length - 1] : null; + if (window.sessionStorage) { + var sessionKeyStart=window.name.indexOf(_xdmSessionKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd==-1) { + sessionKeyEnd=window.name.length; + } + var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + window.sessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue=window.sessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString=window.location.search; + var conversationId=null; + if (searchString) { + var index=searchString.indexOf("&"); + conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if(conversationId && conversationId.charAt(conversationId.length-1)==='='){ + conversationId=conversationId.substring(0, conversationId.length-1); + if(conversationId) { + conversationId=decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e=Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) throw e; + for (var p in expectedProperties) { + e=Function._validateParameter(params[p], expectedProperties[p], p); + if (e) throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor=descriptor || {}; + for (var nd in attributes) { + var attribute=attributes[nd]; + if (descriptor[attribute]==undefined) { + descriptor[attribute]=true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors=descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor=descriptor || {}; + var props=Object.getOwnPropertyNames(obj); + var propsLength=props.length; + for (var i=0; i < propsLength; i++) { + var prop=props[i]; + var desc=Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable=descriptor.writable || false; + } + desc.configurable=descriptor.configurable || false; + desc.enumerable=descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret=[]; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key==item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value==list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add=list.push ? function (key, value) { list.push(value); } : function (key, value) { list[key]=value; }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2]=newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj)==="[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj)==="[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj)==="[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.attachEvent) { + element.attachEvent("on"+eventName, listener); + } else if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else { + element["on"+eventName]=listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.detachEvent) { + element.detachEvent("on"+eventName, listener); + } else if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else { + element["on"+eventName]=null; + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + var codex="ABCDEFGHIJKLMNOP"+ "QRSTUVWXYZabcdef"+ "ghijklmnopqrstuv"+ "wxyz0123456789+/"+ "="; + var output=[]; + var temp=[]; + var index=0; + var a, b, c; + var length=input.length; + do { + a=input[index++]; + b=input[index++]; + c=input[index++]; + temp[0]=a >> 2; + temp[1]=((a & 3) << 4) | (b >> 4); + temp[2]=((b & 15) << 2) | (c >> 6); + temp[3]=c & 63; + if (isNaN(b)) { + temp[2]=temp[3]=64; + } else if (isNaN(c)) { + temp[3]=64; + } + for (var t=0; t < 4; t++) { + output.push(codex.charAt(temp[t])); + } + } while (index < length); + return output.join(""); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + var osfLocalStorage=null; + if (!_localStorageNotWorking) { + try { + if (window.localStorage) { + osfLocalStorage=window.localStorage; + } + } + catch (ex) { + _localStorageNotWorking=true; + } + } + return osfLocalStorage; + }, + splitStringToList: function OSF_Outil$splitStringToList(input, spliter) { + var backslash=false; + var index=-1; + var res=[]; + var insideStr=false; + var s=spliter+input; + for (var i=0; i < s.length; i++) { + if (s[i]=="\\" && !backslash) { + backslash=true; + } else { + if (s[i]==spliter && !insideStr) { + res.push(""); + index++; + } else if (s[i]=="\"" && !backslash) { + insideStr=!insideStr; + } else { + res[index]+=s[i]; + } + backslash=false; + } + } + return res; + }, + convertIntToHex: function OSF_Outil$convertIntToHex(val) { + var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6); + return hex; + } + }; +})(); +OSF.OUtil.Guid=(function() { + var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result=""; + var tick=(new Date()).getTime(); + var index=0; + for (; index < 32 && tick > 0; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[tick % 16]; + tick=Math.floor(tick / 16); + } + for (; index < 32; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + } +})(); +window.OSF=OSF; +OSF.OUtil.setNamespace("OSF", window); +OSF.InternalPerfMarker={ + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker={ + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; +OSF.AgaveHostAction={ + "Select" : 0, + "UnSelect": 1 +}; +OSF.SharedConstants={ + "NotificationConversationIdSuffix": '_ntf' +}; +OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id=id; + this._appName=appName; + this._appVersion=appVersion; + this._appUILocale=appUILocale; + this._dataLocale=dataLocale; + this._docUrl=docUrl; + this._clientMode=clientMode; + this._settings=settings; + this._reason=reason; + this._osfControlType=osfControlType; + this._eToken=eToken; + this._correlationId=correlationId; + this._appMinorVersion=appMinorVersion; + this._requirementMatrix=requirementMatrix; + this.get_id=function get_id() { return this._id; }; + this.get_appName=function get_appName() { return this._appName; }; + this.get_appVersion=function get_appVersion() { return this._appVersion; }; + this.get_appUILocale=function get_appUILocale() { return this._appUILocale; }; + this.get_dataLocale=function get_dataLocale() { return this._dataLocale; }; + this.get_docUrl=function get_docUrl() { return this._docUrl; }; + this.get_clientMode=function get_clientMode() { return this._clientMode; }; + this.get_bindings=function get_bindings() { return this._bindings; }; + this.get_settings=function get_settings() { return this._settings; }; + this.get_reason=function get_reason() { return this._reason; }; + this.get_osfControlType=function get_osfControlType() { return this._osfControlType; }; + this.get_eToken=function get_eToken() { return this._eToken; }; + this.get_correlationId=function get_correlationId() { return this._correlationId; }; + this.get_appMinorVersion=function get_appMinorVersion() { return this._appMinorVersion; }; + this.get_requirementMatrix=function get_requirementMatrix() { return this._requirementMatrix; }; +}; +OSF.AppName={ + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128 +}; +OSF.OsfControlType={ + DocumentLevel: 0, + ContainerLevel: 1 +}; +OSF.ClientMode={ + ReadOnly: 0, + ReadWrite: 1 +}; +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); +OSF.OUtil.setNamespace("Internal", Microsoft.Office); +OSF.NamespaceManager=(function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut=false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice=window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office=Microsoft.Office.WebExtension; + _useShortcut=true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office=_userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut=false; + } + } + }; +})(); +OSF.NamespaceManager.enableShortcut(); +Microsoft.Office.WebExtension.InitializationReason={ + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; +Microsoft.Office.WebExtension.ActiveView={ + Read: "read", + Edit: "edit" +}; +Microsoft.Office.WebExtension.ApplicationMode={ + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; +Microsoft.Office.WebExtension.DocumentMode={ + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; +Microsoft.Office.WebExtension.CoercionType={ + Text: "text", + Matrix: "matrix", + Table: "table" +}; +Microsoft.Office.WebExtension.ValueFormat={ + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType={ + All: "all" +}; +Microsoft.Office.WebExtension.BindingType={ + Text: "text", + Matrix: "matrix", + Table: "table" +}; +Microsoft.Office.WebExtension.GoToType={ + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; +Microsoft.Office.WebExtension.SelectionMode={ + Default: "default", + Selected: "selected", + None: "none" +}; +Microsoft.Office.WebExtension.EventType={ + DocumentSelectionChanged: "documentSelectionChanged", + BindingSelectionChanged: "bindingSelectionChanged", + BindingDataChanged: "bindingDataChanged" +}; +Microsoft.Office.Internal.EventType={ + OfficeThemeChanged: "officeThemeChanged", + DocumentThemeChanged: "documentThemeChanged" +}; +Microsoft.Office.WebExtension.AsyncResultStatus={ + Succeeded: "succeeded", + Failed: "failed" +}; +Microsoft.Office.WebExtension.Parameters={ + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Id: "id", + GoToType: "goToType", + SelectionMode: "selectionMode", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions" +}; +Microsoft.Office.Internal.Parameters={ + DocumentTheme: "documentTheme", + OfficeTheme: "officeTheme" +}; +Microsoft.Office.WebExtension.DefaultParameterValues={ +}; +OSF.OUtil.setNamespace("DDA", OSF); +OSF.DDA.DocumentMode={ + ReadOnly: 1, + ReadWrite: 0 +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods={ + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates={ + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties={ + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +OSF.DDA.AsyncResultEnum.ErrorProperties={ + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.PropertyDescriptors={ + AsyncResultStatus: "AsyncResultStatus", + FileProperties: "FileProperties", + FilePropertiesDescriptor: "FilePropertiesDescriptor", + FileSliceProperties: "FileSliceProperties", + Subset: "subset", + BindingProperties: "BindingProperties", + TableDataProperties: "TableDataProperties", + DataPartProperties: "DataPartProperties", + DataNodeProperties: "DataNodeProperties" +}; +OSF.DDA.EventDescriptors={ + BindingSelectionChangedEvent: "BindingSelectionChangedEvent", + DataNodeInsertedEvent: "DataNodeInsertedEvent", + DataNodeReplacedEvent: "DataNodeReplacedEvent", + DataNodeDeletedEvent: "DataNodeDeletedEvent", + OfficeThemeChangedEvent: "OfficeThemeChangedEvent", + DocumentThemeChangedEvent: "DocumentThemeChangedEvent", + ActiveViewChangedEvent: "ActiveViewChangedEvent" +}; +OSF.DDA.ListDescriptors={ + BindingList: "BindingList", + DataPartList: "DataPartList", + DataNodeList: "DataNodeList" +}; +OSF.DDA.FileProperties={ + Handle: "FileHandle", + FileSize: "FileSize", + SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize +}; +OSF.DDA.FilePropertiesDescriptor={ + Url: "Url" +}; +OSF.DDA.BindingProperties={ + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType, + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}; +OSF.DDA.TableDataProperties={ + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; +OSF.DDA.DataPartProperties={ + Id: Microsoft.Office.WebExtension.Parameters.Id, + BuiltIn: "DataPartBuiltIn" +}; +OSF.DDA.DataNodeProperties={ + Handle: "DataNodeHandle", + BaseName: "DataNodeBaseName", + NamespaceUri: "DataNodeNamespaceUri", + NodeType: "DataNodeType" +}; +OSF.DDA.DataNodeEventProperties={ + OldNode: "OldNode", + NewNode: "NewNode", + NextSiblingNode: "NextSiblingNode", + InUndoRedo: "InUndoRedo" +}; +OSF.DDA.AsyncResultEnum.ErrorCode={ + Success: 0, + Failed: 1 +}; +OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId+"_"+eventType; + } else { + return eventType; + } +}; +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix=(function () { + function RequirementMatrix(_setMap) { + this.isSetSupported=function _isSetSupported(name, minVersion) { + if (name==undefined) { + return false; + } + if (minVersion==undefined) { + minVersion=0; + } + var setSupportArray=this._setMap; + var sets=setSupportArray._sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion=sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >=minVersion; + } else { + return false; + } + }; + this._setMap=_setMap; + } + return RequirementMatrix; + })(); + Requirement.RequirementMatrix=RequirementMatrix; + var DefaultSetRequirement=(function () { + function DefaultSetRequirement(setMap) { + this._sets=setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement=DefaultSetRequirement; + var ExcelClientDefaultSetRequirement=(function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement=(function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement; + var OutlookClientV1DefaultSetRequirement=(function (_super) { + __extends(OutlookClientV1DefaultSetRequirement, _super); + function OutlookClientV1DefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.2 + }); + } + return OutlookClientV1DefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientV1DefaultSetRequirement=OutlookClientV1DefaultSetRequirement; + var OutlookClientV2DefaultSetRequirement=(function (_super) { + __extends(OutlookClientV2DefaultSetRequirement, _super); + function OutlookClientV2DefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientV2DefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientV2DefaultSetRequirement=OutlookClientV2DefaultSetRequirement; + var OutlookClientV3DefaultSetRequirement=(function (_super) { + __extends(OutlookClientV3DefaultSetRequirement, _super); + function OutlookClientV3DefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.4 + }); + } + return OutlookClientV3DefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientV3DefaultSetRequirement=OutlookClientV3DefaultSetRequirement; + var WordClientDefaultSetRequirement=(function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement; + var WordClientV1DefaultSetRequirement=(function (_super) { + __extends(WordClientV1DefaultSetRequirement, _super); + function WordClientV1DefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordClientV1DefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientV1DefaultSetRequirement=WordClientV1DefaultSetRequirement; + var PowerpointClientDefaultSetRequirement=(function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement; + var PowerpointClientV1DefaultSetRequirement=(function (_super) { + __extends(PowerpointClientV1DefaultSetRequirement, _super); + function PowerpointClientV1DefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientV1DefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientV1DefaultSetRequirement=PowerpointClientV1DefaultSetRequirement; + var ProjectClientDefaultSetRequirement=(function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement=(function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement; + var ExcelWebV2DefaultSetRequirement=(function (_super) { + __extends(ExcelWebV2DefaultSetRequirement, _super); + function ExcelWebV2DefaultSetRequirement() { + _super.call(this, { + "activeview":1.1, + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebV2DefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebV2DefaultSetRequirement=ExcelWebV2DefaultSetRequirement; + var OutlookWebDefaultSetRequirement=(function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement; + var OutlookWebV1DefaultSetRequirement=(function (_super) { + __extends(OutlookWebV1DefaultSetRequirement, _super); + function OutlookWebV1DefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebV1DefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebV1DefaultSetRequirement=OutlookWebV1DefaultSetRequirement; + var RequirementsMatrixFactory=(function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda=function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix=undefined; + if (appContext.get_requirementMatrix() !=undefined && typeof (JSON) !=="undefined") { + var matrixItem=JSON.parse(appContext.get_requirementMatrix()); + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appFullVersion=appContext.get_appVersion(); + var appLocator=appContext.get_appName()+"-"+appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) { + defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix=function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1500]=new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1501]=new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1500]=new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1501]=new WordClientV1DefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1500]=new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1500]=new PowerpointClientV1DefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1500]=new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1501]=new OutlookClientV1DefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1502]=new OutlookClientV2DefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1503]=new OutlookClientV3DefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1500]=new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1501]=new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1502]=new ExcelWebV2DefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1500]=new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1501]=new OutlookWebV1DefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1500]=new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1500]=new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1500]=new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1500]=new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1500]=new PowerpointClientDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1500="1-15.00"; + RequirementsMatrixFactory.Excel_RCLIENT_1501="1-15.01"; + RequirementsMatrixFactory.Word_RCLIENT_1500="2-15.00"; + RequirementsMatrixFactory.Word_RCLIENT_1501="2-15.01"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1500="4-15.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1501="4-15.01"; + RequirementsMatrixFactory.Outlook_RCLIENT_1500="8-15.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1501="8-15.01"; + RequirementsMatrixFactory.Outlook_RCLIENT_1502="8-15.02"; + RequirementsMatrixFactory.Outlook_RCLIENT_1503="8-15.03"; + RequirementsMatrixFactory.Excel_WAC_1500="16-15.00"; + RequirementsMatrixFactory.Excel_WAC_1501="16-15.01"; + RequirementsMatrixFactory.Excel_WAC_1502="16-15.02"; + RequirementsMatrixFactory.Outlook_WAC_1500="64-15.00"; + RequirementsMatrixFactory.Outlook_WAC_1501="64-15.01"; + RequirementsMatrixFactory.Project_RCLIENT_1500="128-15.00"; + RequirementsMatrixFactory.Project_RCLIENT_1500="128-15.01"; + RequirementsMatrixFactory.Excel_IOS_1500="1024-15.00"; + RequirementsMatrixFactory.Word_IOS_1500="4096-15.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1500="8192-15.00"; + RequirementsMatrixFactory.DefaultSetArrayMatrix={}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement={})); + var Requirement=OfficeExt.Requirement; +})(OfficeExt || (OfficeExt={})); +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); +OSF.DDA.ErrorCodeManager=(function () { + var _errorMappings={}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode]=errorNameMessage; + }, + errorCodes : { + ooeSuccess : 0, + ooeCoercionTypeNotSupported : 1000, + ooeGetSelectionNotMatchDataType : 1001, + ooeCoercionTypeNotMatchBinding : 1002, + ooeInvalidGetRowColumnCounts : 1003, + ooeSelectionNotSupportCoercionType : 1004, + ooeInvalidGetStartRowColumn : 1005, + ooeNonUniformPartialGetNotSupported : 1006, + ooeGetDataIsTooLarge : 1008, + ooeFileTypeNotSupported : 1009, + ooeUnsupportedDataObject : 2000, + ooeCannotWriteToSelection : 2001, + ooeDataNotMatchSelection : 2002, + ooeOverwriteWorksheetData : 2003, + ooeDataNotMatchBindingSize : 2004, + ooeInvalidSetStartRowColumn : 2005, + ooeInvalidDataFormat : 2006, + ooeDataNotMatchCoercionType : 2007, + ooeDataNotMatchBindingType : 2008, + ooeSetDataIsTooLarge : 2009, + ooeNonUniformPartialSetNotSupported : 2010, + ooeSelectionCannotBound : 3000, + ooeBindingNotExist : 3002, + ooeBindingToMultipleSelection : 3003, + ooeInvalidSelectionForBindingType : 3004, + ooeOperationNotSupportedOnThisBindingType : 3005, + ooeNamedItemNotFound : 3006, + ooeMultipleNamedItemFound : 3007, + ooeInvalidNamedItemForBindingType : 3008, + ooeUnknownBindingType : 3009, + ooeOperationNotSupportedOnMatrixData : 3010, + ooeSettingNameNotExist : 4000, + ooeSettingsCannotSave : 4001, + ooeSettingsAreStale : 4002, + ooeOperationNotSupported : 5000, + ooeInternalError : 5001, + ooeDocumentReadOnly : 5002, + ooeEventHandlerNotExist : 5003, + ooeInvalidApiCallInContext : 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeCustomXmlNodeNotFound : 6000, + ooeCustomXmlError : 6100, + ooeNoCapability : 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation , message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + } + } +})(); +OSF.DDA.MethodDispId={ + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod:86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod:89, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117 +}; +OSF.DDA.EventDispId={ + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58 +}; +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Common", Microsoft.Office); +Microsoft.Office.Common.InvokeType={ "async": 0, + "sync": 1, + "asyncRegisterEvent": 2, + "asyncUnregisterEvent": 3, + "syncRegisterEvent": 4, + "syncUnregisterEvent": 5 + }; +Microsoft.Office.Common.InvokeResultCode={ + "noError": 0, + "errorInRequest": -1, + "errorHandlingRequest": -2, + "errorInResponse": -3, + "errorHandlingResponse": -4, + "errorHandlingRequestAccessDenied": -5, + "errorHandlingMethodCallTimedout": -6 + }; +Microsoft.Office.Common.MessageType={ "request": 0, + "response": 1 + }; +Microsoft.Office.Common.ActionType={ "invoke": 0, + "registerEvent": 1, + "unregisterEvent": 2 }; +Microsoft.Office.Common.ResponseType={ "forCalling": 0, + "forEventing": 1 + }; +Microsoft.Office.Common.MethodObject=function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) { + this._method=method; + this._invokeType=invokeType; + this._blockingOthers=blockingOthers; +}; +Microsoft.Office.Common.MethodObject.prototype={ + getMethod: function Microsoft_Office_Common_MethodObject$getMethod() { + return this._method; + }, + getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() { + return this._invokeType; + }, + getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() { + return this._blockingOthers; + } +}; +Microsoft.Office.Common.EventMethodObject=function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) { + this._registerMethodObject=registerMethodObject; + this._unregisterMethodObject=unregisterMethodObject; +}; +Microsoft.Office.Common.EventMethodObject.prototype={ + getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() { + return this._registerMethodObject; + }, + getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() { + return this._unregisterMethodObject; + } +}; +Microsoft.Office.Common.ServiceEndPoint=function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) { + var e=Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) throw e; + this._methodObjectList={}; + this._eventHandlerProxyList={}; + this._Id=serviceEndPointId; + this._conversations={}; + this._policyManager=null; +}; +Microsoft.Office.Common.ServiceEndPoint.prototype={ + registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) { + var e=Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false }, + { name: "method", type: Function, mayBeNull: false }, + { name: "invokeType", type: Number, mayBeNull: false }, + { name: "blockingOthers", type: Boolean, mayBeNull: false } + ]); + if (e) throw e; + if (invokeType !==Microsoft.Office.Common.InvokeType.async + && invokeType !==Microsoft.Office.Common.InvokeType.sync){ + throw OsfMsAjaxFactory.msAjaxError.argument("invokeType"); + } + var methodObject=new Microsoft.Office.Common.MethodObject(method, + invokeType, + blockingOthers); + this._methodObjectList[methodName]=methodObject; + }, + unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) { + var e=Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false } + ]); + if (e) throw e; + delete this._methodObjectList[methodName]; + }, + registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) { + var e=Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false } + ]); + if (e) throw e; + var methodObject=new Microsoft.Office.Common.EventMethodObject ( + new Microsoft.Office.Common.MethodObject(registerMethod, + Microsoft.Office.Common.InvokeType.syncRegisterEvent, + false), + new Microsoft.Office.Common.MethodObject(unregisterMethod, + Microsoft.Office.Common.InvokeType.syncUnregisterEvent, + false) + ); + this._methodObjectList[eventName]=methodObject; + }, + registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) { + var e=Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "registerMethodInvokeType", type: Number, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethodInvokeType", type: Number, mayBeNull: false } + ]); + if (e) throw e; + var methodObject=new Microsoft.Office.Common.EventMethodObject ( + new Microsoft.Office.Common.MethodObject(registerMethod, + registerMethodInvokeType, + false), + new Microsoft.Office.Common.MethodObject(unregisterMethod, + unregisterMethodInvokeType, + false) + ); + this._methodObjectList[eventName]=methodObject; + }, + unregisterEvent: function (eventName) { + var e=Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false } + ]); + if (e) throw e; + this.unregisterMethod(eventName); + }, + registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) throw e; + this._conversations[conversationId]=true; + }, + unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) throw e; + delete this._conversations[conversationId]; + }, + setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) { + var e=Function._validateParams(arguments, [ + { name: "policyManager", type: Object, mayBeNull: false } + ]); + if (e) throw e; + if (!policyManager.checkPermission) { + throw OsfMsAjaxFactory.msAjaxError.argument("policyManager"); + } + this._policyManager=policyManager; + }, + getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() { + return this._policyManager; + } +}; +Microsoft.Office.Common.ClientEndPoint=function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl) { + var e=Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "targetWindow", mayBeNull: false }, + { name: "targetUrl", type: String, mayBeNull: false } + ]); + if (e) throw e; + if (!targetWindow.postMessage) { + throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow"); + } + this._conversationId=conversationId; + this._targetWindow=targetWindow; + this._targetUrl=targetUrl; + this._callingIndex=0; + this._callbackList={}; + this._eventHandlerList={}; +}; +Microsoft.Office.Common.ClientEndPoint.prototype={ + invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) { + var e=Function._validateParams(arguments, [ + { name: "targetMethodName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "param", mayBeNull: true } + ]); + if (e) throw e; + var correlationId=this._callingIndex++; + var now=new Date(); + var callbackEntry={"callback" : callback, "createdOn": now.getTime() }; + if(param && typeof param==="object" && typeof param.__timeout__==="number") { + callbackEntry.timeout=param.__timeout__; + delete param.__timeout__; + } + this._callbackList[correlationId]=callbackEntry; + try { + var callRequest=new Microsoft.Office.Common.Request(targetMethodName, + Microsoft.Office.Common.ActionType.invoke, + this._conversationId, + correlationId, + param); + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } + catch (ex) { + try { + if (callback !==null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + finally { + delete this._callbackList[correlationId]; + } + } + }, + registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) { + var e=Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "eventHandler", type: Function, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) throw e; + var correlationId=this._callingIndex++; + var now=new Date(); + this._callbackList[correlationId]={"callback" : callback, "createdOn": now.getTime() }; + try { + var callRequest=new Microsoft.Office.Common.Request(targetEventName, + Microsoft.Office.Common.ActionType.registerEvent, + this._conversationId, + correlationId, + data); + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + this._eventHandlerList[targetEventName]=eventHandler; + } + catch (ex) { + try { + if (callback !==null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } + finally { + delete this._callbackList[correlationId]; + } + } + }, + unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) { + var e=Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) throw e; + var correlationId=this._callingIndex++; + var now=new Date(); + this._callbackList[correlationId]={"callback" : callback, "createdOn": now.getTime() }; + try { + var callRequest=new Microsoft.Office.Common.Request(targetEventName, + Microsoft.Office.Common.ActionType.unregisterEvent, + this._conversationId, + correlationId, + data); + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } + catch (ex) { + try { + if (callback !==null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } + finally { + delete this._callbackList[correlationId]; + } + } + finally { + delete this._eventHandlerList[targetEventName]; + } + } +}; +Microsoft.Office.Common.XdmCommunicationManager=(function () { + var _invokerQueue=[]; + var _messageProcessingTimer=null; + var _processInterval=10; + var _blockingFlag=false; + var _methodTimeoutTimer=null; + var _methodTimeoutProcessInterval=2000; + var _methodTimeout=60000; + var _serviceEndPoints={}; + var _clientEndPoints={}; + var _initialized=false; + function _lookupServiceEndPoint(conversationId) { + for(var id in _serviceEndPoints) { + if(_serviceEndPoints[id]._conversations[conversationId]) { + return _serviceEndPoints[id]; + } + } + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + }; + function _lookupClientEndPoint(conversationId) { + var clientEndPoint=_clientEndPoints[conversationId]; + if(!clientEndPoint) { + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + return clientEndPoint; + }; + function _lookupMethodObject(serviceEndPoint, messageObject) { + var methodOrEventMethodObject=serviceEndPoint._methodObjectList[messageObject._actionName]; + if (!methodOrEventMethodObject) { + OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+messageObject._actionName); + throw OsfMsAjaxFactory.msAjaxError.argument("messageObject"); + } + var methodObject=null; + if (messageObject._actionType===Microsoft.Office.Common.ActionType.invoke) { + methodObject=methodOrEventMethodObject; + } else if (messageObject._actionType===Microsoft.Office.Common.ActionType.registerEvent) { + methodObject=methodOrEventMethodObject.getRegisterMethodObject(); + } else { + methodObject=methodOrEventMethodObject.getUnregisterMethodObject(); + } + return methodObject; + }; + function _enqueInvoker (invoker) { + _invokerQueue.push(invoker); + }; + function _dequeInvoker() { + if (_messageProcessingTimer !==null) { + if (!_blockingFlag) { + if (_invokerQueue.length > 0) { + var invoker=_invokerQueue.shift(); + _blockingFlag=invoker.getInvokeBlockingFlag(); + invoker.invoke(); + } else { + clearInterval(_messageProcessingTimer); + _messageProcessingTimer=null; + } + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + }; + function _checkMethodTimeout() { + if (_methodTimeoutTimer) { + var clientEndPoint; + var methodCallsNotTimedout=0; + var now=new Date(); + var timeoutValue; + for(var conversationId in _clientEndPoints) { + clientEndPoint=_clientEndPoints[conversationId]; + for(var correlationId in clientEndPoint._callbackList) { + var callbackEntry=clientEndPoint._callbackList[correlationId]; + timeoutValue=callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout; + if(Math.abs(now.getTime() - callbackEntry.createdOn) >=timeoutValue) { + try{ + if(callbackEntry.callback) { + callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout, null); + } + } + finally { + delete clientEndPoint._callbackList[correlationId]; + } + } else { + methodCallsNotTimedout++; + }; + } + } + if (methodCallsNotTimedout===0) { + clearInterval(_methodTimeoutTimer); + _methodTimeoutTimer=null; + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + }; + function _postCallbackHandler() { + _blockingFlag=false; + }; + function _registerListener(listener) { + if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && window.attachEvent) { + window.attachEvent("onmessage", listener); + } else if (window.addEventListener) { + window.addEventListener("message", listener, false); + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."); + throw OsfMsAjaxFactory.msAjaxError.argument("Browser"); + } + }; + function _receive(e) { + if (e.data !='') { + var messageObject; + try { + messageObject=Microsoft.Office.Common.MessagePackager.unenvelope(e.data); + }catch(ex) { + return; + } + if ( typeof (messageObject._messageType)=='undefined' ) { + return; + } + if (messageObject._messageType===Microsoft.Office.Common.MessageType.request) { + var requesterUrl=(e.origin==null || e.origin=="null") ? messageObject._origin : e.origin; + try { + var serviceEndPoint=_lookupServiceEndPoint(messageObject._conversationId); + var policyManager=serviceEndPoint.getPolicyManager(); + if(policyManager && !policyManager.checkPermission(messageObject._conversationId, messageObject._actionName, messageObject._data)) { + throw "Access Denied"; + } + var methodObject=_lookupMethodObject(serviceEndPoint, messageObject); + var invokeCompleteCallback=new Microsoft.Office.Common.InvokeCompleteCallback(e.source, + requesterUrl, + messageObject._actionName, + messageObject._conversationId, + messageObject._correlationId, + _postCallbackHandler); + var invoker=new Microsoft.Office.Common.Invoker(methodObject, + messageObject._data, + invokeCompleteCallback, + serviceEndPoint._eventHandlerProxyList, + messageObject._conversationId, + messageObject._actionName); + if (_messageProcessingTimer==null) { + _messageProcessingTimer=setInterval(_dequeInvoker, _processInterval); + } + _enqueInvoker(invoker); + } + catch (ex) { + var errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest; + if (ex=="Access Denied") { + errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied; + } + var callResponse=new Microsoft.Office.Common.Response(messageObject._actionName, + messageObject._conversationId, + messageObject._correlationId, + errorCode, + Microsoft.Office.Common.ResponseType.forCalling, + ex); + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(callResponse); + if (e.source && e.source.postMessage) { + e.source.postMessage(envelopedResult, requesterUrl); + } + } + } else if (messageObject._messageType===Microsoft.Office.Common.MessageType.response){ + var clientEndPoint=_lookupClientEndPoint(messageObject._conversationId); + if (messageObject._responseType===Microsoft.Office.Common.ResponseType.forCalling) { + var callbackEntry=clientEndPoint._callbackList[messageObject._correlationId]; + if (callbackEntry) { + try { + if (callbackEntry.callback) + callbackEntry.callback(messageObject._errorCode, messageObject._data); + } + finally { + delete clientEndPoint._callbackList[messageObject._correlationId]; + } + } + } else { + var eventhandler=clientEndPoint._eventHandlerList[messageObject._actionName]; + if (eventhandler !==undefined && eventhandler !==null) { + eventhandler(messageObject._data); + } + } + } else { + return; + } + } + }; + function _initialize () { + if(!_initialized) { + _registerListener(_receive); + _initialized=true; + } + }; + return { + connect : function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl) { + var clientEndPoint=_clientEndPoints[conversationId]; + if (!clientEndPoint) { + _initialize(); + clientEndPoint=new Microsoft.Office.Common.ClientEndPoint(conversationId, targetWindow, targetUrl); + _clientEndPoints[conversationId]=clientEndPoint; + } + return clientEndPoint; + }, + getClientEndPoint : function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) { + var e=Function._validateParams(arguments, [ + {name: "conversationId", type: String, mayBeNull: false} + ]); + if (e) throw e; + return _clientEndPoints[conversationId]; + }, + createServiceEndPoint : function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) { + _initialize(); + var serviceEndPoint=new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId); + _serviceEndPoints[serviceEndPointId]=serviceEndPoint; + return serviceEndPoint; + }, + getServiceEndPoint : function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) { + var e=Function._validateParams(arguments, [ + {name: "serviceEndPointId", type: String, mayBeNull: false} + ]); + if (e) throw e; + return _serviceEndPoints[serviceEndPointId]; + }, + deleteClientEndPoint : function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) { + var e=Function._validateParams(arguments, [ + {name: "conversationId", type: String, mayBeNull: false} + ]); + if (e) throw e; + delete _clientEndPoints[conversationId]; + }, + _setMethodTimeout : function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) { + var e=Function._validateParams(arguments, [ + {name: "methodTimeout", type: Number, mayBeNull: false} + ]); + if (e) throw e; + _methodTimeout=(methodTimeout <=0) ? 60000 : methodTimeout; + }, + _startMethodTimeoutTimer : function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() { + if (!_methodTimeoutTimer) { + _methodTimeoutTimer=setInterval(_checkMethodTimeout, _methodTimeoutProcessInterval); + } + } + }; +})(); +Microsoft.Office.Common.Message=function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) { + var e=Function._validateParams(arguments, [ + {name: "messageType", type: Number, mayBeNull: false}, + {name: "actionName", type: String, mayBeNull: false}, + {name: "conversationId", type: String, mayBeNull: false}, + {name: "correlationId", mayBeNull: false}, + {name: "data", mayBeNull: true, optional: true } + ]); + if (e) throw e; + this._messageType=messageType; + this._actionName=actionName; + this._conversationId=conversationId; + this._correlationId=correlationId; + this._origin=window.location.href; + if (typeof data=="undefined") { + this._data=null; + } else { + this._data=data; + } +}; +Microsoft.Office.Common.Message.prototype={ + getActionName: function Microsoft_Office_Common_Message$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_Message$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() { + return this._correlationId; + }, + getOrigin: function Microsoft_Office_Common_Message$getOrigin() { + return this._origin; + }, + getData: function Microsoft_Office_Common_Message$getData() { + return this._data; + }, + getMessageType: function Microsoft_Office_Common_Message$getMessageType() { + return this._messageType; + } +}; +Microsoft.Office.Common.Request=function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) { + Microsoft.Office.Common.Request.uber.constructor.call(this, + Microsoft.Office.Common.MessageType.request, + actionName, + conversationId, + correlationId, + data); + this._actionType=actionType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Request, Microsoft.Office.Common.Message); +Microsoft.Office.Common.Request.prototype.getActionType=function Microsoft_Office_Common_Request$getActionType() { + return this._actionType; +}; +Microsoft.Office.Common.Response=function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) { + Microsoft.Office.Common.Response.uber.constructor.call(this, + Microsoft.Office.Common.MessageType.response, + actionName, + conversationId, + correlationId, + data); + this._errorCode=errorCode; + this._responseType=responseType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Response, Microsoft.Office.Common.Message); +Microsoft.Office.Common.Response.prototype.getErrorCode=function Microsoft_Office_Common_Response$getErrorCode() { + return this._errorCode; +}; +Microsoft.Office.Common.Response.prototype.getResponseType=function Microsoft_Office_Common_Response$getResponseType() { + return this._responseType; +}; +Microsoft.Office.Common.MessagePackager={ + envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject) { + return OsfMsAjaxFactory.msAjaxSerializer.serialize(messageObject); + }, + unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject) { + return OsfMsAjaxFactory.msAjaxSerializer.deserialize(messageObject, true); + } +}; +Microsoft.Office.Common.ResponseSender=function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType) { + var e=Function._validateParams(arguments, [ + {name: "requesterWindow", mayBeNull: false}, + {name: "requesterUrl", type: String, mayBeNull: false}, + {name: "actionName", type: String, mayBeNull: false}, + {name: "conversationId", type: String, mayBeNull: false}, + {name: "correlationId", mayBeNull: false}, + {name: "responsetype", type: Number, maybeNull: false } + ]); + if (e) throw e; + this._requesterWindow=requesterWindow; + this._requesterUrl=requesterUrl; + this._actionName=actionName; + this._conversationId=conversationId; + this._correlationId=correlationId; + this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError; + this._responseType=responseType; + var me=this; + this._send=function (result) { + var response=new Microsoft.Office.Common.Response( me._actionName, + me._conversationId, + me._correlationId, + me._invokeResultCode, + me._responseType, + result); + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response); + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + }; +}; +Microsoft.Office.Common.ResponseSender.prototype={ + getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() { + return this._requesterWindow; + }, + getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() { + return this._requesterUrl; + }, + getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() { + return this._correlationId; + }, + getSend: function Microsoft_Office_Common_ResponseSender$getSend() { + return this._send; + }, + setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) { + this._invokeResultCode=resultCode; + } +}; +Microsoft.Office.Common.InvokeCompleteCallback=function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler) { + Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this, + requesterWindow, + requesterUrl, + actionName, + conversationId, + correlationId, + Microsoft.Office.Common.ResponseType.forCalling); + this._postCallbackHandler=postCallbackHandler; + var me=this; + this._send=function (result) { + var response=new Microsoft.Office.Common.Response(me._actionName, + me._conversationId, + me._correlationId, + me._invokeResultCode, + me._responseType, + result); + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response); + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + me._postCallbackHandler(); + }; +}; +OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback, Microsoft.Office.Common.ResponseSender); +Microsoft.Office.Common.Invoker=function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName) { + var e=Function._validateParams(arguments, [ + {name: "methodObject", mayBeNull: false}, + {name: "paramValue", mayBeNull: true}, + {name: "invokeCompleteCallback", mayBeNull: false}, + {name: "eventHandlerProxyList", mayBeNull: true}, + {name: "conversationId", type: String, mayBeNull: false}, + {name: "eventName", type: String, mayBeNull: false} + ]); + if (e) throw e; + this._methodObject=methodObject; + this._param=paramValue; + this._invokeCompleteCallback=invokeCompleteCallback; + this._eventHandlerProxyList=eventHandlerProxyList; + this._conversationId=conversationId; + this._eventName=eventName; +}; +Microsoft.Office.Common.Invoker.prototype={ + invoke: function Microsoft_Office_Common_Invoker$invoke() { + try { + var result; + switch (this._methodObject.getInvokeType()) { + case Microsoft.Office.Common.InvokeType.async: + this._methodObject.getMethod()(this._param, this._invokeCompleteCallback.getSend()); + break; + case Microsoft.Office.Common.InvokeType.sync: + result=this._methodObject.getMethod()(this._param); + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncRegisterEvent: + var eventHandlerProxy=this._createEventHandlerProxyObject(this._invokeCompleteCallback); + result=this._methodObject.getMethod()(eventHandlerProxy.getSend(), this._param); + this._eventHandlerProxyList[this._conversationId+this._eventName]=eventHandlerProxy.getSend(); + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncUnregisterEvent: + var eventHandler=this._eventHandlerProxyList[this._conversationId+this._eventName]; + result=this._methodObject.getMethod()(eventHandler, this._param); + delete this._eventHandlerProxyList[this._conversationId+this._eventName]; + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.asyncRegisterEvent: + var eventHandlerProxyAsync=this._createEventHandlerProxyObject(this._invokeCompleteCallback); + this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(), + this._invokeCompleteCallback.getSend(), + this._param + ); + this._eventHandlerProxyList[this._callerId+this._eventName]=eventHandlerProxyAsync.getSend(); + break; + case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: + var eventHandlerAsync=this._eventHandlerProxyList[this._callerId+this._eventName]; + this._methodObject.getMethod()(eventHandlerAsync, + this._invokeCompleteCallback.getSend(), + this._param + ); + delete this._eventHandlerProxyList[this._callerId+this._eventName]; + break; + default: + break; + } + } + catch (ex) { + this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse); + this._invokeCompleteCallback.getSend()(ex); + } + }, + getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() { + return this._methodObject.getBlockingFlag(); + }, + _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) { + return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(), + invokeCompleteObject.getRequesterUrl(), + invokeCompleteObject.getActionName(), + invokeCompleteObject.getConversationId(), + invokeCompleteObject.getCorrelationId(), + Microsoft.Office.Common.ResponseType.forEventing + ); + } +}; + OSF.EventDispatch=function OSF_EventDispatch(eventTypes) { + this._eventHandlers={}; + for(var entry in eventTypes) { + var eventType=eventTypes[entry]; + this._eventHandlers[eventType]=[]; + } + }; + OSF.EventDispatch.prototype={ + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events=[]; + for(var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported=false; + for(var eventName in this._eventHandlers) { + if(event==eventName) { + isSupported=true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if(handlers && handlers.length > 0) { + for(var h in handlers) { + if(handlers[h]===handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if(typeof handler !="function") { + return false; + } + var handlers=this._eventHandlers[eventType]; + if( handlers && !this.hasEventHandler(eventType, handler) ) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if(handlers && handlers.length > 0) { + for(var index=0; index < handlers.length; index++) { + if(handlers[index]===handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + this._eventHandlers[eventType]=[]; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if( eventArgs.type==undefined ) + return false; + var eventType=eventArgs.type; + if( eventType && this._eventHandlers[eventType] ) { + var eventHandlers=this._eventHandlers[eventType]; + for(var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } + }; + OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if(OSF.OUtil.isArray(obj)) { + var dim=0; + for(var index=0; index < obj.length; index++) { + dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim+1; + } + else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch(bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch(coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if(data==null || data==undefined) + return null; + var sourceType=null; + var runtimeType=typeof data; + if(data.rows !==undefined) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Table; + } else if(OSF.OUtil.isArray(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if(runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if( sourceType && sourceType !=destinationType ) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data=OSF.DDA.DataCoercion._coerceDataFromTable( + destinationType, + OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType) + ); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length==1 && matrix[0].length==1) + return ""+matrix[0][0]; + var val=""; + for (var i=0; i < matrix.length; i++) { + val+=matrix[i].join("\t")+"\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret=text.split("\n"); + for (var i=0; i < ret.length; i++) + ret[i]=ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers=""; + if(table.headers !=null) { + headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n"; + } + var rows=OSF.DDA.DataCoercion._matrixToText(table.rows); + if(rows=="") { + headers=headers.substring(0, headers.length - 1); + } + return headers+rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix=table.rows; + if(table.headers !=null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch(coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + try { + var items=OSF.DDA.DataCoercion._tableToText(table); + value=new OSF.DDA.SlideRange(items); + } + catch (e) { + value=OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if( sourceType==undefined ) { + sourceType=OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch(sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; + })(); + OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if(callback) { + var asyncInitArgs={}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload; + } + else { + errorArgs={}; + payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name||payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message||payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } + }; + OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime(); + }; + OSF.DDA.SettingsManager={ + SerializedSettings: "serializedSettings", + DateJSONPrefix : "Date(", + DataJSONSuffix : ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret={}; + for(var key in settingsCollection) { + var value=settingsCollection[key]; + try { + if(JSON) { + value=JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } + else { + value=Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key]=value; + } + catch(ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret={}; + serializedSettings=serializedSettings || {}; + for(var key in serializedSettings) { + var value=serializedSettings[key]; + try { + if(JSON) { + value=JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) { + d=new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } + else { + value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key]=value; + } + catch(ex) { + } + } + return ret; + } + }; + OSF.DDA.OMFactory={ + manufactureBinding: function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id=bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch(bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding=new OSF.DDA.TextBinding( + id, + containingDocument + ); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding=new OSF.DDA.MatrixBinding( + id, + containingDocument, + rows, + cols + ); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp=function () { + return (OSF.DDA.ExcelDocument) + && (Microsoft.Office.WebExtension.context.document) + && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject=OSF.DDA.ExcelTableBinding; + } + else { + tableBindingObject=OSF.DDA.TableBinding; + } + binding=new tableBindingObject( + id, + containingDocument, + rows, + cols, + hasHeaders + ); + break; + default: + binding=new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; + }, + manufactureTableData: function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData( + tableDataProperties[OSF.DDA.TableDataProperties.TableRows], + tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders] + ); + }, + manufactureDataNode: function OSF_DDA_OMFactory$manufactureDataNode(nodeProperties) { + if(nodeProperties) { + return new OSF.DDA.CustomXmlNode( + nodeProperties[OSF.DDA.DataNodeProperties.Handle], + nodeProperties[OSF.DDA.DataNodeProperties.NodeType], + nodeProperties[OSF.DDA.DataNodeProperties.NamespaceUri], + nodeProperties[OSF.DDA.DataNodeProperties.BaseName] + ); + } + }, + manufactureDataPart: function OSF_DDA_OMFactory$manufactureDataPart(partProperties, containingCustomXmlParts) { + return new OSF.DDA.CustomXmlPart( + containingCustomXmlParts, + partProperties[OSF.DDA.DataPartProperties.Id], + partProperties[OSF.DDA.DataPartProperties.BuiltIn] + ); + }, + manufactureEventArgs: function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args=new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args=new OSF.DDA.BindingSelectionChangedEventArgs( + this.manufactureBinding(eventProperties, target.document), + eventProperties[OSF.DDA.PropertyDescriptors.Subset] + ); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args=new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.Internal.EventType.OfficeThemeChanged: + args=new OSF.DDA.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.Internal.EventType.DocumentThemeChanged: + args=new OSF.DDA.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args=new OSF.DDA.NodeInsertedEventArgs( + this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), + eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo] + ); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args=new OSF.DDA.NodeReplacedEventArgs( + this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), + this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), + eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo] + ); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args=new OSF.DDA.NodeDeletedEventArgs( + this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), + this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), + eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo] + ); + break; + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args=new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args=new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args=new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; + } + }; + OSF.DDA.ListType=(function () { + var listTypes={}; + listTypes[OSF.DDA.ListDescriptors.BindingList]=OSF.DDA.PropertyDescriptors.BindingProperties; + listTypes[OSF.DDA.ListDescriptors.DataPartList]=OSF.DDA.PropertyDescriptors.DataPartProperties; + listTypes[OSF.DDA.ListDescriptors.DataNodeList]=OSF.DDA.PropertyDescriptors.DataNodeProperties; + return { + isListType: function OSF_DDA_ListType$IsListType(t) { return OSF.OUtil.listContainsKey(listTypes, t); }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { return listTypes[t]; } + }; + })(); + OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount=requiredParameters.length; + var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function() { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for(var name in params) { + var param=params[name]; + var arg=args[name]; + if(param["enum"]) { + switch(typeof arg) { + case "string": + if(OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + if(param["types"]) { + if(!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + }; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, theCaller, stateInfo) { + if(userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + var requiredArgs=[]; + var index; + for(index=0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret={}; + for(index=0; index < requiredCount; index++) { + var param=requiredParameters[index]; + var arg=requiredArgs[index]; + if(param.verify) { + var isValid=param.verify(arg, theCaller, stateInfo); + if(!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name]=arg; + } + return ret; + }; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, theCaller, stateInfo) { + if(userArgs.length > requiredCount+2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + for(var i=userArgs.length - 1; i >=requiredCount; i--) { + var argument=userArgs[i]; + switch(typeof argument) { + case "object": + if(options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } + else { + options=argument; + } + break; + case "function": + if(parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } + else { + parameterCallback=argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options=options || {}; + for(var optionName in supportedOptions) { + if(!OSF.OUtil.listContainsKey(options, optionName)) { + var value=undefined; + var option=supportedOptions[optionName]; + if(option.calculate && requiredArgs) { + value=option.calculate(requiredArgs, theCaller, stateInfo); + } + if(!value && option.defaultValue !=undefined) { + value=option.defaultValue; + } + options[optionName]=value; + } + } + if(parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } + else { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + }; + this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, theCaller, stateInfo) { + var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, theCaller, stateInfo); + var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, theCaller, stateInfo); + var callArgs={}; + for(var r in required) { + callArgs[r]=required[r]; + } + for(var o in options) { + callArgs[o]=options[o]; + } + for(var s in privateStateCallbacks) { + callArgs[s]=privateStateCallbacks[s](theCaller, stateInfo); + } + if(checkCallArgs) { + callArgs=checkCallArgs(callArgs, theCaller, stateInfo); + } + return callArgs; + }; + this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, theCaller, callArgs) { + var payload; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if(onSucceeded) { + payload=onSucceeded(response, theCaller, callArgs); + } + else { + payload=response; + } + } + else { + if(onFailed) { + payload=onFailed(status, response); + } else { + payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + this.getCallArgs=function(suppliedArgs) { + var options, parameterCallback; + for(var i=suppliedArgs.length - 1; i >=requiredCount; i--) { + var argument=suppliedArgs[i]; + switch(typeof argument) { + case "object": + options=argument; + break; + case "function": + parameterCallback=argument; + break; + } + } + options=options || {}; + if(parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + return options; + }; + }; + OSF.DDA.ConvertToDocumentTheme=function OSF_DDA_ConvertToDocumentTheme(response) { + var mappingDocumentTheme=[ + { name: "primaryFontColor", needToConvertToHex: true }, + { name: "primaryBackgroundColor", needToConvertToHex: true }, + { name: "secondaryFontColor", needToConvertToHex: true }, + { name: "secondaryBackgroundColor", needToConvertToHex: true }, + { name: "accent1", needToConvertToHex: true }, + { name: "accent2", needToConvertToHex: true }, + { name: "accent3", needToConvertToHex: true }, + { name: "accent4", needToConvertToHex: true }, + { name: "accent5", needToConvertToHex: true }, + { name: "accent6", needToConvertToHex: true }, + { name: "hyperlink", needToConvertToHex: true }, + { name: "followedHyperlink", needToConvertToHex: true }, + { name: "headerLatinFont", needToConvertToHex: false }, + { name: "headerEastAsianFont", needToConvertToHex: false }, + { name: "headerScriptFont", needToConvertToHex: false }, + { name: "headerLocalizedFont", needToConvertToHex: false }, + { name: "bodyLatinFont", needToConvertToHex: false }, + { name: "bodyEastAsianFont", needToConvertToHex: false }, + { name: "bodyScriptFont", needToConvertToHex: false }, + { name: "bodyLocalizedFont", needToConvertToHex: false } + ]; + var result={}; + for (var i=0; i < mappingDocumentTheme.length; i++) { + if (mappingDocumentTheme[i].needToConvertToHex) { + result[mappingDocumentTheme[i].name]=OSF.OUtil.convertIntToHex(response[mappingDocumentTheme[i].name]); + } + else + { + result[mappingDocumentTheme[i].name]=response[mappingDocumentTheme[i].name] + } + } + return result; + } + OSF.DDA.ConvertToOfficeTheme=function OSF_DDA_ConvertToOfficeTheme(response) { + var result={}; + for (var key in response) { + result[key]=OSF.OUtil.convertIntToHex(response[key]); + } + return result; + } + OSF.DDA.AsyncMethodNames=(function(methodNames) { + var ret={}; + for(var entry in methodNames) { + var am={}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + ret[entry]=am; + } + return ret; + }({ + GoToByIdAsync: "goToByIdAsync", + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync", + GetDocumentCopyAsync: "getFileAsync", + GetDocumentCopyChunkAsync: "getSliceAsync", + ReleaseDocumentCopyAsync: "closeAsync", + GetFilePropertiesAsync: "getFilePropertiesAsync", + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromPromptAsync: "addFromPromptAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync", + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync", + ClearFormatsAsync: "clearFormatsAsync", + SetTableOptionsAsync: "setTableOptionsAsync", + SetFormatsAsync:"setFormatsAsync", + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync", + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync", + GetActiveViewAsync: "getActiveViewAsync", + AddDataPartAsync: "addAsync", + GetDataPartByIdAsync: "getByIdAsync", + GetDataPartsByNameSpaceAsync: "getByNamespaceAsync", + DeleteDataPartAsync: "deleteAsync", + GetPartNodesAsync: "getNodesAsync", + GetPartXmlAsync: "getXmlAsync", + AddDataPartNamespaceAsync: "addNamespaceAsync", + GetDataPartNamespaceAsync: "getNamespaceAsync", + GetDataPartPrefixAsync: "getPrefixAsync", + GetRelativeNodesAsync: "getNodesAsync", + GetNodeValueAsync: "getNodeValueAsync", + GetNodeXmlAsync: "getXmlAsync", + SetNodeValueAsync: "setNodeValueAsync", + SetNodeXmlAsync: "setXmlAsync", + GetOfficeThemeAsync: "getOfficeThemeAsync", + GetDocumentThemeAsync: "getDocumentThemeAsync", + GetSelectedTask: "getSelectedTaskAsync", + GetTask: "getTaskAsync", + GetWSSUrl: "getWSSUrlAsync", + GetTaskField: "getTaskFieldAsync", + GetSelectedResource: "getSelectedResourceAsync", + GetResourceField: "getResourceFieldAsync", + GetProjectField: "getProjectFieldAsync", + GetSelectedView: "getSelectedViewAsync" + }) + ); + OSF.DDA.AsyncMethodCallFactory=(function() { + function createObject(properties) { + var obj=null; + if(properties) { + obj={}; + var len=properties.length; + for(var i=0 ; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + return { + manufacture: function(params) { + var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + return new OSF.DDA.AsyncMethodCall( + params.requiredArguments || [], + supportedOptions, + privateStateCallbacks, + params.onSucceeded, + params.onFailed, + params.checkCallArgs, + params.method.displayName + ); + } + }; + })(); + OSF.DDA.AsyncMethodCalls=(function() { + var asyncMethodCalls={}; + function define(params) { + asyncMethodCalls[params.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(params); + } + function processData(dataDescriptor, theCaller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + if(data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) { + data=OSF.DDA.OMFactory.manufactureTableData(data); + } + data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data==undefined ? null : data; + } + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function processDataPart(dataPartDescriptor) { + return OSF.DDA.OMFactory.manufactureDataPart(dataPartDescriptor, Microsoft.Office.WebExtension.context.document.customXmlParts); + } + function processDataNode(dataNodeDescriptor) { + return OSF.DDA.OMFactory.manufactureDataNode(dataNodeDescriptor); + } + function getObjectId(obj) { return obj.id; } + function getPartId(part, partId) { return partId; }; + function getNodeHandle(node, nodeHandle) { return nodeHandle; }; + define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.SelectionMode, + value : { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.ValueFormat, + value : { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.FilterType, + value : { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks : [], + onSucceeded : processData + }); + define({ + method : OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.CoercionType, + value : { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function(requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + privateStateCallbacks : [] + }); + define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties( + filePropertiesDescriptor + ); + } + }); + define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.FileType, + "enum": Microsoft.Office.WebExtension.FileType + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.SliceSize, + value : { + "types": ["number"], + "defaultValue": 4 * 1024 * 1024 + } + } + ], + onSucceeded: function(fileDescriptor, theCaller, callArgs) { + return new OSF.DDA.File( + fileDescriptor[OSF.DDA.FileProperties.Handle], + fileDescriptor[OSF.DDA.FileProperties.FileSize], + callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize] + ); + } + }); + define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.SliceIndex, + "types": ["number"] + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value : function(theCaller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.Handle]; } + }, + { + name: OSF.DDA.FileProperties.SliceSize, + value : function(theCaller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.SliceSize]; } + } + ], + checkCallArgs: function(callArgs, theCaller, stateInfo) { + var index=callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]; + if(index < 0 || index >=theCaller.sliceCount) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange; + } + callArgs[OSF.DDA.FileSliceOffset]=parseInt(index * stateInfo[OSF.DDA.FileProperties.SliceSize]); + return callArgs; + }, + onSucceeded: function(sliceDescriptor, theCaller, callArgs) { + var slice={}; + OSF.OUtil.defineEnumerableProperties(slice, { + "data": { + value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data] + }, + "index": { + value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex] + }, + "size": { + value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize] + } + }); + return slice; + } + }); + define({ + method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync, + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value : function(theCaller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.Handle]; } + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + } + ], + privateStateCallbacks : [], + onSucceeded : processBinding + }); + define({ + method : OSF.DDA.AsyncMethodNames.AddFromPromptAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.PromptText, + value : { + "types": ["string"], + "calculate": function() { return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; } + } + } + ], + privateStateCallbacks : [], + onSucceeded : processBinding + }); + define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + } + ], + privateStateCallbacks : [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value : function() { return true; } + } + ], + onSucceeded: processBinding + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : function(response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); } + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : processBinding + }); + define({ + method : OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : function(response, theCaller, callArgs) { + var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete theCaller._eventDispatches[id]; + } + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments : [], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.CoercionType, + value : { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function(requiredArgs, binding) { return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); } + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.ValueFormat, + value : { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.FilterType, + value : { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.StartRow, + value : { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.StartColumn, + value : { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.RowCount, + value : { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.ColumnCount, + value : { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs : function(callArgs, theCaller, stateInfo) { + if(callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && + callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 && + callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 && + callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if(callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(theCaller.type) && + (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || + callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || + callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || + callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]) ) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ], + onSucceeded : processData + }); + define({ + method : OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.CoercionType, + value : { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function(requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); } + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.StartRow, + value : { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name : Microsoft.Office.WebExtension.Parameters.StartColumn, + value : { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.CellFormat, + value: { + "types": ["object"], + "defaultValue": [] + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.TableOptions, + value: { + "types": ["object"], + "defaultValue": [] + } + } + ], + checkCallArgs : function(callArgs, theCaller, stateInfo) { + var Parameters=Microsoft.Office.WebExtension.Parameters; + if (callArgs[Parameters.StartRow]==0 && + callArgs[Parameters.StartColumn]==0 && + OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 && + OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) { + delete callArgs[Parameters.StartRow]; + delete callArgs[Parameters.StartColumn]; + delete callArgs[Parameters.CellFormat]; + delete callArgs[Parameters.TableOptions]; + } + if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(theCaller.type) && + ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) || + (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) || + callArgs[Parameters.CellFormat] || + callArgs[Parameters.TableOptions])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.ClearFormatsAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ] + }); + define({ + method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.TableOptions, + "defaultValue" : [] + } + ], + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ] + }); + define({ + method: OSF.DDA.AsyncMethodNames.SetFormatsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CellFormat, + "defaultValue": [] + } + ], + privateStateCallbacks : [ + { + name : Microsoft.Office.WebExtension.Parameters.Id, + value : getObjectId + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } + }); + define({ + method : OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments : [], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value : { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks : [ + { + name : OSF.DDA.SettingsManager.SerializedSettings, + value : function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function(eventType, theCaller, eventDispatch) { return eventDispatch.supportsEvent(eventType); } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions : [], + privateStateCallbacks : [] + }); + define({ + method : OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function(eventType, theCaller, eventDispatch) { return eventDispatch.supportsEvent(eventType); } + } + ], + supportedOptions : [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function"], + "defaultValue": null + } + } + ], + privateStateCallbacks : [] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : OSF.DDA.ConvertToDocumentTheme + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : OSF.DDA.ConvertToOfficeTheme + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : function (response) { + var data=response[Microsoft.Office.WebExtension.Parameters.ActiveView]; + return data==undefined ? null : data; + } + }); + define({ + method : OSF.DDA.AsyncMethodNames.AddDataPartAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : processDataPart + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : processDataPart + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [], + onSucceeded : function(response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataPartList], processDataPart); } + }); + define({ + method : OSF.DDA.AsyncMethodNames.DeleteDataPartAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataPartProperties.Id, + value : getObjectId + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetPartNodesAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataPartProperties.Id, + value : getObjectId + } + ], + onSucceeded : function(response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); } + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetPartXmlAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataPartProperties.Id, + value : getObjectId + } + ], + onSucceeded : processData + }); + define({ + method : OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataPartProperties.Id, + value : getPartId + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataPartProperties.Id, + value : getPartId + } + ], + onSucceeded : processData + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataPartProperties.Id, + value : getPartId + } + ], + onSucceeded : processData + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataNodeProperties.Handle, + value : getNodeHandle + } + ], + onSucceeded : function(response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); } + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetNodeValueAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataNodeProperties.Handle, + value : getNodeHandle + } + ], + onSucceeded : processData + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetNodeXmlAsync, + requiredArguments : [], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataNodeProperties.Handle, + value : getNodeHandle + } + ], + onSucceeded : processData + }); + define({ + method : OSF.DDA.AsyncMethodNames.SetNodeValueAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataNodeProperties.Handle, + value : getNodeHandle + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.SetNodeXmlAsync, + requiredArguments : [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions : [], + privateStateCallbacks : [ + { + name : OSF.DDA.DataNodeProperties.Handle, + value : getNodeHandle + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetSelectedTask, + onSucceeded: function(taskIdDescriptor) { return taskIdDescriptor[Microsoft.Office.WebExtension.Parameters.TaskId]; } + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetTask, + requiredArguments : [ + { + name: Microsoft.Office.WebExtension.Parameters.TaskId, + types: ["string"] + } + ] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetTaskField, + requiredArguments : [ + { + name: Microsoft.Office.WebExtension.Parameters.TaskId, + types: ["string"] + }, + { name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + }], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.GetRawValue, + value : { + "types": ["boolean"], + "defaultValue": false + } + }] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetResourceField, + requiredArguments : [ + { + name: Microsoft.Office.WebExtension.Parameters.ResourceId, + types: ["string"] + }, + { name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + }], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.GetRawValue, + value : { + "types": ["boolean"], + "defaultValue": false + } + }] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetProjectField, + requiredArguments : [ + { name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + } + ], + supportedOptions : [ + { + name : Microsoft.Office.WebExtension.Parameters.GetRawValue, + value : { + "types": ["boolean"], + "defaultValue": false + } + }] + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetSelectedResource, + onSucceeded: function(resIdDescriptor) { return resIdDescriptor[Microsoft.Office.WebExtension.Parameters.ResourceId]; } + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetWSSUrl + }); + define({ + method : OSF.DDA.AsyncMethodNames.GetSelectedView + }); + return asyncMethodCalls; + })(); + OSF.DDA.HostParameterMap=function (specialProcessor, mappings) { + var toHostMap="toHost"; + var fromHostMap="fromHost"; + var self="self"; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={ + toHost: function(data) { + if(data.rows !==undefined) { + var tableData={}; + tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers; + data=tableData; + } + return data; + }, + fromHost: function(args) { + return args; + } + }; + function mapValues(preimageSet, mapping) { + var ret=preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage=preimageSet[entry]; + var image; + if(OSF.DDA.ListType.isListType(entry)) { + image=[]; + for(var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } + else if(OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image=dynamicTypes[entry][mapping](preimage); + } + else if(mapping==fromHostMap && specialProcessor.preserveNesting(entry)) { + image=mapValues(preimage, mapping); + } + else { + var maps=mappings[entry]; + if (maps) { + var map=maps[mapping]; + if(map) { + image=map[preimage]; + if(image===undefined) { + image=preimage; + } + } + } + else { + image=preimage; + } + } + ret[entry]=image; + } + return ret; + }; + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg=generateArguments(imageSet, mappings[param][toHostMap]); + } + else { + arg=imageSet[param]; + } + if(arg !=undefined) { + if(!ret) { + ret={}; + } + var index=parameters[param]; + if(index==self) { + index=param; + } + ret[index]=specialProcessor.pack(param, arg); + } + } + return ret; + }; + function extractArguments(source, parameters, extracted) { + if(!extracted) { + extracted={}; + } + for(var param in parameters) { + var index=parameters[param]; + var value; + if(index==self) { + value=source; + } + else { + value=source[index]; + } + if(value===null || value===undefined) { + extracted[param]=undefined; + } + else { + value=specialProcessor.unpack(param, value); + var map; + if(specialProcessor.isComplexType(param)) { + map=mappings[param][fromHostMap]; + if(specialProcessor.preserveNesting(param)) { + extracted[param]=extractArguments(value, map); + } + else { + extractArguments(value, map, extracted); + } + } + else { + if(OSF.DDA.ListType.isListType(param)) { + map={}; + var entryDescriptor=OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor]=self; + for(var item in value) { + value[item]=extractArguments(value[item], map); + } + } + extracted[param]=value; + } + } + } + return extracted; + }; + function applyMap(mapName, preimage, mapping) { + var parameters=mappings[mapName][mapping]; + var image; + if(mapping=="toHost") { + var imageSet=mapValues(preimage, mapping); + image=generateArguments(imageSet, parameters); + } + else if(mapping=="fromHost") { + var argumentSet=extractArguments(preimage, parameters); + image=mapValues(argumentSet, mapping); + } + return image; + }; + if (!mappings) { + mappings={}; + } + this.setMapping=function (mapName, description) { + var toHost, fromHost; + if(description.map) { + toHost=description.map; + fromHost={}; + for (var preimage in toHost) { + var image=toHost[preimage]; + if(image==self) { + image=preimage; + } + fromHost[image]=preimage; + } + } + else { + toHost=description.toHost; + fromHost=description.fromHost; + } + var pair=mappings[mapName]={}; + pair[toHostMap]=toHost; + pair[fromHostMap]=fromHost; + }; + this.toHost=function (mapName, preimage) { return applyMap(mapName, preimage, toHostMap); }; + this.fromHost=function (mapName, image) { return applyMap(mapName, image, fromHostMap); }; + this.self=self; + this.dynamicTypes=dynamicTypes; + this.mapValues=mapValues; + this.specialProcessorDynamicTypes=specialProcessor.dynamicTypes; + }; + OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) { + this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn=[ + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } + else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } + else { + value=arg; + } + return value; + }; + }; + OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap={}; + var jsom=OSF.DDA.AsyncMethodNames; + var did=OSF.DDA.MethodDispId; + dispIdMap[jsom.GoToByIdAsync.id]=did.dispidNavigateToMethod; + dispIdMap[jsom.GetSelectedDataAsync.id]=did.dispidGetSelectedDataMethod; + dispIdMap[jsom.SetSelectedDataAsync.id]=did.dispidSetSelectedDataMethod; + dispIdMap[jsom.GetDocumentCopyChunkAsync.id]=did.dispidGetDocumentCopyChunkMethod; + dispIdMap[jsom.ReleaseDocumentCopyAsync.id]=did.dispidReleaseDocumentCopyMethod; + dispIdMap[jsom.GetDocumentCopyAsync.id]=did.dispidGetDocumentCopyMethod; + dispIdMap[jsom.AddFromSelectionAsync.id]=did.dispidAddBindingFromSelectionMethod; + dispIdMap[jsom.AddFromPromptAsync.id]=did.dispidAddBindingFromPromptMethod; + dispIdMap[jsom.AddFromNamedItemAsync.id]=did.dispidAddBindingFromNamedItemMethod; + dispIdMap[jsom.GetAllAsync.id]=did.dispidGetAllBindingsMethod; + dispIdMap[jsom.GetByIdAsync.id]=did.dispidGetBindingMethod; + dispIdMap[jsom.ReleaseByIdAsync.id]=did.dispidReleaseBindingMethod; + dispIdMap[jsom.GetDataAsync.id]=did.dispidGetBindingDataMethod; + dispIdMap[jsom.SetDataAsync.id]=did.dispidSetBindingDataMethod; + dispIdMap[jsom.GetFilePropertiesAsync.id]=did.dispidGetFilePropertiesMethod; + dispIdMap[jsom.AddRowsAsync.id]=did.dispidAddRowsMethod; + dispIdMap[jsom.AddColumnsAsync.id]=did.dispidAddColumnsMethod; + dispIdMap[jsom.DeleteAllDataValuesAsync.id]=did.dispidClearAllRowsMethod; + dispIdMap[jsom.ClearFormatsAsync.id]=did.dispidClearFormatsMethod; + dispIdMap[jsom.RefreshAsync.id]=did.dispidLoadSettingsMethod; + dispIdMap[jsom.SaveAsync.id]=did.dispidSaveSettingsMethod; + dispIdMap[jsom.SetTableOptionsAsync.id]=did.dispidSetTableOptionsMethod; + dispIdMap[jsom.SetFormatsAsync.id]=did.dispidSetFormatsMethod; + dispIdMap[jsom.GetActiveViewAsync.id]=did.dispidGetActiveViewMethod; + dispIdMap[jsom.AddDataPartAsync.id]=did.dispidAddDataPartMethod; + dispIdMap[jsom.GetDataPartByIdAsync.id]=did.dispidGetDataPartByIdMethod; + dispIdMap[jsom.GetDataPartsByNameSpaceAsync.id]=did.dispidGetDataPartsByNamespaceMethod; + dispIdMap[jsom.GetPartXmlAsync.id]=did.dispidGetDataPartXmlMethod; + dispIdMap[jsom.GetPartNodesAsync.id]=did.dispidGetDataPartNodesMethod; + dispIdMap[jsom.DeleteDataPartAsync.id]=did.dispidDeleteDataPartMethod; + dispIdMap[jsom.GetNodeValueAsync.id]=did.dispidGetDataNodeValueMethod; + dispIdMap[jsom.GetNodeXmlAsync.id]=did.dispidGetDataNodeXmlMethod; + dispIdMap[jsom.GetRelativeNodesAsync.id]=did.dispidGetDataNodesMethod; + dispIdMap[jsom.SetNodeValueAsync.id]=did.dispidSetDataNodeValueMethod; + dispIdMap[jsom.SetNodeXmlAsync.id]=did.dispidSetDataNodeXmlMethod; + dispIdMap[jsom.AddDataPartNamespaceAsync.id]=did.dispidAddDataNamespaceMethod; + dispIdMap[jsom.GetDataPartNamespaceAsync.id]=did.dispidGetDataUriByPrefixMethod; + dispIdMap[jsom.GetDataPartPrefixAsync.id]=did.dispidGetDataPrefixByUriMethod; + dispIdMap[jsom.GetDocumentThemeAsync.id]=did.dispidGetDocumentThemeMethod; + dispIdMap[jsom.GetOfficeThemeAsync.id]=did.dispidGetOfficeThemeMethod; + dispIdMap[jsom.GetSelectedTask.id]=did.dispidGetSelectedTaskMethod; + dispIdMap[jsom.GetTask.id]=did.dispidGetTaskMethod; + dispIdMap[jsom.GetWSSUrl.id]=did.dispidGetWSSUrlMethod; + dispIdMap[jsom.GetTaskField.id]=did.dispidGetTaskFieldMethod; + dispIdMap[jsom.GetSelectedResource.id]=did.dispidGetSelectedResourceMethod; + dispIdMap[jsom.GetResourceField.id]=did.dispidGetResourceFieldMethod; + dispIdMap[jsom.GetProjectField.id]=did.dispidGetProjectFieldMethod; + dispIdMap[jsom.GetSelectedView.id]=did.dispidGetSelectedViewMethod; + jsom=Microsoft.Office.WebExtension.EventType; + did=OSF.DDA.EventDispId; + dispIdMap[jsom.SettingsChanged]=did.dispidSettingsChangedEvent; + dispIdMap[jsom.DocumentSelectionChanged]=did.dispidDocumentSelectionChangedEvent; + dispIdMap[jsom.BindingSelectionChanged]=did.dispidBindingSelectionChangedEvent; + dispIdMap[jsom.BindingDataChanged]=did.dispidBindingDataChangedEvent; + dispIdMap[jsom.ActiveViewChanged]=did.dispidActiveViewChangedEvent; + dispIdMap[jsom.DocumentThemeChanged]=did.dispidDocumentThemeChangedEvent; + dispIdMap[jsom.OfficeThemeChanged]=did.dispidOfficeThemeChangedEvent; + dispIdMap[jsom.TaskSelectionChanged]=did.dispidTaskSelectionChangedEvent; + dispIdMap[jsom.ResourceSelectionChanged]=did.dispidResourceSelectionChangedEvent; + dispIdMap[jsom.ViewSelectionChanged]=did.dispidViewSelectionChangedEvent; + dispIdMap[jsom.DataNodeInserted]=did.dispidDataNodeAddedEvent; + dispIdMap[jsom.DataNodeReplaced]=did.dispidDataNodeReplacedEvent; + dispIdMap[jsom.DataNodeDeleted]=did.dispidDataNodeDeletedEvent; + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if(typeof ex=="number") { + if(!callArgs) { + callArgs=asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + }; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, theCaller, privateState) { + var callArgs; + try { + var methodName=method.id; + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, theCaller, privateState); + var dispId=dispIdMap[methodName]; + var delegate=getDelegateMethods(methodName); + var hostCallArgs; + if(parameterMap.toHost) { + hostCallArgs=parameterMap.toHost(dispId, callArgs); + } + else { + hostCallArgs=callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }, + "onComplete": function(status, hostResponseArgs) { + var responseArgs; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if(parameterMap.fromHost) { + responseArgs=parameterMap.fromHost(dispId, hostResponseArgs); + } + else { + responseArgs=hostResponseArgs; + } + } + else { + responseArgs=hostResponseArgs; + } + var payload=asyncMethodCall.processResponse(status, responseArgs, theCaller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } + catch(ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, theCaller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added=eventDispatch.addEventHandler(eventType, handler); + if(!added) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, theCaller, eventDispatch); + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if(eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": theCaller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args=parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, theCaller, args)); + } + }); + } + else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } + catch(ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, theCaller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, theCaller, eventDispatch); + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status; + if(handler==null) { + eventDispatch.clearEventHandlers(eventType); + status=true; + } + else { + if(!eventDispatch.hasEventHandler(eventType, handler)) { + status=false; + } + else { + status=eventDispatch.removeEventHandler(eventType, handler); + } + } + if(eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": theCaller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }, + "onComplete": onEnsureRegistration + }); + } + else { + onEnsureRegistration(status ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : Strings.OfficeOM.L_EventRegistrationError); + } + } + catch(ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + }; + OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for(var entry in asyncMethodNames) { + var method=asyncMethodNames[entry]; + var name=method.displayName; + if(!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: + (function(asyncMethod) { + return function() { + var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } + }; + OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if(!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function() { + var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if(!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function() { + var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } + }; + OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if(license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if(appOM) { + var displayName=appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); + }; + OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM); + if(settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } + }; + OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context=OSF._OfficeAppFactory.getContext(); + } + return context; + } + }); + Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if(useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } + }; + Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if(str && typeof str=="string") { + var index=str.indexOf("#"); + if(index !=-1) { + var op=str.substring(0, index); + var target=str.substring(index+1); + switch(op) { + case "binding": + case "bindings": + if(target) { + promise=new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if(!promise) { + if(errorCallback) { + var callbackType=typeof errorCallback; + if(callbackType=="function") { + var callArgs={}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback; + OSF.DDA.issueAsyncResult( + callArgs, + OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, + OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext) + ); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail=errorCallback; + return promise; + } + }; + OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id=bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function() { + return errorCallback; + }, + set: function(onError) { + var t=typeof onError; + if(t !="undefined" && t !="function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback=onError; + } + }); + }; + OSF.DDA.BindingPromise.prototype={ + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if(this.binding) { + if(onComplete) + onComplete(this.binding); + } else { + if(!this._binding) { + var me=this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function(asyncResult) { + if(asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if(onComplete) + onComplete(me.binding); + } else { + if(me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { binding.getDataAsync.apply(binding, args); }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { binding.setDataAsync.apply(binding, args); }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { binding.addHandlerAsync.apply(binding, args); }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { binding.removeHandlerAsync.apply(binding, args); }); + return this; + }, + setTableOptionsAsync: function OSF_DDA_BindingPromise$setTableOptionsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { binding.setTableOptionsAsync.apply(binding, args); }); + return this; + }, + setFormatsAsync: function OSF_DDA_BindingPromise$setFormatsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { binding.setFormatsAsync.apply(binding, args); }); + return this; + }, + clearFormatsAsync: function OSF_DDA_BindingPromise$clearFormatsAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { binding.clearFormatsAsync.apply(binding, args); }); + return this; + } + }; + OSF.DDA.License=function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); + }; + OSF.DDA.Settings=function OSF_DDA_Settings(settings) { + settings=settings || {}; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) throw e; + var setting=settings[name]; + return typeof(setting)==='undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) throw e; + settings[name]=value; + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) throw e; + delete settings[name]; + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [OSF.DDA.AsyncMethodNames.SaveAsync], + settings + ); + }; + OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, + [OSF.DDA.AsyncMethodNames.RefreshAsync], + settings + ); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); + }; + OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); + OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) {}; + OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch(officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly; break; + case OSF.ClientMode.ReadWrite: mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite; break; + }; + if(settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + }; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); + }; + OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { return bindingFacade; } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); + }; + OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches=[]; + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); + }; + OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); + }; + OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + var et=Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches=docInstance.bindings._eventDispatches; + if(!bindingEventDispatches[id]) { + bindingEventDispatches[id]=new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch=bindingEventDispatches[id]; + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); + }; + OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) { + OSF.DDA.TextBinding.uber.constructor.call( + this, + id, + docInstance + ); + OSF.OUtil.defineEnumerableProperty(this, "type", { + value: Microsoft.Office.WebExtension.BindingType.Text + }); + }; + OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding); + OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) { + OSF.DDA.MatrixBinding.uber.constructor.call( + this, + id, + docInstance + ); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Matrix + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols: 0 + } + }); + }; + OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding); + OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call( + this, + id, + docInstance + ); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols: 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); + }; + OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); + Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if(data==null || data==undefined) { + return null; + } + try { + for(var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data=[data]; + } + return data; + } + catch(ex) { + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function() { return headers; }, + set: function(value) { + headers=fixData(value); + } + }, + "rows": { + get: function() { return rows; }, + set: function(value) { + rows=( value==null || ( OSF.OUtil.isArray(value) && ( value.length==0 ) ) ) ? + [] : + fixData(value); + } + } + }); + this.headers=headers; + this.rows=rows; + }; + Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); + }; + OSF.DDA.Error=function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); + }; + OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if(initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if(errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error( + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] + ) + }); + } + }; + OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); + }; + OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged + }, + "binding": { + value: bindingInstance + } + }); + for(var prop in subset) { + OSF.OUtil.defineEnumerableProperty(this, prop, { + value: subset[prop] + }); + } + }; + OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingDataChanged + }, + "binding": { + value: bindingInstance + } + }); + }; + OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); + }; + OSF.DDA.OfficeThemeChangedEventArgs=function OSF_DDA_OfficeThemeChangedEventArgs(officeTheme) { + var ret=OSF.DDA.ConvertToOfficeTheme(officeTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.Internal.EventType.OfficeThemeChanged + }, + "officeTheme": { + value: ret + } + }); + }; + OSF.DDA.DocumentThemeChangedEventArgs=function OSF_DDA_DocumentThemeChangedEventArgs(documentTheme) { + var ret=OSF.DDA.ConvertToDocumentTheme(documentTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.Internal.EventType.DocumentThemeChanged + }, + "documentTheme": { + value: ret + } + }); + }; + OSF.DDA.ActiveViewChangedEventArgs=function OSF_DDA_ActiveViewChangedEventArgs(activeView) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ActiveViewChanged + }, + "activeView": { + value: activeView.activeView + } + }); + }; +OSF.O15HostSpecificFileVersion={ + GetFallbackVersion : function(appName){ + var fallback="15.01"; + var appFallbackTable={ + "8" : "15.03", + "16" : "15.02" + }; + var appFallback=appFallbackTable[appName]; + if(appFallback) { + return appFallback; + } else { + return fallback; + } + }, + GenerateVersion : function(majorVersion, apiSetVersion) { + var partWidth=2; + return zeroPad(majorVersion, partWidth)+"."+zeroPad(apiSetVersion, partWidth); + function zeroPad(number, width) { + number=number || 0; + width=width || 0; + var paddedString=number.toString(); + var numberOfZeroes=width - paddedString.length; + for (var i=0; i < numberOfZeroes; i++) { + paddedString="0"+paddedString; + } + return paddedString; + }; + } +}; +var OfficeExt; +(function (OfficeExt) { + var MicrosoftAjaxFactory=(function () { + function MicrosoftAjaxFactory() { + } + MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function () { + if (typeof (Sys) !=='undefined' && typeof (Type) !=='undefined' && Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" && Type.registerNamespace && typeof (Type.registerNamespace)==="function" && Type.registerClass && typeof (Type.registerClass)==="function" && typeof (Function._validateParams)==="function") { + return true; + } else { + return false; + } + }; + MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OSF.OUtil.loadScript(msAjaxCDNPath, callback); + }; + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", { + get: function () { + if (this._msAjaxError==null && this.isMsAjaxLoaded()) { + this._msAjaxError=Error; + } + return this._msAjaxError; + }, + set: function (errorClass) { + this._msAjaxError=errorClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", { + get: function () { + if (this._msAjaxSerializer==null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer; + } + return this._msAjaxSerializer; + }, + set: function (serializerClass) { + this._msAjaxSerializer=serializerClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", { + get: function () { + if (this._msAjaxString==null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer=String; + } + return this._msAjaxString; + }, + set: function (stringClass) { + this._msAjaxString=stringClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", { + get: function () { + if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) { + this._msAjaxDebug=Sys.Debug; + } + return this._msAjaxDebug; + }, + set: function (debugClass) { + this._msAjaxDebug=debugClass; + }, + enumerable: true, + configurable: true + }); + return MicrosoftAjaxFactory; + })(); + OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory; +})(OfficeExt || (OfficeExt={})); +var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory(); +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} +var __extends=this.__extends || function (d, b) { + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var OSFLog; +(function (OSFLog) { + var BaseUsageData=(function () { + function BaseUsageData(table) { + this._table=table; + this._fields={}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields=function () { + }; + BaseUsageData.prototype.SetSerializedField=function (key, value) { + if (typeof (value) !=="undefined" && value !==null) { + this._serializedFields[key]=value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow=function () { + this._serializedFields={}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData=BaseUsageData; + var AppActivatedUsageData=(function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"]=value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData=AppActivatedUsageData; + var ScriptLoadUsageData=(function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData=ScriptLoadUsageData; + var AppClosedUsageData=(function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"]=value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData=AppClosedUsageData; + var APIUsageUsageData=(function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"]=value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData=APIUsageUsageData; +})(OSFLog || (OSFLog={})); +var Logger; +(function (Logger) { + "use strict"; + (function (TraceLevel) { + TraceLevel[TraceLevel["info"]=0]="info"; + TraceLevel[TraceLevel["warning"]=1]="warning"; + TraceLevel[TraceLevel["error"]=2]="error"; + })(Logger.TraceLevel || (Logger.TraceLevel={})); + var TraceLevel=Logger.TraceLevel; + (function (SendFlag) { + SendFlag[SendFlag["none"]=0]="none"; + SendFlag[SendFlag["flush"]=1]="flush"; + })(Logger.SendFlag || (Logger.SendFlag={})); + var SendFlag=Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData=allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs=JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog=sendLog; + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + var ULSEndpointProxy=(function () { + function ULSEndpointProxy() { + var _this=this; + this.proxyFrame=null; + this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer=[]; + this.proxyFrameReady=false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } + ULSEndpointProxy.prototype.writeLog=function (log) { + if (this.proxyFrameReady===true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame=function () { + if (this.proxyFrame==null) { + this.proxyFrame=document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) { + var _this=this; + if (e.data==="ProxyFrameReadyToLog") { + this.proxyFrameReady=true; + for (var i=0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + this.buffer.length=0; + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data==="ProxyFrameReadyToInit") { + var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr=JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + if (!OSF.Logger) { + OSF.Logger=Logger; + } + Logger.ulsEndpoint=creatULSEndpoint(); +})(Logger || (Logger={})); +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId=OSF.OUtil.Guid.generateNewGuid(); + ; + var AppInfo=(function () { + function AppInfo() { + } + return AppInfo; + })(); + var Event=(function () { + function Event(name, handler) { + this.name=name; + this.handler=handler; + } + return Event; + })(); + var AppStorage=(function () { + function AppStorage() { + this.clientIDKey="Office API client"; + this.logIdSetKey="Office App Log Id Set"; + } + AppStorage.prototype.getClientId=function () { + var clientId=this.getValue(this.clientIDKey); + if (!clientId || clientId.length <=0 || clientId.length > 40) { + clientId=OSF.OUtil.Guid.generateNewGuid(); + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + AppStorage.prototype.saveLog=function (logId, log) { + var logIdSet=this.getValue(this.logIdSetKey); + logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + AppStorage.prototype.enumerateLog=function (callback, clean) { + var logIdSet=this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids=logIdSet.split(";"); + for (var id in ids) { + var logId=ids[id]; + var log=this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + var value=""; + if (osfLocalStorage) { + value=osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue=function (key, value) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + var AppLogger=(function () { + function AppLogger() { + } + AppLogger.prototype.LogData=function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData=function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo=new AppInfo(); + appInfo.hostVersion=context.get_appVersion(); + appInfo.appId=context.get_id(); + appInfo.host=context.get_appName(); + appInfo.browser=window.navigator.userAgent; + appInfo.correlationId=context.get_correlationId(); + appInfo.clientId=(new AppStorage()).getClientId(); + var index=location.href.indexOf("?"); + appInfo.appURL=(index==-1) ? location.href : location.href.substring(0, index); + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId=""; + appInfo.userId=""; + try { + xmlContent=decodeURIComponent(token); + parser=new DOMParser(); + xmlDoc=parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent=null; + xmlDoc=null; + parser=null; + } + })(context.get_eToken(), appInfo); + (function handleLifecycle() { + var startTime=new Date(); + var lastFocus=null; + var focusTime=0; + var finished=false; + var adjustFocusTime=function () { + if (document.hasFocus()) { + if (lastFocus==null) { + lastFocus=new Date(); + } + } else if (lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + }; + var eventList=[]; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction=function () { + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length=0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished=true; + } + }; + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize=initialize; + function onAppActivated() { + if (!appInfo) { + return; + } + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data=new OSFLog.AppActivatedUsageData(); + data.SessionId=sessionId; + data.AppId=appInfo.appId; + data.AssetId=appInfo.assetId; + data.AppURL=appInfo.appURL; + data.UserId=appInfo.userId; + data.ClientId=appInfo.clientId; + data.Browser=appInfo.browser; + data.Host=appInfo.host; + data.HostVersion=appInfo.hostVersion; + data.CorrelationId=appInfo.correlationId; + data.AppSizeWidth=window.innerWidth; + data.AppSizeHeight=window.innerHeight; + (new AppLogger()).LogData(data); + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated=onAppActivated; + function onScriptDone(scriptId, msStartTime, msResponseTime) { + var data=new OSFLog.ScriptLoadUsageData(); + data.SessionId=sessionId; + data.ScriptId=scriptId; + data.StartTime=msStartTime; + data.ResponseTime=msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone=onScriptDone; + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data=new OSFLog.APIUsageUsageData(); + data.SessionId=sessionId; + data.APIType=apiType; + data.APIID=id; + data.Parameters=parameters; + data.ResponseTime=msResponseTime; + data.ErrorType=errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone=onCallDone; + ; + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters=null; + if (args) { + if (typeof args=="number") { + parameters=String(args); + } else if (typeof args==="object") { + for (var index in args) { + if (parameters !==null) { + parameters+=","; + } else { + parameters=""; + } + if (typeof args[index]=="number") { + parameters+=String(args[index]); + } + } + } else { + parameters=""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone=onMethodDone; + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone=onPropertyDone; + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone=onEventDone; + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone=onRegisterDone; + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data=new OSFLog.AppClosedUsageData(); + data.SessionId=sessionId; + data.FocusTime=focusTime; + data.OpenTime=openTime; + data.AppSizeFinalWidth=window.innerWidth; + data.AppSizeFinalHeight=window.innerHeight; + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed=onAppClosed; + OSF.AppTelemetry=OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry={})); +OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo=hostInfo; + this._webAppState=webAppState; + this._context=context; + this._settings=settings; + this._hostFacade=hostFacade; +}; +OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + if (this._hostInfo.isRichClient) { + var returnedContext; + var context=window.external.GetContext(); + var appType=context.GetAppType(); + var appTypeSupported=false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry]==appType) { + appTypeSupported=true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type "+appType; + } + var id=context.GetSolutionRef(); + var apiSetVersion; + if (typeof context.GetApiSetVersion !=="undefined") { + apiSetVersion=context.GetApiSetVersion(); + } + var version=OSF.O15HostSpecificFileVersion.GenerateVersion( + context.GetAppVersionMajor(), + apiSetVersion + ); + var minorVersion=context.GetAppVersionMinor(); + var UILocale=context.GetAppUILocale(); + var dataLocale=context.GetAppDataLocale(); + var docUrl=context.GetDocUrl(); + var clientMode=context.GetAppCapabilities(); + var reason=context.GetActivationMode(); + var osfControlType=context.GetControlIntegrationLevel(); + var settings=[]; + var eToken; + try { + eToken=context.GetSolutionToken(); + } catch (ex) { + } + var correlationId; + if (typeof context.GetCorrelationId !=="undefined") { + correlationId=context.GetCorrelationId(); + } + var requirementMatrix; + if (typeof context.GetSupportedMatrix !=="undefined") { + requirementMatrix=context.GetSupportedMatrix(); + } + eToken=eToken ? eToken.toString() : ""; + returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, 0, 0, 0, minorVersion, requirementMatrix); + gotAppContext(returnedContext); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + } else { + var getInvocationCallbackWebApp=function OSF__OfficeAppFactory_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) { + var settings; + if (appContext._appName===OSF.AppName.ExcelWebApp) { + var serializedSettings=appContext._settings; + settings={}; + for (var index in serializedSettings) { + var setting=serializedSettings[index]; + settings[setting[0]]=setting[1]; + } + } + else { + settings=appContext._settings; + } + if (errorCode===0 && appContext._id !=undefined && appContext._appName !=undefined && appContext._appVersion !=undefined && appContext._appUILocale !=undefined && appContext._dataLocale !=undefined && + appContext._docUrl !=undefined && appContext._clientMode !=undefined && appContext._settings !=undefined && appContext._reason !=undefined) { + var minorVersion=0; + if (appContext._appMinorVersion !=undefined) { + minorVersion=appContext._appMinorVersion; + } + var requirementMatrix=undefined; + if (appContext._requirementMatrix !=undefined) { + requirementMatrix=appContext._requirementMatrix; + } + var returnedContext=new OSF.OfficeAppContext(appContext._id, appContext._appName, appContext._appVersion, appContext._appUILocale, appContext._dataLocale, appContext._docUrl, appContext._clientMode, settings, appContext._reason, appContext._osfControlType, appContext._eToken, appContext._correlationId, 0, 0, 0, minorVersion, requirementMatrix); + gotAppContext(returnedContext); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + } else { + throw "Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+errorCode; + } + }; + this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync", getInvocationCallbackWebApp, this._webAppState.id); + } +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() { + var me=this; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(); + if (xdmInfoValue) { + me._hostInfo.isRichClient=false; + var xdmItems=xdmInfoValue.split('|'); + if (xdmItems !=undefined && xdmItems.length===3) { + me._webAppState.conversationID=xdmItems[0]; + me._webAppState.id=xdmItems[1]; + me._webAppState.webAppUrl=xdmItems[2]; + } + } else { + me._hostInfo.isRichClient=true; + } + if (!me._hostInfo.isRichClient) { + me._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID, me._webAppState.wnd, me._webAppState.webAppUrl); + me._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id); + var notificationConversationId=me._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix; + me._webAppState.serviceEndPoint.registerConversation(notificationConversationId); + var notifyAgave=function OSF_InitializationHelper_setAgaveHostCommunication$notifyAgave(actionId) { + switch (actionId) { + case OSF.AgaveHostAction.Select: + me._webAppState.focused=true; + window.focus(); + break; + case OSF.AgaveHostAction.UnSelect: + me._webAppState.focused=false; + break; + default: + OsfMsAjaxFactory.msAjaxDebug.trace("actionId "+actionId+" notifyAgave is wrong."); + break; + } + } + me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave", + notifyAgave, + Microsoft.Office.Common.InvokeType.async, + false); + window.onfocus=function () { + if (!me._webAppState.focused) { + me._webAppState.focused=true; + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.Select]); + } + } + window.onblur=function () { + if (me._webAppState.focused) { + me._webAppState.focused=false; + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.UnSelect]); + } + } + } +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + var license=new OSF.DDA.License(appContext.get_eToken()); + var proxy=window.open; + window.open=function (strUrl, strWindowName, strWindowFeatures) { + var windowObject=null; + try { + windowObject=proxy(strUrl, strWindowName, strWindowFeatures); + } + catch (ex) { + } + if (!windowObject) { + var params={ + "strUrl": strUrl, + "strWindowName": strWindowName, + "strWindowFeatures": strWindowFeatures + }; + OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost", null, params); + } + return windowObject; + }; + if (appContext.get_appName()==OSF.AppName.OutlookWebApp || appContext.get_appName()==OSF.AppName.Outlook) { + OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext, this._settings, license, appContext.appOM)); + Microsoft.Office.WebExtension.initialize(); + } + else if (appContext.get_osfControlType()===OSF.OsfControlType.DocumentLevel || appContext.get_osfControlType()===OSF.OsfControlType.ContainerLevel) { + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license)); + var getDelegateMethods, parameterMap; + var reason=appContext.get_reason(); + if (this._hostInfo.isRichClient) { + getDelegateMethods=OSF.DDA.DispIdHost.getRichClientDelegateMethods; + parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap; + reason=OSF.DDA.RichInitializationReason[reason]; + } else { + getDelegateMethods=OSF.DDA.DispIdHost.getXLSDelegateMethods; + parameterMap=OSF.DDA.XLS.Delegate.ParameterMap; + } + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); + Microsoft.Office.WebExtension.initialize(reason); + } + else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_OsfControlTypeNotSupported); + } +}; +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + var suffix; + suffix=".debug.js"; + var _appToScriptTable={ + "1-15.00" : "excel-15"+suffix, + "1-15.01" : "excel-15.01"+suffix, + "2-15.00" : "word-15"+suffix, + "2-15.01" : "word-15.01"+suffix, + "4-15.00" : "powerpoint-15"+suffix, + "4-15.01" : "powerpoint-15.01"+suffix, + "8-15.00" : "outlook-15"+suffix, + "8-15.01" : "outlook-15.01"+suffix, + "8-15.02" : "outlook-15.02"+suffix, + "8-15.03" : "outlook-15.03"+suffix, + "16-15" : "excelwebapp-15"+suffix, + "16-15.01" : "excelwebapp-15.01"+suffix, + "16-15.02" : "excelwebapp-15.02"+suffix, + "64-15" : "outlookwebapp-15"+suffix, + "64-15.01" : "outlookwebapp-15.01"+suffix, + "128-15.00" : "project-15"+suffix, + "128-15.01" : "project-15.01"+suffix + }; + var checkScriptOverride=function OSF$checkScriptOverride() { + var postScriptOverrideCheckAction=function OSF$postScriptOverrideCheckAction(customizedScriptPath) { + if(customizedScriptPath) { + OSF.OUtil.loadScript(customizedScriptPath, function() { + OsfMsAjaxFactory.msAjaxDebug.trace("loaded customized script:"+customizedScriptPath); + }); + } + }; + var clientEndPoint=OSF._OfficeAppFactory.getClientEndPoint(); + var customizedScriptPath=null; + if(!clientEndPoint) { + try{ + if (typeof window.external.getCustomizedScriptPath !=='undefined') { + customizedScriptPath=window.external.getCustomizedScriptPath(); + } + } catch(ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("no script override through window.external."); + } + postScriptOverrideCheckAction(customizedScriptPath); + } else { + try{ + clientEndPoint.invoke("getCustomizedScriptPathAsync", + function OSF$getCustomizedScriptPathAsyncCallback(errorCode, scriptPath) { + postScriptOverrideCheckAction( errorCode===0 ? scriptPath : null); + }, + {__timeout__ : 1000}); + } catch(ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("no script override through cross frame communication."); + } + } + }; + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + var me=this; + function initializeSettings(refreshSupported) { + var settings; + var serializedSettings; + if (me._hostInfo.isRichClient) { + serializedSettings=OSF.DDA.RichClientSettingsManager.read(); + } else { + serializedSettings=appContext.get_settings(); + } + var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings=new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings=new OSF.DDA.Settings(deserializedSettings); + } + return settings; + } + var versionToBeLoaded=appContext.get_appVersion(); + var fallbackversion=OSF.O15HostSpecificFileVersion.GetFallbackVersion(appContext.get_appName()); + if (versionToBeLoaded > fallbackversion) { + versionToBeLoaded=fallbackversion; + } + var scriptPath=basePath+_appToScriptTable[appContext.get_appName()+"-"+versionToBeLoaded]; + var loadScriptSafe=function(scriptPath, fileId, callback) { + if (OSF._OfficeAppFactory.getLoadScriptHelper) { + OSF._OfficeAppFactory.getLoadScriptHelper().loadScript(scriptPath, fileId, callback); + } else { + OSF.OUtil.loadScript(scriptPath, callback); + } + }; + if (appContext.get_appName()==OSF.AppName.Excel) { + var excelScriptLoaded=function () { + appContext.doc=new OSF.DDA.ExcelDocument(appContext, initializeSettings(false)); + appReady(); + }; + loadScriptSafe(scriptPath, OSF.ConstantNames.HostFileId, excelScriptLoaded); + } else if (appContext.get_appName()==OSF.AppName.ExcelWebApp) { + var excelWebAppScriptLoaded=function () { + appContext.doc=new OSF.DDA.ExcelWebAppDocument(appContext, initializeSettings(true)); + appReady(); + }; + loadScriptSafe(scriptPath, OSF.ConstantNames.HostFileId, excelWebAppScriptLoaded); + } else if (appContext.get_appName()==OSF.AppName.Word) { + var wordScriptLoaded=function () { + appContext.doc=new OSF.DDA.WordDocument(appContext, initializeSettings(false)); + appReady(); + }; + loadScriptSafe(scriptPath, OSF.ConstantNames.HostFileId, wordScriptLoaded); + } else if (appContext.get_appName()==OSF.AppName.PowerPoint) { + var powerPointScriptLoaded=function () { + appContext.doc=new OSF.DDA.PowerPointDocument(appContext, initializeSettings(false)); + appReady(); + }; + loadScriptSafe(scriptPath, OSF.ConstantNames.HostFileId, powerPointScriptLoaded); + } else if (appContext.get_appName()==OSF.AppName.OutlookWebApp || appContext.get_appName()==OSF.AppName.Outlook) { + var outlookScriptLoaded=function () { + me._settings=initializeSettings(false); + appContext.appOM=new OSF.DDA.OutlookAppOm(appContext, me._webAppState.wnd, appReady); + }; + var loadOutlookScript=function() { + loadScriptSafe(scriptPath, OSF.ConstantNames.HostFileId, outlookScriptLoaded); + }; + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + OsfMsAjaxFactory.loadMsAjaxFull(loadOutlookScript); + } else { + loadOutlookScript(); + } + checkScriptOverride(); + } else if (appContext.get_appName()==OSF.AppName.Project) { + var projScriptLoaded=function () { + appContext.doc=new OSF.DDA.ProjectDocument(appContext); + appReady(); + }; + loadScriptSafe(scriptPath, OSF.ConstantNames.HostFileId, projScriptLoaded); + } else { + throw OSF.OUtil.formatString(stringNS.L_AppNotExistInitializeNotCalled, appContext.get_appName()); + } +}; + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/o15apptofilemappingtable.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/o15apptofilemappingtable.js new file mode 100644 index 000000000..c75b8e054 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/o15apptofilemappingtable.js @@ -0,0 +1,11 @@ +/* Excel specific API library */ +/* Version: 15.0.4767.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var OSF=OSF||{};OSF.OUtil=function(){var e="on",g="configurable",f="writable",d="enumerable",c=true,b=null,a=false,j=-1,m="&_xdm_Info=",l="_xdm_",h="#",i={},o=3e4,k=a;function n(){return Math.floor(100000001*Math.random()).toString()}return {extend:function(b,a){var c=function(){};c.prototype=a.prototype;b.prototype=new c;b.prototype.constructor=b;b.uber=a.prototype;if(a.prototype.constructor===Object.prototype.constructor)a.prototype.constructor=a},setNamespace:function(b,a){if(a&&b&&!a[b])a[b]={}},unsetNamespace:function(b,a){if(a&&b&&a[b])delete a[b]},loadScript:function(f,g,h){if(f&&g){var l=window.document,d=i[f];if(!d){var e=l.createElement("script");e.type="text/javascript";d={loaded:a,pendingCallbacks:[g],timer:b};i[f]=d;var j=function(){if(d.timer!=b){clearTimeout(d.timer);delete d.timer}d.loaded=c;for(var e=d.pendingCallbacks.length,a=0;a1?d[d.length-1]:b;if(window.sessionStorage){var c=window.name.indexOf(l);if(c>-1){var e=window.name.indexOf(";",c);if(e==-1)e=window.name.length;var f=window.name.substring(c,e);if(a)window.sessionStorage.setItem(f,a);else a=window.sessionStorage.getItem(f)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[f,d,g])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[f,d,g])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>2;a[1]=(f&3)<<4|d>>4;a[2]=(d&15)<<2|e>>6;a[3]=e&63;if(isNaN(d))a[2]=a[3]=64;else if(isNaN(e))a[3]=64;for(var g=0;g<4;g++)h.push(j.charAt(a[g]))}while(b0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(o,k,g,f,i,l,h,j,n,d,m,e,q,r,p,c,b){var a=this;a._id=o;a._appName=k;a._appVersion=g;a._appUILocale=f;a._dataLocale=i;a._docUrl=l;a._clientMode=h;a._settings=j;a._reason=n;a._osfControlType=d;a._eToken=m;a._correlationId=e;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementMatrix=function(){return this._requirementMatrix}};OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);OSF.OUtil.setNamespace("Internal",Microsoft.Office);OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ActiveView={Read:"read",Edit:"edit"};Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.BindingType={Text:"text",Matrix:"matrix",Table:"table"};Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"};Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"};Microsoft.Office.WebExtension.EventType={DocumentSelectionChanged:"documentSelectionChanged",BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"};Microsoft.Office.Internal.EventType={OfficeThemeChanged:"officeThemeChanged",DocumentThemeChanged:"documentThemeChanged"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Id:"id",GoToType:"goToType",SelectionMode:"selectionMode",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions"};Microsoft.Office.Internal.Parameters={DocumentTheme:"documentTheme",OfficeTheme:"officeTheme"};Microsoft.Office.WebExtension.DefaultParameterValues={};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.OUtil.setNamespace("DispIdHost",OSF.DDA);OSF.DDA.DispIdHost.Methods={InvokeMethod:"invokeMethod",AddEventHandler:"addEventHandler",RemoveEventHandler:"removeEventHandler"};OSF.DDA.DispIdHost.Delegates={ExecuteAsync:"executeAsync",RegisterEventAsync:"registerEventAsync",UnregisterEventAsync:"unregisterEventAsync",ParameterMap:"parameterMap"};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus",FileProperties:"FileProperties",FilePropertiesDescriptor:"FilePropertiesDescriptor",FileSliceProperties:"FileSliceProperties",Subset:"subset",BindingProperties:"BindingProperties",TableDataProperties:"TableDataProperties",DataPartProperties:"DataPartProperties",DataNodeProperties:"DataNodeProperties"};OSF.DDA.EventDescriptors={BindingSelectionChangedEvent:"BindingSelectionChangedEvent",DataNodeInsertedEvent:"DataNodeInsertedEvent",DataNodeReplacedEvent:"DataNodeReplacedEvent",DataNodeDeletedEvent:"DataNodeDeletedEvent",OfficeThemeChangedEvent:"OfficeThemeChangedEvent",DocumentThemeChangedEvent:"DocumentThemeChangedEvent",ActiveViewChangedEvent:"ActiveViewChangedEvent"};OSF.DDA.ListDescriptors={BindingList:"BindingList",DataPartList:"DataPartList",DataNodeList:"DataNodeList"};OSF.DDA.FileProperties={Handle:"FileHandle",FileSize:"FileSize",SliceSize:Microsoft.Office.WebExtension.Parameters.SliceSize};OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType,RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"};OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.DDA.DataPartProperties={Id:Microsoft.Office.WebExtension.Parameters.Id,BuiltIn:"DataPartBuiltIn"};OSF.DDA.DataNodeProperties={Handle:"DataNodeHandle",BaseName:"DataNodeBaseName",NamespaceUri:"DataNodeNamespaceUri",NodeType:"DataNodeType"};OSF.DDA.DataNodeEventProperties={OldNode:"OldNode",NewNode:"NewNode",NextSiblingNode:"NextSiblingNode",InUndoRedo:"InUndoRedo"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(a){(function(c){var a=1.1,e=function(){function a(a){this.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this._setMap,d=e._sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};this._setMap=a}return a}();c.RequirementMatrix=e;var b=function(){function a(a){this._sets=a}return a}();c.DefaultSetRequirement=b;var d=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=d;var n=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookClientDefaultSetRequirement=n;var k=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.2})}return a}(b);c.OutlookClientV1DefaultSetRequirement=k;var l=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientV2DefaultSetRequirement=l;var m=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.4})}return a}(b);c.OutlookClientV3DefaultSetRequirement=m;var h=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordClientDefaultSetRequirement=h;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordClientV1DefaultSetRequirement=p;var f=function(c){__extends(b,c);function b(){c.call(this,{compressedfile:a,documentevents:a,file:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientV1DefaultSetRequirement=j;var g=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=g;var i=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=i;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebV2DefaultSetRequirement=q;var r=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookWebDefaultSetRequirement=r;var o=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebV1DefaultSetRequirement=o;var s=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(d){this.initializeDefaultSetMatrix();var c=undefined;if(d.get_requirementMatrix()!=undefined&&typeof JSON!=="undefined"){var h=JSON.parse(d.get_requirementMatrix());c=new e(new b(h))}else{var g=d.get_appVersion(),f=d.get_appName()+"-"+g;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[f]!=undefined)c=new e(a.DefaultSetArrayMatrix[f]);else c=new e(new b({}))}return c};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1500]=new d;a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1501]=new d;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1500]=new h;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1501]=new p;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1500]=new f;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1500]=new j;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1500]=new n;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1501]=new k;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1502]=new l;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1503]=new m;a.DefaultSetArrayMatrix[a.Excel_WAC_1500]=new i;a.DefaultSetArrayMatrix[a.Excel_WAC_1501]=new i;a.DefaultSetArrayMatrix[a.Excel_WAC_1502]=new q;a.DefaultSetArrayMatrix[a.Outlook_WAC_1500]=new r;a.DefaultSetArrayMatrix[a.Outlook_WAC_1501]=new o;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1500]=new g;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1500]=new g;a.DefaultSetArrayMatrix[a.Excel_IOS_1500]=new d;a.DefaultSetArrayMatrix[a.Word_IOS_1500]=new h;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1500]=new f};a.Excel_RCLIENT_1500="1-15.00";a.Excel_RCLIENT_1501="1-15.01";a.Word_RCLIENT_1500="2-15.00";a.Word_RCLIENT_1501="2-15.01";a.PowerPoint_RCLIENT_1500="4-15.00";a.PowerPoint_RCLIENT_1501="4-15.01";a.Outlook_RCLIENT_1500="8-15.00";a.Outlook_RCLIENT_1501="8-15.01";a.Outlook_RCLIENT_1502="8-15.02";a.Outlook_RCLIENT_1503="8-15.03";a.Excel_WAC_1500="16-15.00";a.Excel_WAC_1501="16-15.01";a.Excel_WAC_1502="16-15.02";a.Outlook_WAC_1500="64-15.00";a.Outlook_WAC_1501="64-15.01";a.Project_RCLIENT_1500="128-15.00";a.Project_RCLIENT_1500="128-15.01";a.Excel_IOS_1500="1024-15.00";a.Word_IOS_1500="4096-15.00";a.PowerPoint_IOS_1500="8192-15.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=s})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange}}}}();OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Common",Microsoft.Office);Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5};Microsoft.Office.Common.InvokeResultCode={noError:0,errorInRequest:-1,errorHandlingRequest:-2,errorInResponse:-3,errorHandlingResponse:-4,errorHandlingRequestAccessDenied:-5,errorHandlingMethodCallTimedout:-6};Microsoft.Office.Common.MessageType={request:0,response:1};Microsoft.Office.Common.ActionType={invoke:0,registerEvent:1,unregisterEvent:2};Microsoft.Office.Common.ResponseType={forCalling:0,forEventing:1};Microsoft.Office.Common.MethodObject=function(c,b,a){this._method=c;this._invokeType=b;this._blockingOthers=a};Microsoft.Office.Common.MethodObject.prototype={getMethod:function(){return this._method},getInvokeType:function(){return this._invokeType},getBlockingFlag:function(){return this._blockingOthers}};Microsoft.Office.Common.EventMethodObject=function(b,a){this._registerMethodObject=b;this._unregisterMethodObject=a};Microsoft.Office.Common.EventMethodObject.prototype={getRegisterMethodObject:function(){return this._registerMethodObject},getUnregisterMethodObject:function(){return this._unregisterMethodObject}};Microsoft.Office.Common.ServiceEndPoint=function(c){var a=this,b=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:false}]);if(b)throw b;a._methodObjectList={};a._eventHandlerProxyList={};a._Id=c;a._conversations={};a._policyManager=null};Microsoft.Office.Common.ServiceEndPoint.prototype={registerMethod:function(g,h,b,e){var c="invokeType",a=false,d=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:a},{name:"method",type:Function,mayBeNull:a},{name:c,type:Number,mayBeNull:a},{name:"blockingOthers",type:Boolean,mayBeNull:a}]);if(d)throw d;if(b!==Microsoft.Office.Common.InvokeType.async&&b!==Microsoft.Office.Common.InvokeType.sync)throw OsfMsAjaxFactory.msAjaxError.argument(c);var f=new Microsoft.Office.Common.MethodObject(h,b,e);this._methodObjectList[g]=f},unregisterMethod:function(b){var a=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:false}]);if(a)throw a;delete this._methodObjectList[b]},registerEvent:function(f,d,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a}]);if(b)throw b;var e=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(d,Microsoft.Office.Common.InvokeType.syncRegisterEvent,a),new Microsoft.Office.Common.MethodObject(c,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,a));this._methodObjectList[f]=e},registerEventEx:function(h,f,d,e,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"registerMethodInvokeType",type:Number,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a},{name:"unregisterMethodInvokeType",type:Number,mayBeNull:a}]);if(b)throw b;var g=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(f,d,a),new Microsoft.Office.Common.MethodObject(e,c,a));this._methodObjectList[h]=g},unregisterEvent:function(b){var a=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:false}]);if(a)throw a;this.unregisterMethod(b)},registerConversation:function(b){var a=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false}]);if(a)throw a;this._conversations[b]=true},unregisterConversation:function(b){var a=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false}]);if(a)throw a;delete this._conversations[b]},setPolicyManager:function(a){var b="policyManager",c=Function._validateParams(arguments,[{name:b,type:Object,mayBeNull:false}]);if(c)throw c;if(!a.checkPermission)throw OsfMsAjaxFactory.msAjaxError.argument(b);this._policyManager=a},getPolicyManager:function(){return this._policyManager}};Microsoft.Office.Common.ClientEndPoint=function(e,b,f){var c="targetWindow",a=this,d=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false},{name:c,mayBeNull:false},{name:"targetUrl",type:String,mayBeNull:false}]);if(d)throw d;if(!b.postMessage)throw OsfMsAjaxFactory.msAjaxError.argument(c);a._conversationId=e;a._targetWindow=b;a._targetUrl=f;a._callingIndex=0;a._callbackList={};a._eventHandlerList={}};Microsoft.Office.Common.ClientEndPoint.prototype={invoke:function(h,d,b){var a=this,g=Function._validateParams(arguments,[{name:"targetMethodName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"param",mayBeNull:true}]);if(g)throw g;var c=a._callingIndex++,k=new Date,e={callback:d,createdOn:k.getTime()};if(b&&typeof b==="object"&&typeof b.__timeout__==="number"){e.timeout=b.__timeout__;delete b.__timeout__}a._callbackList[c]=e;try{var i=new Microsoft.Office.Common.Request(h,Microsoft.Office.Common.ActionType.invoke,a._conversationId,c,b),j=Microsoft.Office.Common.MessagePackager.envelope(i);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(f){try{d!==null&&d(Microsoft.Office.Common.InvokeResultCode.errorInRequest,f)}finally{delete a._callbackList[c]}}},registerForEvent:function(d,g,c,i){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"eventHandler",type:Function,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,k=new Date;a._callbackList[b]={callback:c,createdOn:k.getTime()};try{var h=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.registerEvent,a._conversationId,b,i),j=Microsoft.Office.Common.MessagePackager.envelope(h);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();a._eventHandlerList[d]=g}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}},unregisterForEvent:function(d,c,h){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,j=new Date;a._callbackList[b]={callback:c,createdOn:j.getTime()};try{var g=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.unregisterEvent,a._conversationId,b,h),i=Microsoft.Office.Common.MessagePackager.envelope(g);a._targetWindow.postMessage(i,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}finally{delete a._eventHandlerList[d]}}};Microsoft.Office.Common.XdmCommunicationManager=function(){var i="channel is not ready.",c="conversationId",h="Unknown conversation Id.",b=false,a=null,k=[],e=a,v=10,j=b,f=a,o=2e3,l=6e4,g={},d={},m=b;function p(b){for(var a in g)if(g[a]._conversations[b])return g[a];OsfMsAjaxFactory.msAjaxDebug.trace(h);throw OsfMsAjaxFactory.msAjaxError.argument(c)}function q(b){var a=d[b];if(!a){OsfMsAjaxFactory.msAjaxDebug.trace(h);throw OsfMsAjaxFactory.msAjaxError.argument(c)}return a}function t(e,c){var b=e._methodObjectList[c._actionName];if(!b){OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+c._actionName);throw OsfMsAjaxFactory.msAjaxError.argument("messageObject")}var d=a;if(c._actionType===Microsoft.Office.Common.ActionType.invoke)d=b;else if(c._actionType===Microsoft.Office.Common.ActionType.registerEvent)d=b.getRegisterMethodObject();else d=b.getUnregisterMethodObject();return d}function x(a){k.push(a)}function w(){if(e!==a){if(!j)if(k.length>0){var b=k.shift();j=b.getInvokeBlockingFlag();b.invoke()}else{clearInterval(e);e=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(i)}function s(){if(f){var c,e=0,k=new Date,h;for(var j in d){c=d[j];for(var g in c._callbackList){var b=c._callbackList[g];h=b.timeout?b.timeout:l;if(Math.abs(k.getTime()-b.createdOn)>=h)try{b.callback&&b.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,a)}finally{delete c._callbackList[g]}else e++}}if(e===0){clearInterval(f);f=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(i)}function r(){j=b}function u(a){if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&window.attachEvent)window.attachEvent("onmessage",a);else if(window.addEventListener)window.addEventListener("message",a,b);else{OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API.");throw OsfMsAjaxFactory.msAjaxError.argument("Browser")}}function y(c){var d="Access Denied";if(c.data!=""){var b;try{b=Microsoft.Office.Common.MessagePackager.unenvelope(c.data)}catch(f){return}if(typeof b._messageType=="undefined")return;if(b._messageType===Microsoft.Office.Common.MessageType.request){var l=c.origin==a||c.origin=="null"?b._origin:c.origin;try{var g=p(b._conversationId),k=g.getPolicyManager();if(k&&!k.checkPermission(b._conversationId,b._actionName,b._data))throw d;var u=t(g,b),n=new Microsoft.Office.Common.InvokeCompleteCallback(c.source,l,b._actionName,b._conversationId,b._correlationId,r),y=new Microsoft.Office.Common.Invoker(u,b._data,n,g._eventHandlerProxyList,b._conversationId,b._actionName);if(e==a)e=setInterval(w,v);x(y)}catch(f){var m=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;if(f==d)m=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied;var s=new Microsoft.Office.Common.Response(b._actionName,b._conversationId,b._correlationId,m,Microsoft.Office.Common.ResponseType.forCalling,f),o=Microsoft.Office.Common.MessagePackager.envelope(s);c.source&&c.source.postMessage&&c.source.postMessage(o,l)}}else if(b._messageType===Microsoft.Office.Common.MessageType.response){var h=q(b._conversationId);if(b._responseType===Microsoft.Office.Common.ResponseType.forCalling){var i=h._callbackList[b._correlationId];if(i)try{i.callback&&i.callback(b._errorCode,b._data)}finally{delete h._callbackList[b._correlationId]}}else{var j=h._eventHandlerList[b._actionName];j!==undefined&&j!==a&&j(b._data)}}else return}}function n(){if(!m){u(y);m=true}}return {connect:function(b,c,e){var a=d[b];if(!a){n();a=new Microsoft.Office.Common.ClientEndPoint(b,c,e);d[b]=a}return a},getClientEndPoint:function(e){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;return d[e]},createServiceEndPoint:function(a){n();var b=new Microsoft.Office.Common.ServiceEndPoint(a);g[a]=b;return b},getServiceEndPoint:function(c){var a=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:b}]);if(a)throw a;return g[c]},deleteClientEndPoint:function(e){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;delete d[e]},_setMethodTimeout:function(a){var c=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:b}]);if(c)throw c;l=a<=0?6e4:a},_startMethodTimeoutTimer:function(){if(!f)f=setInterval(s,o)}}}();Microsoft.Office.Common.Message=function(g,h,e,f,c){var b=false,a=this,d=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:b},{name:"actionName",type:String,mayBeNull:b},{name:"conversationId",type:String,mayBeNull:b},{name:"correlationId",mayBeNull:b},{name:"data",mayBeNull:true,optional:true}]);if(d)throw d;a._messageType=g;a._actionName=h;a._conversationId=e;a._correlationId=f;a._origin=window.location.href;if(typeof c=="undefined")a._data=null;else a._data=c};Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}};Microsoft.Office.Common.Request=function(c,d,a,b,e){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,c,a,b,e);this._actionType=d};OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message);Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType};Microsoft.Office.Common.Response=function(d,a,b,e,c,f){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,d,a,b,f);this._errorCode=e;this._responseType=c};OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message);Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode};Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType};Microsoft.Office.Common.MessagePackager={envelope:function(a){return OsfMsAjaxFactory.msAjaxSerializer.serialize(a)},unenvelope:function(a){return OsfMsAjaxFactory.msAjaxSerializer.deserialize(a,true)}};Microsoft.Office.Common.ResponseSender=function(e,h,j,f,g,i){var c=false,a=this,d=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:c},{name:"requesterUrl",type:String,mayBeNull:c},{name:"actionName",type:String,mayBeNull:c},{name:"conversationId",type:String,mayBeNull:c},{name:"correlationId",mayBeNull:c},{name:"responsetype",type:Number,maybeNull:c}]);if(d)throw d;a._requesterWindow=e;a._requesterUrl=h;a._actionName=j;a._conversationId=f;a._correlationId=g;a._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;a._responseType=i;var b=a;a._send=function(d){var c=new Microsoft.Office.Common.Response(b._actionName,b._conversationId,b._correlationId,b._invokeResultCode,b._responseType,d),a=Microsoft.Office.Common.MessagePackager.envelope(c);b._requesterWindow.postMessage(a,b._requesterUrl)}};Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(a){this._invokeResultCode=a}};Microsoft.Office.Common.InvokeCompleteCallback=function(d,g,h,e,f,c){var b=this;Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(b,d,g,h,e,f,Microsoft.Office.Common.ResponseType.forCalling);b._postCallbackHandler=c;var a=b;b._send=function(d){var c=new Microsoft.Office.Common.Response(a._actionName,a._conversationId,a._correlationId,a._invokeResultCode,a._responseType,d),b=Microsoft.Office.Common.MessagePackager.envelope(c);a._requesterWindow.postMessage(b,a._requesterUrl);a._postCallbackHandler()}};OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender);Microsoft.Office.Common.Invoker=function(g,h,d,e,f,i){var b=false,a=this,c=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:b},{name:"paramValue",mayBeNull:true},{name:"invokeCompleteCallback",mayBeNull:b},{name:"eventHandlerProxyList",mayBeNull:true},{name:"conversationId",type:String,mayBeNull:b},{name:"eventName",type:String,mayBeNull:b}]);if(c)throw c;a._methodObject=g;a._param=h;a._invokeCompleteCallback=d;a._eventHandlerProxyList=e;a._conversationId=f;a._eventName=i};Microsoft.Office.Common.Invoker.prototype={invoke:function(){var a=this;try{var b;switch(a._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:a._methodObject.getMethod()(a._param,a._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:b=a._methodObject.getMethod()(a._param);a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent:var d=a._createEventHandlerProxyObject(a._invokeCompleteCallback);b=a._methodObject.getMethod()(d.getSend(),a._param);a._eventHandlerProxyList[a._conversationId+a._eventName]=d.getSend();a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:var g=a._eventHandlerProxyList[a._conversationId+a._eventName];b=a._methodObject.getMethod()(g,a._param);delete a._eventHandlerProxyList[a._conversationId+a._eventName];a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:var c=a._createEventHandlerProxyObject(a._invokeCompleteCallback);a._methodObject.getMethod()(c.getSend(),a._invokeCompleteCallback.getSend(),a._param);a._eventHandlerProxyList[a._callerId+a._eventName]=c.getSend();break;case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:var f=a._eventHandlerProxyList[a._callerId+a._eventName];a._methodObject.getMethod()(f,a._invokeCompleteCallback.getSend(),a._param);delete a._eventHandlerProxyList[a._callerId+a._eventName]}}catch(e){a._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);a._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(a){return new Microsoft.Office.Common.ResponseSender(a.getRequesterWindow(),a.getRequesterUrl(),a.getActionName(),a.getConversationId(),a.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing)}};OSF.EventDispatch=function(a){this._eventHandlers={};for(var c in a){var b=a[c];this._eventHandlers[b]=[]}};OSF.EventDispatch.prototype={getSupportedEvents:function(){var a=[];for(var b in this._eventHandlers)a.push(b);return a},supportsEvent:function(c){var a=false;for(var b in this._eventHandlers)if(c==b){a=true;break}return a},hasEventHandler:function(b,c){var a=this._eventHandlers[b];if(a&&a.length>0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.OMFactory={manufactureBinding:function(a,c){var d=a[OSF.DDA.BindingProperties.Id],g=a[OSF.DDA.BindingProperties.RowCount],f=a[OSF.DDA.BindingProperties.ColumnCount],h=a[OSF.DDA.BindingProperties.HasHeaders],b;switch(a[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:b=new OSF.DDA.TextBinding(d,c);break;case Microsoft.Office.WebExtension.BindingType.Matrix:b=new OSF.DDA.MatrixBinding(d,c,g,f);break;case Microsoft.Office.WebExtension.BindingType.Table:var i=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument},e;if(i()&&OSF.DDA.ExcelTableBinding)e=OSF.DDA.ExcelTableBinding;else e=OSF.DDA.TableBinding;b=new e(d,c,g,f,h);break;default:b=new OSF.DDA.UnknownBinding(d,c)}return b},manufactureTableData:function(a){return new Microsoft.Office.WebExtension.TableData(a[OSF.DDA.TableDataProperties.TableRows],a[OSF.DDA.TableDataProperties.TableHeaders])},manufactureDataNode:function(a){if(a)return new OSF.DDA.CustomXmlNode(a[OSF.DDA.DataNodeProperties.Handle],a[OSF.DDA.DataNodeProperties.NodeType],a[OSF.DDA.DataNodeProperties.NamespaceUri],a[OSF.DDA.DataNodeProperties.BaseName])},manufactureDataPart:function(a,b){return new OSF.DDA.CustomXmlPart(b,a[OSF.DDA.DataPartProperties.Id],a[OSF.DDA.DataPartProperties.BuiltIn])},manufactureEventArgs:function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.Internal.EventType.OfficeThemeChanged:b=new OSF.DDA.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.Internal.EventType.DocumentThemeChanged:b=new OSF.DDA.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b}};OSF.DDA.ListType=function(){var a={};a[OSF.DDA.ListDescriptors.BindingList]=OSF.DDA.PropertyDescriptors.BindingProperties;a[OSF.DDA.ListDescriptors.DataPartList]=OSF.DDA.PropertyDescriptors.DataPartProperties;a[OSF.DDA.ListDescriptors.DataNodeList]=OSF.DDA.PropertyDescriptors.DataNodeProperties;return {isListType:function(b){return OSF.OUtil.listContainsKey(a,b)},getDescriptor:function(b){return a[b]}}}();OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,l,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!=undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,d,e){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,d,e);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.ConvertToDocumentTheme=function(f){var b=false,a=true;for(var d=[{name:"primaryFontColor",needToConvertToHex:a},{name:"primaryBackgroundColor",needToConvertToHex:a},{name:"secondaryFontColor",needToConvertToHex:a},{name:"secondaryBackgroundColor",needToConvertToHex:a},{name:"accent1",needToConvertToHex:a},{name:"accent2",needToConvertToHex:a},{name:"accent3",needToConvertToHex:a},{name:"accent4",needToConvertToHex:a},{name:"accent5",needToConvertToHex:a},{name:"accent6",needToConvertToHex:a},{name:"hyperlink",needToConvertToHex:a},{name:"followedHyperlink",needToConvertToHex:a},{name:"headerLatinFont",needToConvertToHex:b},{name:"headerEastAsianFont",needToConvertToHex:b},{name:"headerScriptFont",needToConvertToHex:b},{name:"headerLocalizedFont",needToConvertToHex:b},{name:"bodyLatinFont",needToConvertToHex:b},{name:"bodyEastAsianFont",needToConvertToHex:b},{name:"bodyScriptFont",needToConvertToHex:b},{name:"bodyLocalizedFont",needToConvertToHex:b}],e={},c=0;c=d.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;a[OSF.DDA.FileSliceOffset]=parseInt(b*c[OSF.DDA.FileProperties.SliceSize]);return a},onSucceeded:function(a,d,c){var b={};OSF.OUtil.defineEnumerableProperties(b,{data:{value:a[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:c[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:a[OSF.DDA.FileProperties.SliceSize]}});return b}});a({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}}]});a({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}}],privateStateCallbacks:[],onSucceeded:h});a({method:OSF.DDA.AsyncMethodNames.AddFromPromptAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:{types:[b],calculate:function(){return Strings.OfficeOM.L_AddBindingFromPromptDefaultText}}}],privateStateCallbacks:[],onSucceeded:h});a({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return true}}],onSucceeded:h});a({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.BindingList],h)}});a({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:h});a({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(d,a,b){var c=b[Microsoft.Office.WebExtension.Parameters.Id];delete a._eventDispatches[c]}});a({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(b,a){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(a.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[c],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[c],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[c],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[c],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&a[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&a[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn];delete a[Microsoft.Office.WebExtension.Parameters.RowCount];delete a[Microsoft.Office.WebExtension.Parameters.ColumnCount]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]||a[Microsoft.Office.WebExtension.Parameters.RowCount]||a[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}],onSucceeded:f});a({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[b,e,c,g]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[c],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[c],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:[e],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:[e],defaultValue:[]}}],checkCallArgs:function(a,c){var b=Microsoft.Office.WebExtension.Parameters;if(a[b.StartRow]==0&&a[b.StartColumn]==0&&OSF.OUtil.isArray(a[b.CellFormat])&&a[b.CellFormat].length===0&&OSF.OUtil.isArray(a[b.TableOptions])&&a[b.TableOptions].length===0){delete a[b.StartRow];delete a[b.StartColumn];delete a[b.CellFormat];delete a[b.TableOptions]}if(a[b.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(c.type)&&(a[b.StartRow]&&a[b.StartRow]!=0||a[b.StartColumn]&&a[b.StartColumn]!=0||a[b.CellFormat]||a[b.TableOptions]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[e]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[e]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.ClearFormatsAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TableOptions,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.SetFormatsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CellFormat,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});a({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:[g],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});a({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:[n]}],supportedOptions:[],privateStateCallbacks:[]});a({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:[n],defaultValue:null}}],privateStateCallbacks:[]});a({method:OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:OSF.DDA.ConvertToDocumentTheme});a({method:OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:OSF.DDA.ConvertToOfficeTheme});a({method:OSF.DDA.AsyncMethodNames.GetActiveViewAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(b){var a=b[Microsoft.Office.WebExtension.Parameters.ActiveView];return a==undefined?null:a}});a({method:OSF.DDA.AsyncMethodNames.AddDataPartAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Xml,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:j});a({method:OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:j});a({method:OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.DataPartList],j)}});a({method:OSF.DDA.AsyncMethodNames.DeleteDataPartAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:d}]});a({method:OSF.DDA.AsyncMethodNames.GetPartNodesAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.XPath,types:[b]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:d}],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.DataNodeList],m)}});a({method:OSF.DDA.AsyncMethodNames.GetPartXmlAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:d}],onSucceeded:f});a({method:OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Prefix,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:[b]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:k}]});a({method:OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Prefix,types:[b]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:k}],onSucceeded:f});a({method:OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:[b]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:k}],onSucceeded:f});a({method:OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.XPath,types:[b]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.DataNodeList],m)}});a({method:OSF.DDA.AsyncMethodNames.GetNodeValueAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}],onSucceeded:f});a({method:OSF.DDA.AsyncMethodNames.GetNodeXmlAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}],onSucceeded:f});a({method:OSF.DDA.AsyncMethodNames.SetNodeValueAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[b]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}]});a({method:OSF.DDA.AsyncMethodNames.SetNodeXmlAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Xml,types:[b]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}]});a({method:OSF.DDA.AsyncMethodNames.GetSelectedTask,onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.TaskId]}});a({method:OSF.DDA.AsyncMethodNames.GetTask,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,types:[b]}]});a({method:OSF.DDA.AsyncMethodNames.GetTaskField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:[c]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:{types:[g],defaultValue:false}}]});a({method:OSF.DDA.AsyncMethodNames.GetResourceField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ResourceId,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:[c]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:{types:[g],defaultValue:false}}]});a({method:OSF.DDA.AsyncMethodNames.GetProjectField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:[c]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:{types:[g],defaultValue:false}}]});a({method:OSF.DDA.AsyncMethodNames.GetSelectedResource,onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.ResourceId]}});a({method:OSF.DDA.AsyncMethodNames.GetWSSUrl});a({method:OSF.DDA.AsyncMethodNames.GetSelectedView});return l}();OSF.DDA.HostParameterMap=function(a,b){var i="fromHost",c=this,j="toHost",h=i,e="self",g={};g[Microsoft.Office.WebExtension.Parameters.Data]={toHost:function(a){if(a.rows!==undefined){var b={};b[OSF.DDA.TableDataProperties.TableRows]=a.rows;b[OSF.DDA.TableDataProperties.TableHeaders]=a.headers;a=b}return a},fromHost:function(a){return a}};function d(j,i){var m=j?{}:undefined;for(var f in j){var e=j[f],c;if(OSF.DDA.ListType.isListType(f)){c=[];for(var n in e)c.push(d(e[n],i))}else if(OSF.OUtil.listContainsKey(g,f))c=g[f][i](e);else if(i==h&&a.preserveNesting(f))c=d(e,i);else{var k=b[f];if(k){var l=k[i];if(l){c=l[e];if(c===undefined)c=e}}else c=e}m[f]=c}return m}function k(i,h){var f;for(var c in h){var d;if(a.isComplexType(c))d=k(i,b[c][j]);else d=i[c];if(d!=undefined){if(!f)f={};var g=h[c];if(g==e)g=c;f[g]=a.pack(c,d)}}return f}function f(k,j,g){if(!g)g={};for(var d in j){var l=j[d],c;if(l==e)c=k;else c=k[l];if(c===null||c===undefined)g[d]=undefined;else{c=a.unpack(d,c);var i;if(a.isComplexType(d)){i=b[d][h];if(a.preserveNesting(d))g[d]=f(c,i);else f(c,i,g)}else{if(OSF.DDA.ListType.isListType(d)){i={};var n=OSF.DDA.ListType.getDescriptor(d);i[n]=e;for(var m in c)c[m]=f(c[m],i)}g[d]=c}}}return g}function l(l,g,a){var e=b[l][a],c;if(a=="toHost"){var j=d(g,a);c=k(j,e)}else if(a==i){var h=f(g,e);c=d(h,a)}return c}if(!b)b={};c.setMapping=function(k,c){var a,d;if(c.map){a=c.map;d={};for(var f in a){var g=a[f];if(g==e)g=f;d[g]=f}}else{a=c.toHost;d=c.fromHost}var i=b[k]={};i[j]=a;i[h]=d};c.toHost=function(b,a){return l(b,a,j)};c.fromHost=function(a,b){return l(a,b,h)};c.self=e;c.dynamicTypes=g;c.mapValues=d;c.specialProcessorDynamicTypes=a.dynamicTypes};OSF.DDA.SpecialProcessor=function(c,b){var a=this;a.isComplexType=function(a){return OSF.OUtil.listContainsValue(c,a)};a.isDynamicType=function(a){return OSF.OUtil.listContainsKey(b,a)};a.preserveNesting=function(b){var a=[OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode];return OSF.OUtil.listContainsValue(a,b)};a.pack=function(c,d){var a;if(this.isDynamicType(c))a=b[c].toHost(d);else a=d;return a};a.unpack=function(c,d){var a;if(this.isDynamicType(c))a=b[c].fromHost(d);else a=d;return a}};OSF.DDA.DispIdHost.Facade=function(e,d){var a={},b=OSF.DDA.AsyncMethodNames,c=OSF.DDA.MethodDispId;a[b.GoToByIdAsync.id]=c.dispidNavigateToMethod;a[b.GetSelectedDataAsync.id]=c.dispidGetSelectedDataMethod;a[b.SetSelectedDataAsync.id]=c.dispidSetSelectedDataMethod;a[b.GetDocumentCopyChunkAsync.id]=c.dispidGetDocumentCopyChunkMethod;a[b.ReleaseDocumentCopyAsync.id]=c.dispidReleaseDocumentCopyMethod;a[b.GetDocumentCopyAsync.id]=c.dispidGetDocumentCopyMethod;a[b.AddFromSelectionAsync.id]=c.dispidAddBindingFromSelectionMethod;a[b.AddFromPromptAsync.id]=c.dispidAddBindingFromPromptMethod;a[b.AddFromNamedItemAsync.id]=c.dispidAddBindingFromNamedItemMethod;a[b.GetAllAsync.id]=c.dispidGetAllBindingsMethod;a[b.GetByIdAsync.id]=c.dispidGetBindingMethod;a[b.ReleaseByIdAsync.id]=c.dispidReleaseBindingMethod;a[b.GetDataAsync.id]=c.dispidGetBindingDataMethod;a[b.SetDataAsync.id]=c.dispidSetBindingDataMethod;a[b.GetFilePropertiesAsync.id]=c.dispidGetFilePropertiesMethod;a[b.AddRowsAsync.id]=c.dispidAddRowsMethod;a[b.AddColumnsAsync.id]=c.dispidAddColumnsMethod;a[b.DeleteAllDataValuesAsync.id]=c.dispidClearAllRowsMethod;a[b.ClearFormatsAsync.id]=c.dispidClearFormatsMethod;a[b.RefreshAsync.id]=c.dispidLoadSettingsMethod;a[b.SaveAsync.id]=c.dispidSaveSettingsMethod;a[b.SetTableOptionsAsync.id]=c.dispidSetTableOptionsMethod;a[b.SetFormatsAsync.id]=c.dispidSetFormatsMethod;a[b.GetActiveViewAsync.id]=c.dispidGetActiveViewMethod;a[b.AddDataPartAsync.id]=c.dispidAddDataPartMethod;a[b.GetDataPartByIdAsync.id]=c.dispidGetDataPartByIdMethod;a[b.GetDataPartsByNameSpaceAsync.id]=c.dispidGetDataPartsByNamespaceMethod;a[b.GetPartXmlAsync.id]=c.dispidGetDataPartXmlMethod;a[b.GetPartNodesAsync.id]=c.dispidGetDataPartNodesMethod;a[b.DeleteDataPartAsync.id]=c.dispidDeleteDataPartMethod;a[b.GetNodeValueAsync.id]=c.dispidGetDataNodeValueMethod;a[b.GetNodeXmlAsync.id]=c.dispidGetDataNodeXmlMethod;a[b.GetRelativeNodesAsync.id]=c.dispidGetDataNodesMethod;a[b.SetNodeValueAsync.id]=c.dispidSetDataNodeValueMethod;a[b.SetNodeXmlAsync.id]=c.dispidSetDataNodeXmlMethod;a[b.AddDataPartNamespaceAsync.id]=c.dispidAddDataNamespaceMethod;a[b.GetDataPartNamespaceAsync.id]=c.dispidGetDataUriByPrefixMethod;a[b.GetDataPartPrefixAsync.id]=c.dispidGetDataPrefixByUriMethod;a[b.GetDocumentThemeAsync.id]=c.dispidGetDocumentThemeMethod;a[b.GetOfficeThemeAsync.id]=c.dispidGetOfficeThemeMethod;a[b.GetSelectedTask.id]=c.dispidGetSelectedTaskMethod;a[b.GetTask.id]=c.dispidGetTaskMethod;a[b.GetWSSUrl.id]=c.dispidGetWSSUrlMethod;a[b.GetTaskField.id]=c.dispidGetTaskFieldMethod;a[b.GetSelectedResource.id]=c.dispidGetSelectedResourceMethod;a[b.GetResourceField.id]=c.dispidGetResourceFieldMethod;a[b.GetProjectField.id]=c.dispidGetProjectFieldMethod;a[b.GetSelectedView.id]=c.dispidGetSelectedViewMethod;b=Microsoft.Office.WebExtension.EventType;c=OSF.DDA.EventDispId;a[b.SettingsChanged]=c.dispidSettingsChangedEvent;a[b.DocumentSelectionChanged]=c.dispidDocumentSelectionChangedEvent;a[b.BindingSelectionChanged]=c.dispidBindingSelectionChangedEvent;a[b.BindingDataChanged]=c.dispidBindingDataChangedEvent;a[b.ActiveViewChanged]=c.dispidActiveViewChangedEvent;a[b.DocumentThemeChanged]=c.dispidDocumentThemeChangedEvent;a[b.OfficeThemeChanged]=c.dispidOfficeThemeChangedEvent;a[b.TaskSelectionChanged]=c.dispidTaskSelectionChangedEvent;a[b.ResourceSelectionChanged]=c.dispidResourceSelectionChangedEvent;a[b.ViewSelectionChanged]=c.dispidViewSelectionChangedEvent;a[b.DataNodeInserted]=c.dispidDataNodeAddedEvent;a[b.DataNodeReplaced]=c.dispidDataNodeReplacedEvent;a[b.DataNodeDeleted]=c.dispidDataNodeDeletedEvent;function f(a,c,d,b){if(typeof a=="number"){if(!b)b=c.getCallArgs(d);OSF.DDA.issueAsyncResult(b,a,OSF.DDA.ErrorCodeManager.getErrorArgs(a))}else throw a}this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function(o,j,k,m){var b;try{var h=o.id,c=OSF.DDA.AsyncMethodCalls[h];b=c.verifyAndExtractCall(j,k,m);var i=a[h],n=e(h),g;if(d.toHost)g=d.toHost(i,b);else g=b;n[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({dispId:i,hostCallArgs:g,onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)},onComplete:function(f,e){var a;if(f==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(d.fromHost)a=d.fromHost(i,e);else a=e;else a=e;var g=c.processResponse(f,a,k,b);OSF.DDA.issueAsyncResult(b,f,g)}})}catch(l){f(l,c,j,b)}};this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function(j,g,h){var c,b,l;function i(a){if(a==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){var e=g.addEventHandler(b,l);if(!e)a=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed}var d;if(a!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)d=OSF.DDA.ErrorCodeManager.getErrorArgs(a);OSF.DDA.issueAsyncResult(c,a,d)}try{var k=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];c=k.verifyAndExtractCall(j,h,g);b=c[Microsoft.Office.WebExtension.Parameters.EventType];l=c[Microsoft.Office.WebExtension.Parameters.Handler];if(g.getEventHandlerCount(b)==0){var m=a[b],o=e(b)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];o({eventType:b,dispId:m,targetId:h.id||"",onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)},onComplete:i,onEvent:function(a){var c=d.fromHost(m,a);g.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(b,h,c))}})}else i(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)}catch(n){f(n,k,j,c)}};this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function(j,c,l){var d,b,g;function i(a){var b;if(a!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)b=OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist);OSF.DDA.issueAsyncResult(d,a,b)}try{var k=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];d=k.verifyAndExtractCall(j,l,c);b=d[Microsoft.Office.WebExtension.Parameters.EventType];g=d[Microsoft.Office.WebExtension.Parameters.Handler];var h;if(g==null){c.clearEventHandlers(b);h=true}else if(!c.hasEventHandler(b,g))h=false;else h=c.removeEventHandler(b,g);if(c.getEventHandlerCount(b)==0){var o=a[b],n=e(b)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];n({eventType:b,dispId:o,targetId:l.id||"",onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)},onComplete:i})}else i(h?OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess:Strings.OfficeOM.L_EventRegistrationError)}catch(m){f(m,k,j,d)}}};OSF.DDA.DispIdHost.addAsyncMethods=function(a,b,e){for(var f in b){var c=b[f],d=c.displayName;!a[d]&&OSF.OUtil.defineEnumerableProperty(a,d,{value:function(b){return function(){var c=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];c(b,arguments,a,e)}}(c)})}};OSF.DDA.DispIdHost.addEventSupport=function(a,b){var d=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName,c=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;!a[d]&&OSF.OUtil.defineEnumerableProperty(a,d,{value:function(){var c=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];c(arguments,b,a)}});!a[c]&&OSF.OUtil.defineEnumerableProperty(a,c,{value:function(){var c=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];c(arguments,b,a)}})};OSF.DDA.Context=function(c,d,e,b){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:c.get_dataLocale()},displayLanguage:{value:c.get_appUILocale()}});d&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:d});e&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:e});if(b){var g=b.displayName||"appOM";delete b.displayName;OSF.OUtil.defineEnumerableProperty(a,g,{value:b})}var f=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(c);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:f})};OSF.DDA.OutlookContext=function(b,a,c,d){OSF.DDA.OutlookContext.uber.constructor.call(this,b,null,c,d);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.BindingPromise=function(b,a){this._id=b;OSF.OUtil.defineEnumerableProperty(this,"onFail",{"get":function(){return a},"set":function(c){var b=typeof c;if(b!="undefined"&&b!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,b);a=c}})};OSF.DDA.BindingPromise.prototype={_fetch:function(b){var a=this;if(a.binding)b&&b(a.binding);else if(!a._binding){var c=a;Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(a._id,function(a){if(a.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded){OSF.OUtil.defineEnumerableProperty(c,"binding",{value:a.value});b&&b(c.binding)}else c.onFail&&c.onFail(a)})}return a},getDataAsync:function(){var a=arguments;this._fetch(function(b){b.getDataAsync.apply(b,a)});return this},setDataAsync:function(){var a=arguments;this._fetch(function(b){b.setDataAsync.apply(b,a)});return this},addHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.addHandlerAsync.apply(b,a)});return this},removeHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.removeHandlerAsync.apply(b,a)});return this},setTableOptionsAsync:function(){var a=arguments;this._fetch(function(b){b.setTableOptionsAsync.apply(b,a)});return this},setFormatsAsync:function(){var a=arguments;this._fetch(function(b){b.setFormatsAsync.apply(b,a)});return this},clearFormatsAsync:function(){var a=arguments;this._fetch(function(b){b.clearFormatsAsync.apply(b,a)});return this}};OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.DDA.Settings=function(b){var a="name";b=b||{};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:a,type:String,mayBeNull:false}]);if(d)throw d;var c=b[e];return typeof c==="undefined"?null:c}},"set":{value:function(e,d){var c=Function._validateParams(arguments,[{name:a,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(c)throw c;b[e]=d}},remove:{value:function(d){var c=Function._validateParams(arguments,[{name:a,type:String,mayBeNull:false}]);if(c)throw c;delete b[d]}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],b)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(c,d,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,c,e);OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return d}});var b=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[b.GetSelectedDataAsync,b.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.DDA.BindingFacade=function(b){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:b});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddFromSelectionAsync,a.AddFromNamedItemAsync,a.GetAllAsync,a.GetByIdAsync,a.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{document:{value:a},id:{value:b}})};OSF.DDA.Binding=function(a,c){OSF.OUtil.defineEnumerableProperties(this,{document:{value:c},id:{value:a}});var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDataAsync,d.SetDataAsync]);var e=Microsoft.Office.WebExtension.EventType,b=c.bindings._eventDispatches;if(!b[a])b[a]=new OSF.EventDispatch([e.BindingSelectionChanged,e.BindingDataChanged]);var f=b[a];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.TextBinding=function(b,a){OSF.DDA.TextBinding.uber.constructor.call(this,b,a);OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})};OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding);OSF.DDA.MatrixBinding=function(d,c,b,a){OSF.DDA.MatrixBinding.uber.constructor.call(this,d,c);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:b?b:0},columnCount:{value:a?a:0}})};OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding);OSF.DDA.TableBinding=function(f,e,d,c,b){OSF.DDA.TableBinding.uber.constructor.call(this,f,e);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:d?d:0},columnCount:{value:c?c:0},hasHeaders:{value:b?b:false}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddRowsAsync,a.AddColumnsAsync,a.DeleteAllDataValuesAsync])};OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding);Microsoft.Office.WebExtension.TableData=function(b,a){function c(a){if(a==null||a==undefined)return null;try{for(var b=OSF.DDA.DataCoercion.findArrayDimensionality(a,2);b<2;b++)a=[a];return a}catch(c){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{"get":function(){return a},"set":function(b){a=c(b)}},rows:{"get":function(){return b},"set":function(a){b=a==null||OSF.OUtil.isArray(a)&&a.length==0?[]:c(a)}}});this.headers=a;this.rows=b};Microsoft.Office.WebExtension.FileProperties=function(a){OSF.OUtil.defineEnumerableProperties(this,{url:{value:a[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.Error=function(c,a,b){OSF.OUtil.defineEnumerableProperties(this,{name:{value:c},message:{value:a},code:{value:b}})};OSF.DDA.AsyncResult=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{value:{value:b[OSF.DDA.AsyncResultEnum.Properties.Value]},status:{value:a?Microsoft.Office.WebExtension.AsyncResultStatus.Failed:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded}});b[OSF.DDA.AsyncResultEnum.Properties.Context]&&OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value:b[OSF.DDA.AsyncResultEnum.Properties.Context]});a&&OSF.OUtil.defineEnumerableProperty(this,"error",{value:new OSF.DDA.Error(a[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],a[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],a[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])})};OSF.DDA.DocumentSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:a}})};OSF.DDA.BindingSelectionChangedEventArgs=function(c,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:c}});for(var b in a)OSF.OUtil.defineEnumerableProperty(this,b,{value:a[b]})};OSF.DDA.BindingDataChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:a}})};OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.OfficeThemeChangedEventArgs=function(a){var b=OSF.DDA.ConvertToOfficeTheme(a);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.Internal.EventType.OfficeThemeChanged},officeTheme:{value:b}})};OSF.DDA.DocumentThemeChangedEventArgs=function(a){var b=OSF.DDA.ConvertToDocumentTheme(a);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.Internal.EventType.DocumentThemeChanged},documentTheme:{value:b}})};OSF.DDA.ActiveViewChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.ActiveViewChanged},activeView:{value:a.activeView}})};OSF.O15HostSpecificFileVersion={GetFallbackVersion:function(d){var c="15.01",b={"8":"15.03","16":"15.02"},a=b[d];if(a)return a;else return c},GenerateVersion:function(d,c){var a=2;return b(d,a)+"."+b(c,a);function b(b,c){b=b||0;c=c||0;for(var a=b.toString(),e=c-a.length,d=0;d40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function o(e){if(!OSF.Logger)return;if(b)return;b=new q;b.hostVersion=e.get_appVersion();b.appId=e.get_id();b.host=e.get_appName();b.browser=window.navigator.userAgent;b.correlationId=e.get_correlationId();b.clientId=(new g).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(e.get_eToken(),b);(function(){var k=new Date,e=a,h=0,j=false,f=function(){if(document.hasFocus()){if(e==a)e=new Date}else if(e){h+=Math.abs((new Date).getTime()-e.getTime());e=a}},b=[];b.push(new d("focus",f));b.push(new d("blur",f));b.push(new d("focusout",f));b.push(new d("focusin",f));var i=function(){for(var d=0;dk)h=k;var e=t+q[a.get_appName()+"-"+h],d=function(a,c,b){if(OSF._OfficeAppFactory.getLoadScriptHelper)OSF._OfficeAppFactory.getLoadScriptHelper().loadScript(a,c,b);else OSF.OUtil.loadScript(a,b)};if(a.get_appName()==OSF.AppName.Excel){var p=function(){a.doc=new OSF.DDA.ExcelDocument(a,g(c));f()};d(e,OSF.ConstantNames.HostFileId,p)}else if(a.get_appName()==OSF.AppName.ExcelWebApp){var l=function(){a.doc=new OSF.DDA.ExcelWebAppDocument(a,g(true));f()};d(e,OSF.ConstantNames.HostFileId,l)}else if(a.get_appName()==OSF.AppName.Word){var s=function(){a.doc=new OSF.DDA.WordDocument(a,g(c));f()};d(e,OSF.ConstantNames.HostFileId,s)}else if(a.get_appName()==OSF.AppName.PowerPoint){var m=function(){a.doc=new OSF.DDA.PowerPointDocument(a,g(c));f()};d(e,OSF.ConstantNames.HostFileId,m)}else if(a.get_appName()==OSF.AppName.OutlookWebApp||a.get_appName()==OSF.AppName.Outlook){var o=function(){i._settings=g(c);a.appOM=new OSF.DDA.OutlookAppOm(a,i._webAppState.wnd,f)},j=function(){d(e,OSF.ConstantNames.HostFileId,o)};if(!OsfMsAjaxFactory.isMsAjaxLoaded())OsfMsAjaxFactory.loadMsAjaxFull(j);else j();n()}else if(a.get_appName()==OSF.AppName.Project){var r=function(){a.doc=new OSF.DDA.ProjectDocument(a);f()};d(e,OSF.ConstantNames.HostFileId,r)}else throw OSF.OUtil.formatString(stringNS.L_AppNotExistInitializeNotCalled,a.get_appName())} \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office-vsdoc.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office-vsdoc.js new file mode 100644 index 000000000..297d38195 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office-vsdoc.js @@ -0,0 +1,5872 @@ +/* Version: 16.0.6216.3006 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/// + +Office._ExcelMask = 0x1; +Office._WordMask = 0x2; +Office._ProjectMask = 0x4; +Office._OutlookMask = 0x8; +Office._PowerPointMask = 0x10; +Office._OutlookComposeMask = 0x20; +Office._AccessWebAppMask = 0x40; + +{ + Office._extractedCallback = function (originalArgs, totalArgsCount, optionalArgsCount) { + var optionalArgs = Array.prototype.slice.call(originalArgs, totalArgsCount - optionalArgsCount); + var callback = function(){}; + for (var i = Math.min(optionalArgs.length, optionalArgsCount) - 1; i >= 0; i--) { + if (typeof optionalArgs[i] == "function") { + callback = optionalArgs[i]; + break; + } + } + return callback; + } + + Office._BindingDataChangedEvents = function (eventType) { + this.binding = new Office._Binding(bindingType); + this.type = eventType; + this.startColumn = {}; + this.startRow = {}; + } + + Office._DocumentEventArgs = function (eventType) { + Office._processContents(this, { + type: { + annotate: { + /// + type: undefined + }, + value: eventType + } + }); + if (eventType == "activeViewChanged") { + Office._processItem( + this, + { + annotate: { + /// + activeView: undefined + } + }, + "activeView" + ); + } + } + + Office._CustomXmlNodeEvents = function (eventType) { + this.type = eventType; + this.inUndoRedo = {}; + + if (eventType == 'nodeDeleted') { + this.oldNode = new Office._CustomXmlNode(); + this.oldNextSibling = new Office._CustomXmlNode(); + } + + if (eventType == 'nodeInserted') { + this.newNode = new Office._CustomXmlNode(); + + + } + if (eventType == 'nodeReplaced') { + this.oldNode = new Office._CustomXmlNode(); + this.newNode = new Office._CustomXmlNode(); + + } + } + + Office._Error = function () { + this.id = {}; + this.message = {}; + this.name = {}; + } + + Office._CustomXmlNode = function () { + this.baseName = {}; + this.namespaceUri = {}; + this.nodeType = {}; + + this.getNodesAsync = function (xPath, callback) { + /// Gets the nodes associated with the xPath expression. + ///The xPath expression + ///The optional callback method + var result = new Office._AsyncResult("getNodesAsync"); + callback(result); + }; + this.getNodeValueAsync = function (callback) { + /// Gets the node value. + ///The optional callback method + + var result = new Office._AsyncResult("getNodeValueAsync"); + callback(result); + }; + this.getXmlAsync = function (callback) { + /// Gets the node's XML. + ///The optional callback method + var result = new Office._AsyncResult("getXmlAsync"); + callback(result); + }; + this.setNodeValueAsync = function (value, callback) { + /// Sets the node value. + ///The value to be set on the node + ///The optional callback method + var result = new Office._AsyncResult("setNodeValueAsync"); + callback(result); + }; + this.setXmlAsync = function (xml, callback) { + /// Sets the node XML. + ///The XML to be set on the node + ///The optional callback method + var result = new Office._AsyncResult("setXmlAsync"); + callback(result); + }; + } + + Office._context_document_customXmlParts_customXmlPrefixMappings = function () { + this.addNamespaceAsync = function (prefix, nsUri, callback) { + ///Adds a namespace. + //////The namespace prefix + //////The namespace URI + ///The optional callback method + + var result = new Office._AsyncResult("addNamespaceAsync"); + callback(result); + }; + this.getNamespaceAsync = function (prefix, callback) { + /// Gets a namespace with the specified prefix + ///The namespace prefix + ///The optional callback method + var result = new Office._AsyncResult("getNamespaceAsync"); + callback(result); + }; + this.getPrefixAsync = function (nsUri, callback) { + /// Gets a prefix for the specified URI + ///The namespace URI + ///The optional callback method + + var result = new Office._AsyncResult("getPrefixAsync"); + callback(result); + }; + } + + Office._CustomXmlPart = function () { + this.builtIn = {}; + this.id = {}; + this.namespaceManager = new Office._context_document_customXmlParts_customXmlPrefixMappings(); + + this.deleteAsync = function (callback) { + /// Deletes the Custom XML Part. + ///The optional callback method + var result = new Office._AsyncResult("deleteAsync"); + callback(result); + }; + this.getNodesAsync = function (xPath, callback) { + /// Gets the nodes associated with the xPath expression. + ///The xPath expression + ///The optional callback method + + var result = new Office._AsyncResult("getNodesAsync"); + callback(result); + }; + this.getXmlAsync = function (callback) { + /// Gets the XML for the Custom XML Part. + ///The optional callback method + var result = new Office._AsyncResult("getXmlAsync"); + callback(result); + }; + + this.addHandlerAsync = function (eventType, handler, callback) { + /// Adds an event handler to the object using the specified event type. + ///The event type. For CustomXmlPartNode it can be 'nodeDeleted', 'nodeInserted' or 'nodeReplaced' + ///The name of the handler + ///The optional callback method + + + var events = new Office._CustomXmlNodeEvents(eventType); + handler(events); + + var result = new Office._AsyncResult("addHandlerAsync"); + callback(result); + }; + + this.removeHandlerAsync = function (eventType, options, callback) { + /// Removes an event handler from the object using the specified event type. + ///The event type. For CustomXmlPartNode it can be 'nodeDeleted', 'nodeInserted' or 'nodeReplaced' + /// + /// Syntax example: {handler:eventHandler} + /// handler: Indicates a specific handler to be removed, if not specified all handlers are removed + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + /// + Office._extractedCallback(arguments, 3, 2)(new Office._AsyncResult("removeHandlerAsync")); + } + } + + Office._Binding = function (bindingType) { + ///Id of the Binding}; + this.id = {}; + + this.type = {}; + this.document = {}; + + this.setDataAsync = function (data, options, callback) { + /// Writes the specified data into the current selection. + ///The data to be set. Either a string or value, 2d array or TableData object + /// + /// Syntax example: {coercionType:Office.CoercionType.Matrix} or {coercionType: 'matrix'} + /// coercionType: Explicitly sets the shape of the data object. Use Office.CoercionType or text value. If not supplied is inferred from the data type. + /// startRow: Used in partial set for table/matrix. Indicates the start row. + /// startColumn: Used in partial set for table/matrix. Indicates the start column. + + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 3, 2)(new Office._AsyncResult("setDataAsync")); + }; + + this.getDataAsync = function (options, callback) { + /// Returns the current selection. + /// + /// Syntax example: {coercionType: 'matrix,'valueFormat: 'formatted', filterType:'all'} + /// coercionType: The expected shape of the selection. If not specified returns the bindingType shape. Use Office.CoercionType or text value. + /// valueFormat: Get data with or without format. Use Office.ValueFormat or text value. + /// startRow: Used in partial get for table/matrix. Indicates the start row. + /// startColumn: Used in partial get for table/matrix. Indicates the start column. + /// rowCount: Used in partial get for table/matrix. Indicates the number of rows from the start row. + /// columnCount: Used in partial get for table/matrix. Indicates the number of columns from the start column. + /// filterType: Get the visible or all the data. Useful when filtering data. Use Office.FilterType or text value. + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + + if (arguments.length == 1) { + callback = options; + } + var result = new Office._AsyncResult("getDataAsync", options.coercionType); + callback(result); + }; + + this.addHandlerAsync = function (eventType, handler, callback) { + /// Adds an event handler to the object using the specified event type. + ///The event type. For binding it can be 'bindingDataChanged' and 'bindingSelectionChanged' + ///The name of the handler + ///The optional callback method + + + var events = new Office._BindingDataChangedEvents(eventType); + handler(events); + + var result = new Office._AsyncResult("addHandlerAsync"); + callback(result); + }; + + this.removeHandlerAsync = function (eventType, options, callback) { + /// Removes an event handler from the object using the specified event type. + ///The event type. For binding can be 'bindingDataChanged' and 'bindingSelectionChanged' + /// + /// Syntax example: {handler:eventHandler} + /// handler: Indicates a specific handler to be removed, if not specified all handlers are removed + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + + + var events = new Office._BindingDataChangedEvents(eventType); + handler(events); + + Office._extractedCallback(arguments, 3, 2)(new Office._AsyncResult("removeHandlerAsync")); + }; + + + if ((bindingType == undefined) || (bindingType == Office.BindingType.Matrix) || (bindingType == Office.BindingType.Table)) { + this.columnCount = {}; + this.rowCount = {}; + } + if ((bindingType == undefined) || (bindingType == Office.BindingType.Table)) { + Office._processContents(this, { + hasHeaders: { + value: {} + }, + addRowsAsync: { + value: function (data, callback) { + /// Adds the specified rows to the table + /// A 2D array with the rows to add + + ///The optional callback method + } + }, + addColumnsAsync: { + value: function (tableData, callback) { + /// Adds the specified columns to the table + /// A TableData object with the headers and rows + + ///The optional callback method}; + } + }, + deleteAllDataValuesAsync: { + value: function (callback) { + /// Clears the table + ///The optional callback method}; + } + }, + formattingSpecific: { + metaOnly: true, + conditions: { + hosts: ["excel"], + }, + contents: { + clearFormatsAsync: { + conditions: { + reqs: ["method TableBinding.clearFormatsAsync"] + }, + value: function (options, callback) { + /// Clears formatting on the bound table. + /// + /// Syntax example: {asyncContext:context} + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 2, 2)(new Office._AsyncResult("clearFormatsAsync")); + } + }, + getFormatsAsync: { + conditions: { + reqs: ["method TableBinding.getFormatsAsync"] + }, + value: function (cellReference, formats, options, callback) { + /// Gets the formatting on specified items in the table. + ///An object literal containing name-value pairs that specify the range of cells to get formatting from. + ///An array specifying the format properties to get. + /// + /// Syntax example: {asyncContext:context} + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 4, 4)(new Office._AsyncResult("getFormatsAsync")); + } + }, + setFormatsAsync: { + conditions: { + reqs: ["method TableBinding.setFormatsAsync"] + }, + value: function (formatsInfo, options, callback) { + /// Sets formatting on specified items and data in the table. + /// + /// Array elements are themselves three-element arrays: + /// [target, type, formats] + /// target: The identifier of the item to format. String. + /// type: The kind of item to format. String. + /// formats: An object literal containing a list of property name-value pairs that define the formatting to apply. + /// + /// + /// Syntax example: {asyncContext:context} + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 3, 3)(new Office._AsyncResult("setFormatsAsync")); + } + }, + setTableOptionsAsync: { + conditions: { + reqs: ["method TableBinding.setTableOptionsAsync"] + }, + value: function (tableOptions, options, callback) { + /// Updates table formatting options on the bound table. + ///An object literal containing a list of property name-value pairs that define the table options to apply. + /// + /// Syntax example: {asyncContext:context} + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 3, 2)(new Office._AsyncResult("setTableOptionsAsync")); + } + } + } + } + }); + } + } + + Office._TableData = function () { + this.headers = new Array(new Array()); + this.rows = new Array(new Array()); + } + + Office._File = function () { + this.size = {}; + this.sliceCount = {}; + this.getSliceAsync = function (sliceIndex, callback) { + /// Gets the specified slice. + ///The index of the slice to be retrieved + ///The optional callback method + var result = new Office._AsyncResult("getSliceAsync"); + callback(result); + }; + this.closeAsync = function (callback) { + /// Closes the File. + ///The optional callback method + }; + } + + Office._Slice = function () { + this.data = {}; + this.index = {}; + this.size = {}; + } + + Office._AsyncResult = function (method, bindingType) { + this.asyncContext = {}; + this.error = new Office._Error(); + this.status = {}; + + if ((method == "addfromSelectionAsync") || (method == "addFromNamedItemAsync") || (method == "getByIdAsync") || (method == "addFromPromptAsync")) { + this.value = new Office._Binding(bindingType); + } else if ((method == "getDataAsync") || (method == "getSelectedDataAsync")) { + if (bindingType == "table") + this.value = new Office._TableData(); + else if (bindingType == "matrix") + this.value = new Array(new Array); + else + this.value = {}; + } else if (method == "getAllAsync") { + this.value = new Array(new Office._Binding(bindingType)); + } else if (method == "getByNamespaceAsync") { + this.value = new Array(new Office._CustomXmlPart()); + } else if (method == "getNodesAsync") { + this.value = new Array(new Office._CustomXmlNode()); + } else if ((method == "XMLgetByIdAsync") || (method == "addAsync")) { + this.value = new Office._CustomXmlPart(); + } else if (method == "refreshAsync") { + this.value = new Office._context_document_settings(); + } else if (method == "getFileAsync") { + this.value = new Office._File(); + } else if (method == "getSliceAsync") { + this.value = new Office._Slice(); + } else if (method == "getActiveViewAsync") { + Office._processItem(this, + { + annotate: { + ///The presentation's current view. + value: undefined + } + }, + "value" + ); + } else if (method == "getFilePropertiesAsync") { + this.value = new Office._FileProperties(); + } else { + this.value = {}; + } + } + + Office._FileProperties = function () { + ///File's URL + this.url = ""; + } + + Office._context_document_settings = function () { + this.get = function (settingName) { + ///Retrieves the setting with the specified name. + ///The name of the setting + }; + + this.remove = function (settingName) { + ///Removes the setting with the specified name. + ///The name of the setting + /// + }; + + this.saveAsync = function (options, callback) { + ///Saves all settings. + /// + /// Syntax example: {overwriteIfStale:false} + /// overwriteIfStale: Indicates whether the setting will be replaced if stale. + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + /// + Office._extractedCallback(arguments, 2, 2)(new Office._AsyncResult("saveAsync", coercionType)); + }; + + this.set = function (settingName, value) { + ///Sets a value for the setting with the specified name. + ///The name of the setting + ///The value for the setting + }; + }; + + Office._context_document_bindings = function () { + this.document = {}; + + if (Office._AccessWebAppMask & Office._appContext) { + this.addFromSelectionAsync = function (bindingType, options, callback) { + ///Create a binding based on what the user's current selection. + ///The Office BindingType for the data + /// + /// addFromSelectionAsyncOptions- e.g. {id: "BindingID"} + /// id: Identifier. + /// asyncContext: Object keeping state for the callback + /// columns: The string[] of the columns involved in the binding + /// sampleData: A TableData that gives sample table in the Dialog.TableData.Headers is [][] of string. + /// + ///The optional callback method + if (arguments.length == 2) { callback = options; }; + var result = new Office._AsyncResult("addfromSelectionAsync", bindingType); + callback(result); + } + } else { + this.addFromSelectionAsync = function (bindingType, options, callback) { + ///Create a binding based on what the user's current selection. + ///The Office BindingType for the data + /// + /// addFromSelectionAsyncOptions- e.g. {id: "BindingID"} + /// id: Identifier. + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + if (arguments.length == 2) { callback = options; }; + var result = new Office._AsyncResult("addfromSelectionAsync", bindingType); + callback(result); + } + } + if (Office._AccessWebAppMask & Office._appContext) { + this.addFromNamedItemAsync = function (itemName, bindingType, options, callback) { + ///Creates a binding against a named object in the document + ///Name of the bindable object in the document. For Example 'MyExpenses' table in Excel." + ///The Office BindingType for the data + /// + /// Syntax example: {id: "BindingID"} + /// id: Name of the binding, autogenerated if not supplied. + /// asyncContext: Object keeping state for the callback + /// columns: The string[] of the columns involved in the binding + /// + ///The optional callback method + + if (arguments.length == 3) { callback = options; }; + var result = new Office._AsyncResult("addFromNamedItemAsync", bindingType); + callback(result); + } + } else { + this.addFromNamedItemAsync = function (itemName, bindingType, options, callback) { + ///Creates a binding against a named object in the document + ///Name of the bindable object in the document. For Example 'MyExpenses' table in Excel." + ///The Office BindingType for the data + /// + /// Syntax example: {id: "BindingID"} + /// id: Name of the binding, autogenerated if not supplied. + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + + if (arguments.length == 3) { callback = options; }; + var result = new Office._AsyncResult("addFromNamedItemAsync", bindingType); + callback(result); + } + } + this.getByIdAsync = function (id, callback) { + ///Retrieves a binding based on its Name + ///The binding id + ///The optional callback method + + var result = new Office._AsyncResult("getByIdAsync") + callback(result); + } + this.getAllAsync = function (callback) { + ///Gets an array with all the binding objects in the document. + ///The optional callback method + var result = new Office._AsyncResult("getAllAsync") + callback(result); + }; + + this.releaseByIdAsync = function (id, callback) { + ///Removes the binding from the document + ///The binding id + ///The optional callback method + var result = new Office._AsyncResult("releaseByIdAsync") + callback(result); + }; + + + if (Office._AccessWebAppMask & Office._appContext) { + this.addFromPromptAsync = function (bindingType, options, callback) { + ///(Access only with sample data) Create a binding by prompting the user to make a selection on the document. + ///The Office BindingType for the data + /// + /// addFromPromptAsyncOptions- e.g. {promptText: "Please select data", id: "mySales"} + /// promptText: Greet your users with a friendly word. + /// asyncContext: Object keeping state for the callback + /// id: Identifier. + /// sampleData: A TableData that gives sample table in the Dialog.TableData.Headers is [][] of string. + /// + ///The optional callback method + + if (arguments.length == 2) { callback = options; }; + var result = new Office._AsyncResult("addFromPromptAsync", bindingType) + callback(result); + } + } else if (Office._ExcelMask & Office._appContext) { + this.addFromPromptAsync = function (bindingType, options, callback) { + ///(Excel only) Create a binding by prompting the user to make a selection on the document. + ///The Office BindingType for the data + /// + /// addFromPromptAsyncOptions- e.g. {promptText: "Please select data", id: "mySales"} + /// promptText: Greet your users with a friendly word. + /// asyncContext: Object keeping state for the callback + /// id: Identifier. + /// + ///The optional callback method + + if (arguments.length == 2) { callback = options; }; + var result = new Office._AsyncResult("addFromPromptAsync", bindingType) + callback(result); + + + } + } + + }; + + Office._context_document = { + mode: { + annotate: { + //Gets the document mode + mode: undefined + } + }, + url: { + annotate: { + //Gets the document URL + url: undefined + } + }, + addHandlerAsync: { + value: function (eventType, handler, callback) { + /// Adds an event handler for the specified event type. + ///The event type. For document can be 'DocumentSelectionChanged' + ///The name of the handler + ///The optional callback method + var result = new Office._AsyncResult("addHandlerAsync"); + callback(result); + handler(new Office._DocumentEventArgs(eventType)); + } + }, + removeHandlerAsync: { + value: function (eventType, handler, callback) { + /// Removes an event handler for the specified event type. + ///The event type. For document can be 'DocumentSelectionChanged' + ///The name of the handler. If not specified all handlers are removed + ///The optional callback method + /// + var result = new Office._AsyncResult("removeHandlerAsync", coercionType); + callback(result); + } + }, + settings: { + conditions: { + hosts: ["word", "excel", "ppt", "accesswebapp"], + reqs: [ + "set Settings GE 1.1", + "method Settings.get", + "method Settings.remove", + "method Settings.saveAsync", + "method Settings.set" + ] + }, + value: new Office._context_document_settings() + }, + refreshableSettings: { + name: "settings", + conditions: { + hosts: ["excel", "ppt", "accesswebapp"], + reqs: [] + }, + partialConditions: true, + contents: { + addHandlerAsync: { + conditions: { reqs: ["method Settings.addHandlerAsync"] }, + value: function (eventType, handler, callback) { + /// Adds an event handler for the object using the specified event type. + ///The event type. For settings can be 'settingsChanged' + ///The name of the handler + ///The optional callback method + + var result = new Office._AsyncResult("addHandlerAsync", coercionType); + callback(result); + + } + }, + refreshAsync: { + conditions: { reqs: ["method Settings.refreshAsync"] }, + value: function (callback) { + ///Gets the latest version of the settings object. + ///The optional callback method + var result = new Office._AsyncResult("refreshAsync", coercionType); + callback(result); + } + }, + removeHandlerAsync: { + conditions: { reqs: ["method Settings.removeHandlerAsync"] }, + value: function (eventType, handler, callback) { + /// Removes an event handler for the specified event type. + ///The event type. For settings can be 'settingsChanged' + /// + /// Syntax example: {handler:eventHandler} + /// handler: Indicates a specific handler to be removed, if not specified all handlers are removed + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + var result = new Office._AsyncResult("removeHandlerAsync", coercionType); + callback(result); + } + } + } + }, + setSelectedDataAsync: { + conditions: { + hosts: ["word", "excel", "ppt"], + reqs: ["set Selection GE 1.1", "method Document.setSelectedDataAsync"] + }, + value: function (data, options, callback) { + /// Writes the specified data into the current selection. + ///The data to be set. Either a string or value, 2d array or TableData object + /// + /// Syntax example: {coercionType:Office.CoercionType.Matrix} or {coercionType: 'matrix'} + /// coercionType: Explicitly sets the shape of the data object. Use Office.CoercionType or text value. If not supplied is inferred from the data type. + /// imageLeft: Used for image. Sets the left position of the image. + /// imageTop: Used for image. Sets the top position of the image. + /// imageWidth: Used for image. Sets the width of the image. + /// imageHeight: Used for image. Sets the height of the image. + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + /// + if (arguments.length == 2) { callback = options; }; + var result = new Office._AsyncResult("setSelectedDataAsync"); + callback(result); + } + }, + bindings: { + conditions: { + hosts: ["word", "excel", "accesswebapp"], + reqs: [ + "set TextBindings GE 1.1", + "set TableBindings GE 1.1", + "set MatrixBindings GE 1.1", + "method Bindings.addFromPromptAsync", + "method Bindings.addFromNamedItemAsync", + "method Bindings.addFromSelectionAsync", + "method Bindings.getAllAsync", + "method Bindings.getByIdAsync", + "method Bindings.releaseByIdAsync", + "method MatrixBinding.getDataAsync", + "method MatrixBinding.setDataAsync", + "method TableBinding.clearFormatsAsync", + "method TableBinding.setFormatsAsync", + "method TableBinding.setTableOptionsAsync", + "method TableBinding.addColumnsAsync", + "method TableBinding.addRowsAsync", + "method TableBinding.deleteAllDataValuesAsync", + "method TableBinding.getDataAsync", + "method TableBinding.setDataAsync", + "method TextBinding.getDataAsync", + "method TextBinding.setDataAsync" + ] + }, + value: new Office._context_document_bindings() + }, + getFileAsync: { + conditions: { + hosts: ["word", "ppt","excel"], + reqs: ["set File GE 1.1", "method Document.getFileAsync", "method File.closeAsync", "method File.getSliceAsync"] + }, + value: function (fileType, options, callback) { + ///(Word and PowerPoint only) Gets the entire file in slices of up to 4MB. + ///The format in which the file will be returned + /// + /// Syntax example: {sliceSize:1024} + /// sliceSize: Specifies the desired slice size (in bytes) up to 4MB. If not specified a default slice size of 4MB will be used. + /// + ///The optional callback method + if (arguments.length == 2) { callback = options; }; + var result = new Office._AsyncResult("getFileAsync"); + callback(result); + } + }, + getSelectedDataAsync: { + conditions: { + hosts: ["excel", "word", "project", "ppt"], + reqs: ["set Selection GE 1.1", "method Document.getSelectedDataAsync"] + }, + value: function (coercionType, options, callback) { + /// Returns the current selection. + ///The expected shape of the selection. + /// + /// Syntax example: {valueFormat: 'formatted', filterType:'all'} + /// valueFormat: Get data with or without format. Use Office.ValueFormat or text value. + /// filterType: Get the visible or all the data. Useful when filtering data. Use Office.FilterType or text value. + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + /// + if (arguments.length == 2) { callback = options; }; + var result = new Office._AsyncResult("getSelectedDataAsync", coercionType); + callback(result); + } + }, + customXmlParts: { + conditions: { + hosts: ["word"], + reqs: [ + "set CustomXmlParts GE 1.1", + "method CustomXmlNode.getNodesAsync", + "method CustomXmlNode.getNodeValueAsync", + "method CustomXmlNode.getXmlAsync", + "method CustomXmlNode.setNodeValueAsync", + "method CustomXmlNode.setXmlAsync", + "method CustomXmlPart.addHandlerAsync", + "method CustomXmlPart.deleteAsync", + "method CustomXmlPart.getNodesAsync", + "method CustomXmlPart.getXmlAsync", + "method CustomXmlPart.removeHandlerAsync", + "method CustomXmlPrefixMappings.addNamespaceAsync", + "method CustomXmlPrefixMappings.getNamespaceAsync", + "method CustomXmlPrefixMappings.getPrefixAsync" + ] + }, + partialConditions: true, + contents: { + addAsync: { + conditions: { + reqs: ["method CustomXmlParts.addAsync"] + }, + value: function (xml, callback) { + ///(Word Only) Asynchronously adds a new custom XML part to a file. + ///The XML to add to the newly created custom XML part. + ///A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + var result = new Office._AsyncResult("addAsync"); + callback(result); + } + }, + getByIdAsync: { + conditions: { + reqs: ["method CustomXmlParts.getByIdAsync"] + }, + value: function (id, callback) { + ///(Word Only) Asynchronously gets the specified custom XML part by its id. + ///The id of the custom XML part. + ///A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + var result = new Office._AsyncResult("XMLgetByIdAsync"); + callback(result); + } + }, + getByNamespaceAsync: { + conditions: { + reqs: ["method CustomXmlParts.getByNamespaceAsync"] + }, + value: function (ns, callback) { + ///(Word Only) Asynchronously gets the specified custom XML part(s) by its namespace. + /// The namespace to search. + ///A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + var result = new Office._AsyncResult("getByNamespaceAsync"); + callback(result); + } + } + } + }, + getActiveViewAsync: { + conditions: { + hosts: ["ppt"], + reqs: ["set ActiveView GE 1.1", "method Document.getActiveViewAsync"] + }, + value: function(options, callback) { + ///(PowerPoint only) Returns the current view of the presentation. + /// + /// Syntax example: {asyncContext:context} + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 2, 2)(new Office._AsyncResult("getActiveViewAsync")); + } + }, + getFilePropertiesAsync: { + conditions: { + hosts: ["word", "ppt", "excel"], + reqs: ["method Document.getFilePropertiesAsync"] + }, + value: function(options, callback) { + ///Gets file properties of the current document. + /// + /// Syntax example: {asyncContext:context} + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 2, 2)(new Office._AsyncResult("getFilePropertiesAsync")); + } + }, + goToByIdAsync: { + conditions: { + hosts: ["excel", "ppt", "word"], + reqs: ["method Document.goToByIdAsync"] + }, + value: function(id, goToType, options, callback) { + ///Goes to the specified object or location in the document. + ///The identifier of the object or location to go to. + ///The type of the location to go to. + /// + /// Syntax example: {asyncContext:context} + /// selectionMode: (Word only) Use Office.SelectionMode or text value. + /// asyncContext: Object keeping state for the callback + /// + ///The optional callback method + Office._extractedCallback(arguments, 4, 2)(new Office._AsyncResult("goToByIdAsync")); + } + } + } +} + +Office._items = { + context: { + contents: { + contentLanguage: {}, + displayLanguage: {}, + license: { + contents: { + value: { + annotate: { + //License summary. + value: undefined + } + } + } + }, + document: { + conditions: { + hosts: ["not outlook; not outlookcompose"] + }, + annotate: { + // Office Document + document: undefined + }, + contents: Office._context_document + }, + officeTheme: { + conditions: { + hosts: ["excel", "outlook", "powerpoint", "project", "word"] + }, + annotate: { + officeTheme: undefined + }, + contents: { + "bodyBackgroundColor": {}, + "bodyForegroundColor": {}, + "controlBackgroundColor": {}, + "controlForegroundColor": {} + } + }, + touchEnabled: {}, + commerceAllowed : {}, + requirements: { + annotate: { + // Checks whether a given requirement set is supported by the current host. + requirements: undefined + }, + contents: { + isSetSupported: { + value: function (name, minVersion) { + /// Check if the specified requirement set is supported by the host Office application + /// Set name. e.g.: "MatrixBindings" + /// The minimum required version + } + }, + } + } + } + }, + initialize: { + value: function (reason) { + /// This method is called after the Office API was loaded. + /// Indicates how the app was initialized + } + }, + useShortNamespace: { + value: function (useShortNamespace) { + /// Indicates if the large namespace for objects will be used or not. + /// Indicates if 'true' that the short namespace will be used + } + }, + select: { + conditions: { + hosts: ["not outlook; not outlookcompose"] + }, + value: function (expression, callback) { + /// Returns a promise of an object described in the expression. Callback is invoked only if method fails. + ///The object to be retrieved. Example "bindings#BindingName", retrieves a binding promise for a binding named 'BindingName' + ///The optional callback method + /// + var result = new Office._AsyncResult("select"); + callback(result); + return (new Office._Binding()); + } + }, + TableData: { + conditions: { + hosts: ["word", "excel", "accesswebapp"], + reqs: ["set TableBindings GE 1.1"] + }, + value: new Office._TableData() + } +}; + +/*Infrastructure***************************************************************/ +Office._processItem = function (target, item, key, suppressConditionCheck) { + var conditionsFulfilled = suppressConditionCheck || Office._filterManager._checkCondition(item.conditions); + if (!(conditionsFulfilled || item.partialConditions)) { + return false; + } + suppressConditionCheck = suppressConditionCheck || conditionsFulfilled && item.partialConditions; + + if (item.setup) { + item.setup(); + } + if (item.metaOnly) { + return Office._processContents(target, item.contents, suppressConditionCheck); + } + + key = item.name || key; + var areItemsAdded = false; + + if (item.hasOwnProperty("value")) { + target[key] = item.value; + areItemsAdded = true; + } else if (typeof item.contents == "function") { + target[key] = item.contents(); + areItemsAdded = true; + } else { + target[key] = target[key] || {}; + if (Office._processContents(target[key], item.contents, suppressConditionCheck) || conditionsFulfilled) { + areItemsAdded = true; + } else { + delete target[key]; + } + } + if (item.annotate) { + intellisense.annotate(target, item.annotate); + areItemsAdded = true; + } + return areItemsAdded; +} + +Office._processContents = function (target, contents, suppressConditionCheck) { + if (typeof contents !== "object") { + return false; + } + + var areItemsAdded = false; + for (var item in contents) { + areItemsAdded = Office._processItem(target, contents[item], item, suppressConditionCheck) || areItemsAdded; + } + return areItemsAdded; +} + +Office._filterManager = (function () { + + var filters = []; + + return { + _checkCondition: function (condition) { + if (!condition) + return true; + + var answer = true; + + for (var i = 0; i < filters.length; i++) { + var filter = filters[i]; + var conditionForThisFilter = condition[filter.identifier]; + if (conditionForThisFilter && filter.isEnabled()) { + + var thisFiltersAnswer = false; + + for (var j = 0; j < conditionForThisFilter.length; j++) { + var productTerm = conditionForThisFilter[j].split(';'); + + var thisTermsAnswer = true; + for (var k = 0; k < productTerm.length; k++) { + var singleCondition = productTerm[k].toUpperCase().trim(); + var invert = false; + if (singleCondition.indexOf("NOT") != -1) { + invert = true; + singleCondition = singleCondition.slice(singleCondition.indexOf(" ")).trim(); + } + var result = filter.isConditionTrue(singleCondition, invert); + thisTermsAnswer = thisTermsAnswer && result; + } + + thisFiltersAnswer = thisFiltersAnswer || thisTermsAnswer; + } + + answer = answer && thisFiltersAnswer; + } + + if (!answer) + break; + } + + return answer; + }, + + _pushFilter: function (identifier, filteringDelegate, isEnabledDelegate) { + filters.push({ + identifier: identifier, + isConditionTrue: filteringDelegate, + isEnabled: isEnabledDelegate + }); + } + } +})(); + +Office._filterManager._pushFilter( + "hosts", + (function () { + var nameToMaskMapping = { + EXCEL: Office._ExcelMask, + WORD: Office._WordMask, + PROJECT: Office._ProjectMask, + OUTLOOK: Office._OutlookMask, + PPT: Office._PowerPointMask, + OUTLOOKCOMPOSE: Office._OutlookComposeMask, + ACCESSWEBAPP: Office._AccessWebAppMask + } + + return function (condition, invert) { + var result = false; + if (nameToMaskMapping[condition] & Office._appContext) { + result = true; + } + return invert ? !result : result; + } + })(), + function () { + return typeof Office._appContext === "number"; + } +); + +Office._filterManager._pushFilter( + "reqs", + (function () { + + function checkForMethod(methodName) { + return Office._methodContext && Office._methodContext[methodName]; + } + + function checkForSet(setDescriptor) { + setDescriptor = setDescriptor.split(" "); + var setName = setDescriptor[0].trim(), + setEntry = Office._setContext && setName in Office._setContext && (Office._setContext[setName] || "1.1"); + + if (!setEntry) { + return false; + } + + if (setDescriptor.length === 1) { + return true; + } else { + var comparisonOperator = setDescriptor[1].trim(), + setVersion = setDescriptor[2].split("."), + setEntryVersion = setEntry.split("."), + difference = 0, + maxComponentCount = Math.max(setEntryVersion.length, setVersion.length); + + for (var i = 0; i < maxComponentCount; i++) { + var leftInt = parseInt(setEntryVersion[i], 10) || 0, + rightInt = parseInt(setVersion[i], 10) || 0; + if (leftInt === rightInt) { + continue; + } + difference = leftInt - rightInt; + break; + } + + switch (comparisonOperator) { + case "EQ": + return difference === 0; + case "GT": + return difference > 0; + case "LT": + return difference < 0; + case "GE": + return difference >= 0; + case "LE": + return difference <= 0; + default: + return false; + } + } + return false; + } + + return function (condition, invert) { + var result = true; + var typeAgnosticCond = condition.slice(condition.indexOf(" ")).trim(); + if (condition.indexOf("SET") === 0) { + result = checkForSet(typeAgnosticCond); + } else if (condition.indexOf("METHOD") === 0) { + result = checkForMethod(typeAgnosticCond); + } + return invert ? !result : result; + } + })(), + function () { + if (Office._showAll === false) { + return true; + } + return false; + } +) + +Office._addEnumOnObject = function (enumName, enumObj, targetObj, conditions) { + Office._processItem( + targetObj, + { + conditions: conditions, + value: enumObj + }, + enumName + ); +} +/******************************************************************************/ + +// Setup Project +Office._processItem(Office, { + metaOnly: true, + conditions: { + hosts: ["project"] + }, + contents: { + ProjectProjectFields: { + value: { + ///CurrencySymbol + CurrencySymbol: 1, + ///CurrencySymbolPosition + CurrencySymbolPosition: 2, + ///DurationUnits + DurationUnits: 3, + ///GUID + GUID: 4, + ///Finish + Finish: 5, + ///Start + Start: 6, + ///ReadOnly + ReadOnly: 7, + ///VERSION + VERSION: 8, + ///WorkUnits + WorkUnits: 9, + ///ProjectServerUrl + ProjectServerUrl: 10, + ///WSSUrl + WSSUrl: 11, + ///WSSList + WSSList: 12 + } + }, + ProjectViewTypes: { + value: { + ///Gantt + Gantt: 1, + ///NetworkDiagram + NetworkDiagram: 2, + ///TaskDiagram + TaskDiagram: 3, + ///TaskForm + TaskForm: 4, + ///TaskSheet + TaskSheet: 5, + ///ResourceForm + ResourceForm: 6, + ///ResourceSheet + ResourceSheet: 7, + ///ResourceGraph + ResourceGraph: 8, + ///TeamPlanner + TeamPlanner: 9, + ///TaskDetails + TaskDetails: 10, + ///TaskNameForm + TaskNameForm: 11, + ///ResourceNames + ResourceNames: 12, + ///Calendar + Calendar: 13, + ///TaskUsage + TaskUsage: 14, + ///ResourceUsage + ResourceUsage: 15, + ///Timeline + Timeline: 16, + ///Drawing + Drawing: 18, + ///Resource Plan + ResourcePlan: 19 + } + }, + ProjectTaskFields: { + value: { + ///ActualCost + ActualCost: 0, + ///ActualDuration + ActualDuration: 1, + ///ActualFinish + ActualFinish: 2, + ///ActualOvertimeCost + ActualOvertimeCost: 3, + ///ActualOvertimeWork + ActualOvertimeWork: 4, + ///ActualStart + ActualStart: 5, + ///ActualWork + ActualWork: 6, + ///Text1 + Text1: 7, + ///Text10 + Text10: 8, + ///Finish10 + Finish10: 9, + ///Start10 + Start10: 10, + ///Text11 + Text11: 11, + ///Text12 + Text12: 12, + ///Text13 + Text13: 13, + ///Text14 + Text14: 14, + ///Text15 + Text15: 15, + ///Text16 + Text16: 16, + ///Text17 + Text17: 17, + ///Text18 + Text18: 18, + ///Text19 + Text19: 19, + ///Finish1 + Finish1: 20, + ///Start1 + Start1: 21, + ///Text2 + Text2: 22, + ///Text20 + Text20: 23, + ///Text21 + Text21: 24, + ///Text22 + Text22: 25, + ///Text23 + Text23: 26, + ///Text24 + Text24: 27, + ///Text25 + Text25: 28, + ///Text26 + Text26: 29, + ///Text27 + Text27: 30, + ///Text28 + Text28: 31, + ///Text29 + Text29: 32, + ///Finish2 + Finish2: 33, + ///Start2 + Start2: 34, + ///Text3 + Text3: 35, + ///Text30 + Text30: 36, + ///Finish3 + Finish3: 37, + ///Start3 + Start3: 38, + ///Text4 + Text4: 39, + ///Finish4 + Finish4: 40, + ///Start4 + Start4: 41, + ///Text5 + Text5: 42, + ///Finish5 + Finish5: 43, + ///Start5 + Start5: 44, + ///Text6 + Text6: 45, + ///Finish6 + Finish6: 46, + ///Start6 + Start6: 47, + ///Text7 + Text7: 48, + ///Finish7 + Finish7: 49, + ///Start7 + Start7: 50, + ///Text8 + Text8: 51, + ///Finish8 + Finish8: 52, + ///Start8 + Start8: 53, + ///Text9 + Text9: 54, + ///Finish9 + Finish9: 55, + ///Start9 + Start9: 56, + ///Baseline10BudgetCost + Baseline10BudgetCost: 57, + ///Baseline10BudgetWork + Baseline10BudgetWork: 58, + ///Baseline10Cost + Baseline10Cost: 59, + ///Baseline10Duration + Baseline10Duration: 60, + ///Baseline10Finish + Baseline10Finish: 61, + ///Baseline10FixedCost + Baseline10FixedCost: 62, + ///Baseline10FixedCostAccrual + Baseline10FixedCostAccrual: 63, + ///Baseline10Start + Baseline10Start: 64, + ///Baseline10Work + Baseline10Work: 65, + ///Baseline1BudgetCost + Baseline1BudgetCost: 66, + ///Baseline1BudgetWork + Baseline1BudgetWork: 67, + ///Baseline1Cost + Baseline1Cost: 68, + ///Baseline1Duration + Baseline1Duration: 69, + ///Baseline1Finish + Baseline1Finish: 70, + ///Baseline1FixedCost + Baseline1FixedCost: 71, + ///Baseline1FixedCostAccrual + Baseline1FixedCostAccrual: 72, + ///Baseline1Start + Baseline1Start: 73, + ///Baseline1Work + Baseline1Work: 74, + ///Baseline2BudgetCost + Baseline2BudgetCost: 75, + ///Baseline2BudgetWork + Baseline2BudgetWork: 76, + ///Baseline2Cost + Baseline2Cost: 77, + ///Baseline2Duration + Baseline2Duration: 78, + ///Baseline2Finish + Baseline2Finish: 79, + ///Baseline2FixedCost + Baseline2FixedCost: 80, + ///Baseline2FixedCostAccrual + Baseline2FixedCostAccrual: 81, + ///Baseline2Start + Baseline2Start: 82, + ///Baseline2Work + Baseline2Work: 83, + ///Baseline3BudgetCost + Baseline3BudgetCost: 84, + ///Baseline3BudgetWork + Baseline3BudgetWork: 85, + ///Baseline3Cost + Baseline3Cost: 86, + ///Baseline3Duration + Baseline3Duration: 87, + ///Baseline3Finish + Baseline3Finish: 88, + ///Baseline3FixedCost + Baseline3FixedCost: 89, + ///Baseline3FixedCostAccrual + Baseline3FixedCostAccrual: 90, + ///Basline3Start + Basline3Start: 91, + ///Baseline3Work + Baseline3Work: 92, + ///Baseline4BudgetCost + Baseline4BudgetCost: 93, + ///Baseline4BudgetWork + Baseline4BudgetWork: 94, + ///Baseline4Cost + Baseline4Cost: 95, + ///Baseline4Duration + Baseline4Duration: 96, + ///Baseline4Finish + Baseline4Finish: 97, + ///Baseline4FixedCost + Baseline4FixedCost: 98, + ///Baseline4FixedCostAccrual + Baseline4FixedCostAccrual: 99, + ///Baseline4Start + Baseline4Start: 100, + ///Baseline4Work + Baseline4Work: 101, + ///Baseline5BudgetCost + Baseline5BudgetCost: 102, + ///Baseline5BudgetWork + Baseline5BudgetWork: 103, + ///Baseline5Cost + Baseline5Cost: 104, + ///Baseline5Duration + Baseline5Duration: 105, + ///Baseline5Finish + Baseline5Finish: 106, + ///Baseline5FixedCost + Baseline5FixedCost: 107, + ///Baseline5FixedCostAccrual + Baseline5FixedCostAccrual: 108, + ///Baseline5Start + Baseline5Start: 109, + ///Baseline5Work + Baseline5Work: 110, + ///Baseline6BudgetCost + Baseline6BudgetCost: 111, + ///Baseline6BudgetWork + Baseline6BudgetWork: 112, + ///Baseline6Cost + Baseline6Cost: 113, + ///Baseline6Duration + Baseline6Duration: 114, + ///Baseline6Finish + Baseline6Finish: 115, + ///Baseline6FixedCost + Baseline6FixedCost: 116, + ///Baseline6FixedCostAccrual + Baseline6FixedCostAccrual: 117, + ///Baseline6Start + Baseline6Start: 118, + ///Baseline6Work + Baseline6Work: 119, + ///Baseline7BudgetCost + Baseline7BudgetCost: 120, + ///Baseline7BudgetWork + Baseline7BudgetWork: 121, + ///Baseline7Cost + Baseline7Cost: 122, + ///Baseline7Duration + Baseline7Duration: 123, + ///Baseline7Finish + Baseline7Finish: 124, + ///Baseline7FixedCost + Baseline7FixedCost: 125, + ///Baseline7FixedCostAccrual + Baseline7FixedCostAccrual: 126, + ///Baseline7Start + Baseline7Start: 127, + ///Baseline7Work + Baseline7Work: 128, + ///Baseline8BudgetCost + Baseline8BudgetCost: 129, + ///Baseline8BudgetWork + Baseline8BudgetWork: 130, + ///Baseline8Cost + Baseline8Cost: 131, + ///Baseline8Duration + Baseline8Duration: 132, + ///Baseline8Finish + Baseline8Finish: 133, + ///Baseline8FixedCost + Baseline8FixedCost: 134, + ///Baseline8FixedCostAccrual + Baseline8FixedCostAccrual: 135, + ///Baseline8Start + Baseline8Start: 136, + ///Baseline8Work + Baseline8Work: 137, + ///Baseline9BudgetCost + Baseline9BudgetCost: 138, + ///Baseline9BudgetWork + Baseline9BudgetWork: 139, + ///Baseline9Cost + Baseline9Cost: 140, + ///Baseline9Duration + Baseline9Duration: 141, + ///Baseline9Finish + Baseline9Finish: 142, + ///Baseline9FixedCost + Baseline9FixedCost: 143, + ///Baseline9FixedCostAccrual + Baseline9FixedCostAccrual: 144, + ///Baseline9Start + Baseline9Start: 145, + ///Baseline9Work + Baseline9Work: 146, + ///BaselineBudgetCost + BaselineBudgetCost: 147, + ///BaselineBudgetWork + BaselineBudgetWork: 148, + ///BaselineCost + BaselineCost: 149, + ///BaselineDuration + BaselineDuration: 150, + ///BaselineFinish + BaselineFinish: 151, + ///BaselineFixedCost + BaselineFixedCost: 152, + ///BaselineFixedCostAccrual + BaselineFixedCostAccrual: 153, + ///BaselineStart + BaselineStart: 154, + ///BaselineWork + BaselineWork: 155, + ///BudgetCost + BudgetCost: 156, + ///BudgetFixedCost + BudgetFixedCost: 157, + ///BudgetFixedWork + BudgetFixedWork: 158, + ///BudgetWork + BudgetWork: 159, + ///TaskCalendarGUID + TaskCalendarGUID: 160, + ///ConstraintDate + ConstraintDate: 161, + ///ConstraintType + ConstraintType: 162, + ///Cost1 + Cost1: 163, + ///Cost10 + Cost10: 164, + ///Cost2 + Cost2: 165, + ///Cost3 + Cost3: 166, + ///Cost4 + Cost4: 167, + ///Cost5 + Cost5: 168, + ///Cost6 + Cost6: 169, + ///Cost7 + Cost7: 170, + ///Cost8 + Cost8: 171, + ///Cost9 + Cost9: 172, + ///Date1 + Date1: 173, + ///Date10 + Date10: 174, + ///Date2 + Date2: 175, + ///Date3 + Date3: 176, + ///Date4 + Date4: 177, + ///Date5 + Date5: 178, + ///Date6 + Date6: 179, + ///Date7 + Date7: 180, + ///Date8 + Date8: 181, + ///Date9 + Date9: 182, + ///Deadline + Deadline: 183, + ///Duration1 + Duration1: 184, + ///Duration10 + Duration10: 185, + ///Duration2 + Duration2: 186, + ///Duration3 + Duration3: 187, + ///Duration4 + Duration4: 188, + ///Duration5 + Duration5: 189, + ///Duration6 + Duration6: 190, + ///Duration7 + Duration7: 191, + ///Duration8 + Duration8: 192, + ///Duration9 + Duration9: 193, + ///Duration + Duration: 194, + ///EarnedValueMethod + EarnedValueMethod: 195, + ///FinishSlack + FinishSlack: 196, + ///FixedCost + FixedCost: 197, + ///FixedCostAccrual + FixedCostAccrual: 198, + ///Flag10 + Flag10: 199, + ///Flag1 + Flag1: 200, + ///Flag11 + Flag11: 201, + ///Flag12 + Flag12: 202, + ///Flag13 + Flag13: 203, + ///Flag14 + Flag14: 204, + ///Flag15 + Flag15: 205, + ///Flag16 + Flag16: 206, + ///Flag17 + Flag17: 207, + ///Flag18 + Flag18: 208, + ///Flag19 + Flag19: 209, + ///Flag2 + Flag2: 210, + ///Flag20 + Flag20: 211, + ///Flag3 + Flag3: 212, + ///Flag4 + Flag4: 213, + ///Flag5 + Flag5: 214, + ///Flag6 + Flag6: 215, + ///Flag7 + Flag7: 216, + ///Flag8 + Flag8: 217, + ///Flag9 + Flag9: 218, + ///FreeSlack + FreeSlack: 219, + ///HasRollupSubTasks + HasRollupSubTasks: 220, + ///ID + ID: 221, + ///Name + Name: 222, + ///Notes + Notes: 223, + ///Number1 + Number1: 224, + ///Number10 + Number10: 225, + ///Number11 + Number11: 226, + ///Number12 + Number12: 227, + ///Number13 + Number13: 228, + ///Number14 + Number14: 229, + ///Number15 + Number15: 230, + ///Number16 + Number16: 231, + ///Number17 + Number17: 232, + ///Number18 + Number18: 233, + ///Number19 + Number19: 234, + ///Number2 + Number2: 235, + ///Number20 + Number20: 236, + ///Number3 + Number3: 237, + ///Number4 + Number4: 238, + ///Number5 + Number5: 239, + ///Number6 + Number6: 240, + ///Number7 + Number7: 241, + ///Number8 + Number8: 242, + ///Number9 + Number9: 243, + ///ScheduledDuration + ScheduledDuration: 244, + ///ScheduledFinish + ScheduledFinish: 245, + ///ScheduledStart + ScheduledStart: 246, + ///OutlineLevel + OutlineLevel: 247, + ///OvertimeCost + OvertimeCost: 248, + ///OvertimeWork + OvertimeWork: 249, + ///PercentComplete + PercentComplete: 250, + ///PercentWorkComplete + PercentWorkComplete: 251, + ///Predecessors + Predecessors: 252, + ///PreleveledFinish + PreleveledFinish: 253, + ///PreleveledStart + PreleveledStart: 254, + ///Priority + Priority: 255, + ///Active + Active: 256, + ///Critical + Critical: 257, + ///Milestone + Milestone: 258, + ///Overallocated + Overallocated: 259, + ///IsRollup + IsRollup: 260, + ///Summary + Summary: 261, + ///RegularWork + RegularWork: 262, + ///RemainingCost + RemainingCost: 263, + ///RemainingDuration + RemainingDuration: 264, + ///RemainingOvertimeCost + RemainingOvertimeCost: 265, + ///RemainingWork + RemainingWork: 266, + ///ResourceNames + ResourceNames: 267, + ///ResourceNames + ResourceNames: 268, + ///Cost + Cost: 269, + ///Finish + Finish: 270, + ///Start + Start: 271, + ///Work + Work: 272, + ///StartSlack + StartSlack: 273, + ///Status + Status: 274, + ///Successors + Successors: 275, + ///StatusManager + StatusManager: 276, + ///TotalSlack + TotalSlack: 277, + ///TaskGUID + TaskGUID: 278, + ///Type + Type: 279, + ///WBS + WBS: 280, + ///WBSPREDECESSORS + WBSPREDECESSORS: 281, + ///WBSSUCCESSORS + WBSSUCCESSORS: 282, + ///WSSID + WSSID: 283 + } + }, + ProjectResourceFields: { + value: { + ///Accrual + Accrual: 0, + ///ActualCost + ActualCost: 1, + ///ActualOvertimeCost + ActualOvertimeCost: 2, + ///ActualOvertimeWork + ActualOvertimeWork: 3, + ///ActualOvertimeWorkProtected + ActualOvertimeWorkProtected: 4, + ///ActualWork + ActualWork: 5, + ///ActualWorkProtected + ActualWorkProtected: 6, + ///BaseCalendar + BaseCalendar: 7, + ///Baseline10BudgetCost + Baseline10BudgetCost: 8, + ///Baseline10BudgetWork + Baseline10BudgetWork: 9, + ///Baseline10Cost + Baseline10Cost: 10, + ///Baseline10Work + Baseline10Work: 11, + ///Baseline1BudgetCost + Baseline1BudgetCost: 12, + ///Baseline1BudgetWork + Baseline1BudgetWork: 13, + ///Baseline1Cost + Baseline1Cost: 14, + ///Baseline1Work + Baseline1Work: 15, + ///Baseline2BudgetCost + Baseline2BudgetCost: 16, + ///Baseline2BudgetWork + Baseline2BudgetWork: 17, + ///Baseline2Cost + Baseline2Cost: 18, + ///Baseline2Work + Baseline2Work: 19, + ///Baseline3BudgetCost + Baseline3BudgetCost: 20, + ///Baseline3BudgetWork + Baseline3BudgetWork: 21, + ///Baseline3Cost + Baseline3Cost: 22, + ///Baseline3Work + Baseline3Work: 23, + ///Baseline4BudgetCost + Baseline4BudgetCost: 24, + ///Baseline4BudgetWork + Baseline4BudgetWork: 25, + ///Baseline4Cost + Baseline4Cost: 26, + ///Baseline4Work + Baseline4Work: 27, + ///Baseline5BudgetCost + Baseline5BudgetCost: 28, + ///Baseline5BudgetWork + Baseline5BudgetWork: 29, + ///Baseline5Cost + Baseline5Cost: 30, + ///Baseline5Work + Baseline5Work: 31, + ///Baseline6BudgetCost + Baseline6BudgetCost: 32, + ///Baseline6BudgetWork + Baseline6BudgetWork: 33, + ///Baseline6Cost + Baseline6Cost: 34, + ///Baseline6Work + Baseline6Work: 35, + ///Baseline7BudgetCost + Baseline7BudgetCost: 36, + ///Baseline7BudgetWork + Baseline7BudgetWork: 37, + ///Baseline7Cost + Baseline7Cost: 38, + ///Baseline7Work + Baseline7Work: 39, + ///Baseline8BudgetCost + Baseline8BudgetCost: 40, + ///Baseline8BudgetWork + Baseline8BudgetWork: 41, + ///Baseline8Cost + Baseline8Cost: 42, + ///Baseline8Work + Baseline8Work: 43, + ///Baseline9BudgetCost + Baseline9BudgetCost: 44, + ///Baseline9BudgetWork + Baseline9BudgetWork: 45, + ///Baseline9Cost + Baseline9Cost: 46, + ///Baseline9Work + Baseline9Work: 47, + ///BaselineBudgetCost + BaselineBudgetCost: 48, + ///BaselineBudgetWork + BaselineBudgetWork: 49, + ///BaselineCost + BaselineCost: 50, + ///BaselineWork + BaselineWork: 51, + ///BudgetCost + BudgetCost: 52, + ///BudgetWork + BudgetWork: 53, + ///ResourceCalendarGUID + ResourceCalendarGUID: 54, + ///Code + Code: 55, + ///Cost1 + Cost1: 56, + ///Cost10 + Cost10: 57, + ///Cost2 + Cost2: 58, + ///Cost3 + Cost3: 59, + ///Cost4 + Cost4: 60, + ///Cost5 + Cost5: 61, + ///Cost6 + Cost6: 62, + ///Cost7 + Cost7: 63, + ///Cost8 + Cost8: 64, + ///Cost9 + Cost9: 65, + ///ResourceCreationDate + ResourceCreationDate: 66, + ///Date1 + Date1: 67, + ///Date10 + Date10: 68, + ///Date2 + Date2: 69, + ///Date3 + Date3: 70, + ///Date4 + Date4: 71, + ///Date5 + Date5: 72, + ///Date6 + Date6: 73, + ///Date7 + Date7: 74, + ///Date8 + Date8: 75, + ///Date9 + Date9: 76, + ///Duration1 + Duration1: 77, + ///Duration10 + Duration10: 78, + ///Duration2 + Duration2: 79, + ///Duration3 + Duration3: 80, + ///Duration4 + Duration4: 81, + ///Duration5 + Duration5: 82, + ///Duration6 + Duration6: 83, + ///Duration7 + Duration7: 84, + ///Duration8 + Duration8: 85, + ///Duration9 + Duration9: 86, + ///Email + Email: 87, + ///End + End: 88, + ///Finish1 + Finish1: 89, + ///Finish10 + Finish10: 90, + ///Finish2 + Finish2: 91, + ///Finish3 + Finish3: 92, + ///Finish4 + Finish4: 93, + ///Finish5 + Finish5: 94, + ///Finish6 + Finish6: 95, + ///Finish7 + Finish7: 96, + ///Finish8 + Finish8: 97, + ///Finish9 + Finish9: 98, + ///Flag10 + Flag10: 99, + ///Flag1 + Flag1: 100, + ///Flag11 + Flag11: 101, + ///Flag12 + Flag12: 102, + ///Flag13 + Flag13: 103, + ///Flag14 + Flag14: 104, + ///Flag15 + Flag15: 105, + ///Flag16 + Flag16: 106, + ///Flag17 + Flag17: 107, + ///Flag18 + Flag18: 108, + ///Flag19 + Flag19: 109, + ///Flag2 + Flag2: 110, + ///Flag20 + Flag20: 111, + ///Flag3 + Flag3: 112, + ///Flag4 + Flag4: 113, + ///Flag5 + Flag5: 114, + ///Flag6 + Flag6: 115, + ///Flag7 + Flag7: 116, + ///Flag8 + Flag8: 117, + ///Flag9 + Flag9: 118, + ///Group + Group: 119, + ///Units + Units: 120, + ///Name + Name: 121, + ///Notes + Notes: 122, + ///Number1 + Number1: 123, + ///Number10 + Number10: 124, + ///Number11 + Number11: 125, + ///Number12 + Number12: 126, + ///Number13 + Number13: 127, + ///Number14 + Number14: 128, + ///Number15 + Number15: 129, + ///Number16 + Number16: 130, + ///Number17 + Number17: 131, + ///Number18 + Number18: 132, + ///Number19 + Number19: 133, + ///Number2 + Number2: 134, + ///Number20 + Number20: 135, + ///Number3 + Number3: 136, + ///Number4 + Number4: 137, + ///Number5 + Number5: 138, + ///Number6 + Number6: 139, + ///Number7 + Number7: 140, + ///Number8 + Number8: 141, + ///Number9 + Number9: 142, + ///OvertimeCost + OvertimeCost: 143, + ///OvertimeRate + OvertimeRate: 144, + ///OvertimeWork + OvertimeWork: 145, + ///PercentWorkComplete + PercentWorkComplete: 146, + ///CostPerUse + CostPerUse: 147, + ///Generic + Generic: 148, + ///OverAllocated + OverAllocated: 149, + ///RegularWork + RegularWork: 150, + ///RemainingCost + RemainingCost: 151, + ///RemainingOvertimeCost + RemainingOvertimeCost: 152, + ///RemainingOvertimeWork + RemainingOvertimeWork: 153, + ///RemainingWork + RemainingWork: 154, + ///ResourceGUID + ResourceGUID: 155, + ///Cost + Cost: 156, + ///Work + Work: 157, + ///Start + Start: 158, + ///Start1 + Start1: 159, + ///Start10 + Start10: 160, + ///Start2 + Start2: 161, + ///Start3 + Start3: 162, + ///Start4 + Start4: 163, + ///Start5 + Start5: 164, + ///Start6 + Start6: 165, + ///Start7 + Start7: 166, + ///Start8 + Start8: 167, + ///Start9 + Start9: 168, + ///StandardRate + StandardRate: 169, + ///Text1 + Text1: 170, + ///Text10 + Text10: 171, + ///Text11 + Text11: 172, + ///Text12 + Text12: 173, + ///Text13 + Text13: 174, + ///Text14 + Text14: 175, + ///Text15 + Text15: 176, + ///Text16 + Text16: 177, + ///Text17 + Text17: 178, + ///Text18 + Text18: 179, + ///Text19 + Text19: 180, + ///Text2 + Text2: 181, + ///Text20 + Text20: 182, + ///Text21 + Text21: 183, + ///Text22 + Text22: 184, + ///Text23 + Text23: 185, + ///Text24 + Text24: 186, + ///Text25 + Text25: 187, + ///Text26 + Text26: 188, + ///Text27 + Text27: 189, + ///Text28 + Text28: 190, + ///Text29 + Text29: 191, + ///Text3 + Text3: 192, + ///Text30 + Text30: 193, + ///Text4 + Text4: 194, + ///Text5 + Text5: 195, + ///Text6 + Text6: 196, + ///Text7 + Text7: 197, + ///Text8 + Text8: 198, + ///Text9 + Text9: 199 + } + }, + context: { + contents: { + document: { + contents: { + getSelectedTaskAsync: { + conditions: { reqs: ["method Document.getSelectedTaskAsync"] }, + value: function (callback) { + /// (Project only) Get the current selected Task's Id. + ///The optional callback method + } + }, + getTaskByIndexAsync: { + conditions: { reqs: ["method Document.getTaskByIndexAsync"] }, + value: function (taskIndex, callback) { + /// (Project only) Get the Task's Id for provided task index. + ///Task index in task container + ///The optional callback method + } + }, + getTaskAsync: { + conditions: { reqs: ["method Document.getTaskAsync"] }, + value: function (taskId, callback) { + /// (Project only) Get the Task Name, WSS Task Id, and ResourceNames for given taskId . + ///Either a string or value of the Task Id. + ///The optional callback method + } + }, + getTaskFieldAsync: { + conditions: { reqs: ["method Document.getTaskFieldAsync"] }, + value: function (taskId, taskField, callback) { + /// (Project only) Get task field for provided task Id. (Ex. StartDate). + ///Either a string or value of the Task Id. + ///Task Fields. + ///The optional callback method + + } + }, + getSelectedResourceAsync: { + conditions: { reqs: ["method Document.getSelectedResourceAsync"] }, + value: function (callback) { + /// (Project only) Get the current selected Resource's Id. + ///The optional callback method + } + }, + getResourceByIndexAsync: { + conditions: { reqs: ["method Document.getResourceByIndexAsync"] }, + value: function (resourceIndex, callback) { + /// (Project only) Get the Resource's Id for provided resource index. + ///Resource index in resource container + ///The optional callback method + } + }, + getResourceFieldAsync: { + conditions: { reqs: ["method Document.getResourceFieldAsync"] }, + value: function (resourceId, resourceField, callback) { + /// (Project only) Get resource field for provided resource Id. (Ex.ResourceName) + ///Either a string or value of the Resource Id. + ///Resource Fields. + ///The optional callback method + } + }, + getProjectFieldAsync: { + conditions: { reqs: ["method Document.getProjectFieldAsync"] }, + value: function (projectField, callback) { + /// (Project only) Get Project field (Ex. ProjectWebAccessURL). + ///Project level fields. + ///The optional callback method + } + }, + getSelectedViewAsync: { + conditions: { reqs: ["method Document.getSelectedViewAsync"] }, + value: function (callback) { + /// (Project only) Get the current selected View Type (Ex. Gantt) and View Name. + ///The optional callback method + } + }, + getWSSURLAsync: { + conditions: { reqs: ["method Document.getWSSURLAsync"] }, + value: function (callback) { + /// (Project only) Get the WSS Url and list name for the Tasks List, the MPP is synced too. + ///The optional callback method + } + }, + setTaskFieldAsync: { + conditions: { reqs: ["method Document.setTaskFieldAsync"] }, + value: function (taskId, fieldId, fieldValue, callback) { + /// (Project only) Set Taskfield (Ex. TaskName). + ///Either a string or value of the Task Id. + ///Task Field. + ///Either a string, number boolean or object for the data that you want to set. + ///The optional callback method + } + }, + setResourceFieldAsync: { + conditions: { reqs: ["method Document.setResourceFieldAsync"] }, + value: function (resourceId, fieldId, fieldValue, callback) { + /// (Project only) Set Resource field (Ex. ResourceName). + ///Either a string or value of the Resource Id. + ///Resource Field. + ///Either a string, number boolean or object for the data that you want to set. + ///The optional callback method + } + } + } + } + } + } + } +}); + +// Setup outlook +Office._processItem(Office, { + metaOnly: true, + conditions: { + hosts: ["outlook", "outlookcompose"], + reqs: ["set Mailbox GE 1.1"] + }, + contents: { + MailboxEnums: { + value: new Office._MailboxEnums() + }, + context: { + contents: { + mailbox: { + value: new Office._context_mailbox() + }, + roamingSettings: { + value: new Office._settings() + } + } + }, + cast: { + value: { + item: new Office._cast_item() + } + } + } +}) + +// Setup CustomXMLParts +Office._addEnumOnObject("CustomXmlNodeType", + { + ///Element + Element: "element", + ///Attribute + Attribute: "attribute", + ///String/field> + Text: "text", + ///CData + Cdata: "cdata", + ///ProcessingInstruction + ProcessingInstruction: "processingInstruction", + ///NodeComment + NodeComment: "nodeComment", + ///NodeDocument + NodeDocument: "nodeDocument" + }, + Office, + { + hosts: ["word"] + } +); + +// Other enumerations on Office +Office._addEnumOnObject("AsyncResultStatus", + { + ///Operation failed, check error object + Failed: "failed", + ///Operation succeeded + Succeeded: "succeeded" + + }, + Office, + { + hosts: ["not outlook; not outlookcompose"] + } +); + +Office._processItem(Office, + { + contents: { + Text: { + conditions: { + hosts: ["excel", "word"], + reqs: ["set TextBindings GE 1.1"] + }, + annotate: { + ///Text based Binding + Text: undefined + }, + value: "text" + }, + Matrix: { + conditions: { + hosts: ["excel", "word"], + reqs: ["set MatrixBindings GE 1.1"] + }, + annotate: { + ///Matrix based Binding + Matrix: undefined + }, + value: "matrix" + }, + Table: { + conditions: { + hosts: ["excel", "word", "accesswebapp"], + reqs: ["set TableBindings GE 1.1"] + }, + annotate: { + ///Table based Binding + Table: undefined + }, + value: "table" + } + } + }, + "BindingType" +); + +Office._processItem(Office, + { + contents: { + Table: { + conditions: { + hosts: ["word", "excel", "accesswebapp"], + reqs: ["set TableCoercion GE 1.1"] + }, + annotate: { + ///Coerce as Table + Table: undefined + }, + value: "table" + }, + Text: { + conditions: { + hosts: ["excel", "ppt", "project", "word"], + reqs: ["set TextCoercion GE 1.1"] + }, + annotate: { + ///Coerce as Text + Text: undefined + }, + value: "text" + }, + Matrix: { + conditions: { + hosts: ["excel", "word"], + reqs: ["set MatrixCoercion GE 1.1"] + }, + annotate: { + ///Coerce as Matrix + Matrix: undefined + }, + value: "matrix" + }, + Html: { + conditions: { + hosts: ["word"], + reqs: ["set HtmlCoercion GE 1.1"] + }, + annotate: { + ///Coerce as HTML + Html: undefined + }, + value: "html" + }, + Ooxml: { + conditions: { + hosts: ["word"], + reqs: ["set OoxmlCoercion GE 1.1"] + }, + annotate: { + ///Coerce as Office Open XML + Ooxml: undefined + }, + value: "ooxml" + }, + SlideRange: { + conditions: { + hosts: ["ppt"] + }, + annotate: { + ///Coerce as JSON object containing an array of the ids, titles, and indexes of the selected slides. + SlideRange: undefined + }, + value: "slideRange" + } + } + }, + "CoercionType" +); + +Office._addEnumOnObject("DocumentMode", + { + ///Document in Read Only Mode + ReadOnly: "readOnly", + ///Document in Read/Write Mode + ReadWrite: "readWrite" + }, + Office, + { + hosts: ["word", "excel", "accesswebapp"] + } +); + +Office._addEnumOnObject("EventType", + { + ///Triggers when a document level selection happens + DocumentSelectionChanged: "documentSelectionChanged", + /// Triggers when a binding level selection happens + BindingSelectionChanged: "bindingSelectionChanged", + ///Triggers when a binding level data change happens + BindingDataChanged: "bindingDataChanged", + ///Triggers when settings change in a co-Auth session. + SettingsChanged: "settingsChanged", + ///Triggers when a customXmlPart node was deleted + NodeDeleted: "nodeDeleted", + ///Triggers when a customXmlPart node was inserted + NodeInserted: "nodeInserted", + ///Triggers when a customXmlPart node was replaced + NodeReplaced: "nodeReplaced", + ///Triggers when a Task selection happens in Project. + TaskSelectionChanged: "taskSelectionChanged", + /// Triggers when a Resource selection happens in Project. + ResourceSelectionChanged: "resourceSelectionChanged", + ///Triggers when a View selection happens in Project. + ViewSelectionChanged: "viewSelectionChanged" + }, + Office, + { + hosts: ["not outlook; not outlookcompose"] + } +); +// EventType augmentations +Office._processContents(Office.EventType, { + ActiveViewChanged: { + conditions: { + hosts: ["ppt"] + }, + annotate: { + ///Occurs when the user changes the current view of the document. + ActiveViewChanged: undefined + }, + value: "activeViewChanged" + } +}); + +Office._processItem(Office, + { + conditions: { hosts: ["not outlook; not outlookcompose; not accesswebapp"] }, + contents: { + Compressed: { + conditions: { + hosts: ["ppt", "word"], + reqs: ["set CompressedFile GE 1.1"] + }, + annotate: { + ///Returns the file as a byte array + Compressed: undefined + }, + value: "compressed" + }, + Pdf: { + conditions: { + hosts: ["ppt", "word"], + reqs: ["set PdfFile GE 1.1"] + }, + annotate: { + ///Returns the file in PDF format as a byte array + Pdf: undefined + }, + value: "pdf" + }, + Text: { + conditions: { + hosts: ["word"], + reqs: ["set TextFile GE 1.1"] + }, + annotate: { + ///Returns the file as plain text + Text: undefined + }, + value: "text" + } + } + }, + "FileType" +); + +Office._addEnumOnObject("FilterType", + { + ///Returns all items + All: "all", + ///Returns only visible items + OnlyVisible: "onlyVisible" + }, + Office, + { + hosts: ["not outlook; not outlookcompose; not accesswebapp"] + } +); + +Office._addEnumOnObject("InitializationReason", + { + ///Indicates the app was just inserted in the document /field> + Inserted: "inserted", + ///Indicated if the extension already existed in the document + DocumentOpened: "documentOpened" + }, + Office, + { + hosts: ["not outlook; not outlookcompose"] + } +); + +Office._addEnumOnObject("ValueFormat", + { + ///Returns items with format + Formatted: "formatted", + ///Returns items without format + Unformatted: "unformatted" + }, + Office, + { + hosts: ["not outlook; not outlookcompose"] + } +); + +Office._processContents(Office, { + GoToType: { + contents: { + Binding: { + conditions: { + hosts: ["excel", "word"] + }, + annotate: { + ///Goes to a binding object using the specified binding id. + Binding: undefined + }, + value: "binding" + }, + NamedItem: { + conditions: { + hosts: ["excel"] + }, + annotate: { + /// + /// Goes to a named item using that item's name. + /// In Excel, you can use any structured reference for a named range or table: "Worksheet2!Table1" + /// + NamedItem: undefined + }, + value: "namedItem" + }, + Slide: { + conditions: { + hosts: ["ppt"] + }, + annotate: { + ///Goes to a slide using the specified id. + Slide: undefined + }, + value: "slide" + }, + Index: { + conditions: { + hosts: ["ppt"] + }, + annotate: { + ///Goes to the specified index by slide number or enum Office.Index + Index: undefined + }, + value: "index" + } + } + } +}); + +Office._addEnumOnObject("Index", + { + First: "first", + Last: "last", + Next: "next", + Previous: "previous" + }, + Office, + { + hosts: ["ppt"] + } +); + +Office._addEnumOnObject("SelectionMode", + { + Default: "default", + Selected: "selected", + None: "none" + }, + Office, + { + hosts: ["word"] + } +); + +if (!!intellisense) { + intellisense.addEventListener('statementcompletion', function (event) { + if (event.targetName === "this" || event.target === undefined || event.target === window) return; + event.items = event.items.filter(function (item) { + return !(item.name && item.name.charAt(0) === "_"); + }); + }); +} + +Office._processContents(Office, Office._items); + +document.addEventListener("DOMContentLoaded", function () { + Office.initialize(); +}); + +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; + +var OfficeExtension; +(function (OfficeExtension) { + var ClientObject = (function () { + function ClientObject() { + /// + /// An abstract proxy object that represents an object in an Office document. You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the proxy object state with the document by calling "context.sync()". + /// + /// + } + return ClientObject; + })(); + OfficeExtension.ClientObject = ClientObject; +})(OfficeExtension || (OfficeExtension = {})); + +var OfficeExtension; +(function (OfficeExtension) { + var ClientRequestContext = (function () { + function ClientRequestContext(url) { + /// + /// An abstract RequestContext object that facilitates requests to the host Office application. The "Excel.run" and "Word.run" methods provide a request context. + /// + /// Collection of objects that are tracked for automatic adjustments based on surrounding changes in the document. + } + ClientRequestContext.prototype.load = function (object, option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + }; + ClientRequestContext.prototype.trace = function (message) { + /// + /// Adds a trace message to the queue. If the promise returned by "context.sync()" is rejected due to an error, this adds a ".traceMessages" array to the OfficeExtension.Error object, containing all trace messages that were executed. These messages can help you monitor the program execution sequence and detect the cause of the error. + /// + /// + }; + ClientRequestContext.prototype.sync = function (passThroughValue) { + /// + /// Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context and retrieving properties of loaded Office objects for use in your code.ÿThis method returns a promise, which is resolved when the synchronization is complete. + /// + /// + return new OfficeExtension.IPromise(); + }; + ClientRequestContext.prototype.__proto__ = null; + return ClientRequestContext; + })(); + OfficeExtension.ClientRequestContext = ClientRequestContext; +})(OfficeExtension || (OfficeExtension = {})); + +var OfficeExtension; +(function (OfficeExtension) { + var ClientResult = (function () { + function ClientResult() { + /// + /// Contains the result for methods that return primitive types. The object's value property is retrieved from the document after "context.sync()" is invoked. + /// + /// + /// The value of the result that is retrieved from the document after "context.sync()" is invoked. + /// + } + ClientResult.prototype.__proto__ = null; + return ClientResult; + })(); + OfficeExtension.ClientResult = ClientResult; +})(OfficeExtension || (OfficeExtension = {})); + +var OfficeExtension; +(function (OfficeExtension) { + var Error = (function () { + function Error() { + /// + /// The error object returned by "context.sync()", if a promise is rejected due to an error while processing the request. + /// + /// + /// Error name: "OfficeExtension.Error" + /// + /// + /// The error message passed through from the host Office application. + /// + /// + /// Stack trace, if applicable. + /// + /// + /// Error code string, such as "InvalidArgument". + /// + /// + /// Trace messages (if any) that were added via a "context.trace()" invocation before calling "context.sync()". If there was an error, this contains all trace messages that were executed before the error occurred. These messages can help you monitor the program execution sequence and detect the case of the error. + /// + /// + /// Debug info, if applicable. The ".errorLocation" property can describe the object and method or property that caused the error. + /// + this.debugInfo = { + __proto__: null, + /// + /// If applicable, will return the object type and the name of the method or property that caused the error. + /// + errorLocation: "" + }; + } + Error.prototype.__proto__ = null; + return Error; + })(); + OfficeExtension.Error = Error; +})(OfficeExtension || (OfficeExtension = {})); + +var OfficeExtension; +(function (OfficeExtension) { + var ErrorCodes = (function () { + function ErrorCodes() { + } + ErrorCodes.__proto__ = null; + ErrorCodes.accessDenied = ""; + ErrorCodes.generalException = ""; + ErrorCodes.activityLimitReached = ""; + return ErrorCodes; + })(); +})(OfficeExtension || (OfficeExtension = {})); + +var OfficeExtension; +(function (OfficeExtension) { + var IPromise = (function () { + /// + /// A Promise object that represents a deferred interaction with the host Office application. Promises can be chained via ".then", and errors can be caught via ".catch". Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. + /// + IPromise.prototype.then = function (onFulfilled, onRejected) { + /// + /// This method will be called once the previous promise has been resolved. + /// Both the onFulfilled on onRejected callbacks are optional. + /// If either or both are omitted, the next onFulfilled/onRejected in the chain will be called called. + /// Returns a new promise for the value or error that was returned from onFulfilled/onRejected. + /// + /// + /// + /// + onRejected(new Error()); + } + IPromise.prototype.catch = function (onRejected) { + /// + /// Catches failures or exceptions from actions within the promise, or from an unhandled exception earlier in the call stack. + /// + /// function to be called if or when the promise rejects. + /// + onRejected(new Error()); + } + IPromise.prototype.__proto__ = null; + }) + OfficeExtension.IPromise = IPromise; +})(OfficeExtension || (OfficeExtension = {})); + +var OfficeExtension; +(function (OfficeExtension) { + var TrackedObjects = (function () { + function TrackedObjects() { + /// + /// Collection of tracked objects, contained within a request context. See "context.trackedObjects" for more information. + /// + } + TrackedObjects.prototype.add = function (object) { + /// + /// Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. + /// + /// + }; + TrackedObjects.prototype.remove = function (object) { + /// + /// Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + /// + /// + }; + TrackedObjects.prototype.__proto__ = null; + return TrackedObjects; + })(); + OfficeExtension.TrackedObjects = TrackedObjects; +})(OfficeExtension || (OfficeExtension = {})); + +OfficeExtension.__proto__ = null; + + + +var Excel; +(function (Excel) { + var Application = (function(_super) { + __extends(Application, _super); + function Application() { + /// Represents the Excel application that manages the workbook. + /// The request context associated with this object + /// Returns the calculation mode used in the workbook. See Excel.CalculationMode for details. Read-only. + } + + Application.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Application.prototype.calculate = function(calculationType) { + /// + /// Recalculate all currently opened workbooks in Excel. + /// + /// Specifies the calculation type to use. See Excel.CalculationType for details. + /// + } + return Application; + })(OfficeExtension.ClientObject); + Excel.Application = Application; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var Binding = (function(_super) { + __extends(Binding, _super); + function Binding() { + /// Represents an Office.js binding that is defined in the workbook. + /// The request context associated with this object + /// Represents binding identifier. Read-only. + /// Returns the type of the binding. See Excel.BindingType for details. Read-only. + } + + Binding.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Binding.prototype.getRange = function() { + /// + /// Returns the range represented by the binding. Will throw an error if binding is not of the correct type. + /// + /// + } + Binding.prototype.getTable = function() { + /// + /// Returns the table represented by the binding. Will throw an error if binding is not of the correct type. + /// + /// + } + Binding.prototype.getText = function() { + /// + /// Returns the text represented by the binding. Will throw an error if binding is not of the correct type. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + return Binding; + })(OfficeExtension.ClientObject); + Excel.Binding = Binding; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var BindingCollection = (function(_super) { + __extends(BindingCollection, _super); + function BindingCollection() { + /// Represents the collection of all the binding objects that are part of the workbook. + /// The request context associated with this object + /// Returns the number of bindings in the collection. Read-only. + /// Gets the loaded child items in this collection. + } + + BindingCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + BindingCollection.prototype.getItem = function(id) { + /// + /// Gets a binding object by ID. + /// + /// Id of the binding object to be retrieved. + /// + } + BindingCollection.prototype.getItemAt = function(index) { + /// + /// Gets a binding object based on its position in the items array. + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return BindingCollection; + })(OfficeExtension.ClientObject); + Excel.BindingCollection = BindingCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var BindingType = { + __proto__: null, + "range": "range", + "table": "table", + "text": "text", + } + Excel.BindingType = BindingType; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var BorderIndex = { + __proto__: null, + "edgeTop": "edgeTop", + "edgeBottom": "edgeBottom", + "edgeLeft": "edgeLeft", + "edgeRight": "edgeRight", + "insideVertical": "insideVertical", + "insideHorizontal": "insideHorizontal", + "diagonalDown": "diagonalDown", + "diagonalUp": "diagonalUp", + } + Excel.BorderIndex = BorderIndex; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var BorderLineStyle = { + __proto__: null, + "none": "none", + "continuous": "continuous", + "dash": "dash", + "dashDot": "dashDot", + "dashDotDot": "dashDotDot", + "dot": "dot", + "double": "double", + "slantDashDot": "slantDashDot", + } + Excel.BorderLineStyle = BorderLineStyle; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var BorderWeight = { + __proto__: null, + "hairline": "hairline", + "thin": "thin", + "medium": "medium", + "thick": "thick", + } + Excel.BorderWeight = BorderWeight; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var CalculationMode = { + __proto__: null, + "automatic": "automatic", + "automaticExceptTables": "automaticExceptTables", + "manual": "manual", + } + Excel.CalculationMode = CalculationMode; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var CalculationType = { + __proto__: null, + "recalculate": "recalculate", + "full": "full", + "fullRebuild": "fullRebuild", + } + Excel.CalculationType = CalculationType; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var Chart = (function(_super) { + __extends(Chart, _super); + function Chart() { + /// Represents a chart object in a workbook. + /// The request context associated with this object + /// Represents chart axes. Read-only. + /// Represents the datalabels on the chart. Read-only. + /// Encapsulates the format properties for the chart area. Read-only. + /// Represents the height, in points, of the chart object. + /// The distance, in points, from the left side of the chart to the worksheet origin. + /// Represents the legend for the chart. Read-only. + /// Represents the name of a chart object. + /// Represents either a single series or collection of series in the chart. Read-only. + /// Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only. + /// Represents the distance, in points, from the top edge of the object to the top of row 1 (on a worksheet) or the top of the chart area (on a chart). + /// Represents the width, in points, of the chart object. + } + + Chart.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Chart.prototype.delete = function() { + /// + /// Deletes the chart object. + /// + /// + } + Chart.prototype.setData = function(sourceData, seriesBy) { + /// + /// Resets the source data for the chart. + /// + /// The Range object corresponding to the source data. + /// Specifies the way columns or rows are used as data series on the chart. Can be one of the following: Auto (default), Rows, Columns. See Excel.ChartSeriesBy for details. + /// + } + Chart.prototype.setPosition = function(startCell, endCell) { + /// + /// Positions the chart relative to cells on the worksheet. + /// + /// The start cell. This is where the chart will be moved to. The start cell is the top-left or top-right cell, depending on the user's right-to-left display settings. + /// (Optional) The end cell. If specified, the chart's width and height will be set to fully cover up this cell/range. + /// + } + return Chart; + })(OfficeExtension.ClientObject); + Excel.Chart = Chart; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartAreaFormat = (function(_super) { + __extends(ChartAreaFormat, _super); + function ChartAreaFormat() { + /// Encapsulates the format properties for the overall chart area. + /// The request context associated with this object + /// Represents the fill format of an object, which includes background formatting information. Read-only. + /// Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only. + } + + ChartAreaFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartAreaFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAreaFormat = ChartAreaFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartAxes = (function(_super) { + __extends(ChartAxes, _super); + function ChartAxes() { + /// Represents the chart axes. + /// The request context associated with this object + /// Represents the category axis in a chart. Read-only. + /// Represents the series axis of a 3-dimensional chart. Read-only. + /// Represents the value axis in an axis. Read-only. + } + + ChartAxes.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartAxes; + })(OfficeExtension.ClientObject); + Excel.ChartAxes = ChartAxes; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartAxis = (function(_super) { + __extends(ChartAxis, _super); + function ChartAxis() { + /// Represents a single axis in a chart. + /// The request context associated with this object + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// Represents the interval between two major tick marks. Can be set to a numeric value or an empty string. The returned value is always a number. + /// Represents the maximum value on the value axis. Can be set to a numeric value or an empty string (for automatic axis values). The returned value is always a number. + /// Represents the minimum value on the value axis. Can be set to a numeric value or an empty string (for automatic axis values). The returned value is always a number. + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// Represents the interval between two minor tick marks. "Can be set to a numeric value or an empty string (for automatic axis values). The returned value is always a number. + /// Represents the axis title. Read-only. + } + + ChartAxis.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartAxis; + })(OfficeExtension.ClientObject); + Excel.ChartAxis = ChartAxis; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartAxisFormat = (function(_super) { + __extends(ChartAxisFormat, _super); + function ChartAxisFormat() { + /// Encapsulates the format properties for the chart axis. + /// The request context associated with this object + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// Represents chart line formatting. Read-only. + } + + ChartAxisFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartAxisFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAxisFormat = ChartAxisFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartAxisTitle = (function(_super) { + __extends(ChartAxisTitle, _super); + function ChartAxisTitle() { + /// Represents the title of a chart axis. + /// The request context associated with this object + /// Represents the formatting of chart axis title. Read-only. + /// Represents the axis title. + /// A boolean that specifies the visibility of an axis title. + } + + ChartAxisTitle.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartAxisTitle; + })(OfficeExtension.ClientObject); + Excel.ChartAxisTitle = ChartAxisTitle; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartAxisTitleFormat = (function(_super) { + __extends(ChartAxisTitleFormat, _super); + function ChartAxisTitleFormat() { + /// Represents the chart axis title formatting. + /// The request context associated with this object + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + } + + ChartAxisTitleFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartAxisTitleFormat; + })(OfficeExtension.ClientObject); + Excel.ChartAxisTitleFormat = ChartAxisTitleFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartCollection = (function(_super) { + __extends(ChartCollection, _super); + function ChartCollection() { + /// A collection of all the chart objects on a worksheet. + /// The request context associated with this object + /// Returns the number of charts in the worksheet. Read-only. + /// Gets the loaded child items in this collection. + } + + ChartCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + ChartCollection.prototype.add = function(type, sourceData, seriesBy) { + /// + /// Creates a new chart. + /// + /// Represents the type of a chart. See Excel.ChartType for details. + /// The Range object corresponding to the source data. + /// Specifies the way columns or rows are used as data series on the chart. See Excel.ChartSeriesBy for details. + /// + } + ChartCollection.prototype.getItem = function(name) { + /// + /// Gets a chart using its name. If there are multiple charts with the same name, the first one will be returned. + /// + /// Name of the chart to be retrieved. + /// + } + ChartCollection.prototype.getItemAt = function(index) { + /// + /// Gets a chart based on its position in the collection. + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return ChartCollection; + })(OfficeExtension.ClientObject); + Excel.ChartCollection = ChartCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartDataLabelFormat = (function(_super) { + __extends(ChartDataLabelFormat, _super); + function ChartDataLabelFormat() { + /// Encapsulates the format properties for the chart data labels. + /// The request context associated with this object + /// Represents the fill format of the current chart data label. Read-only. + /// Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only. + } + + ChartDataLabelFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartDataLabelFormat; + })(OfficeExtension.ClientObject); + Excel.ChartDataLabelFormat = ChartDataLabelFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartDataLabelPosition = { + __proto__: null, + "invalid": "invalid", + "none": "none", + "center": "center", + "insideEnd": "insideEnd", + "insideBase": "insideBase", + "outsideEnd": "outsideEnd", + "left": "left", + "right": "right", + "top": "top", + "bottom": "bottom", + "bestFit": "bestFit", + "callout": "callout", + } + Excel.ChartDataLabelPosition = ChartDataLabelPosition; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartDataLabels = (function(_super) { + __extends(ChartDataLabels, _super); + function ChartDataLabels() { + /// Represents a collection of all the data labels on a chart point. + /// The request context associated with this object + /// Represents the format of chart data labels, which includes fill and font formatting. Read-only. + /// DataLabelPosition value that represents the position of the data label. See Excel.ChartDataLabelPosition for details. + /// String representing the separator used for the data labels on a chart. + /// Boolean value representing if the data label bubble size is visible or not. + /// Boolean value representing if the data label category name is visible or not. + /// Boolean value representing if the data label legend key is visible or not. + /// Boolean value representing if the data label percentage is visible or not. + /// Boolean value representing if the data label series name is visible or not. + /// Boolean value representing if the data label value is visible or not. + } + + ChartDataLabels.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartDataLabels; + })(OfficeExtension.ClientObject); + Excel.ChartDataLabels = ChartDataLabels; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartFill = (function(_super) { + __extends(ChartFill, _super); + function ChartFill() { + /// Represents the fill formatting for a chart element. + /// The request context associated with this object + } + + ChartFill.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + ChartFill.prototype.clear = function() { + /// + /// Clear the fill color of a chart element. + /// + /// + } + ChartFill.prototype.setSolidColor = function(color) { + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// + /// HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). + /// + } + return ChartFill; + })(OfficeExtension.ClientObject); + Excel.ChartFill = ChartFill; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartFont = (function(_super) { + __extends(ChartFont, _super); + function ChartFont() { + /// This object represents the font attributes (font name, font size, color, etc.) for a chart object. + /// The request context associated with this object + /// Represents the bold status of font. + /// HTML color code representation of the text color. E.g. #FF0000 represents Red. + /// Represents the italic status of the font. + /// Font name (e.g. "Calibri") + /// Size of the font (e.g. 11) + /// Type of underline applied to the font. See Excel.ChartUnderlineStyle for details. + } + + ChartFont.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartFont; + })(OfficeExtension.ClientObject); + Excel.ChartFont = ChartFont; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartGridlines = (function(_super) { + __extends(ChartGridlines, _super); + function ChartGridlines() { + /// Represents major or minor gridlines on a chart axis. + /// The request context associated with this object + /// Represents the formatting of chart gridlines. Read-only. + /// Boolean value representing if the axis gridlines are visible or not. + } + + ChartGridlines.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartGridlines; + })(OfficeExtension.ClientObject); + Excel.ChartGridlines = ChartGridlines; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartGridlinesFormat = (function(_super) { + __extends(ChartGridlinesFormat, _super); + function ChartGridlinesFormat() { + /// Encapsulates the format properties for chart gridlines. + /// The request context associated with this object + /// Represents chart line formatting. Read-only. + } + + ChartGridlinesFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartGridlinesFormat; + })(OfficeExtension.ClientObject); + Excel.ChartGridlinesFormat = ChartGridlinesFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartLegend = (function(_super) { + __extends(ChartLegend, _super); + function ChartLegend() { + /// Represents the legend in a chart. + /// The request context associated with this object + /// Represents the formatting of a chart legend, which includes fill and font formatting. Read-only. + /// Boolean value for whether the chart legend should overlap with the main body of the chart. + /// Represents the position of the legend on the chart. See Excel.ChartLegendPosition for details. + /// A boolean value the represents the visibility of a ChartLegend object. + } + + ChartLegend.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartLegend; + })(OfficeExtension.ClientObject); + Excel.ChartLegend = ChartLegend; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartLegendFormat = (function(_super) { + __extends(ChartLegendFormat, _super); + function ChartLegendFormat() { + /// Encapsulates the format properties of a chart legend. + /// The request context associated with this object + /// Represents the fill format of an object, which includes background formating information. Read-only. + /// Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only. + } + + ChartLegendFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartLegendFormat; + })(OfficeExtension.ClientObject); + Excel.ChartLegendFormat = ChartLegendFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartLegendPosition = { + __proto__: null, + "invalid": "invalid", + "top": "top", + "bottom": "bottom", + "left": "left", + "right": "right", + "corner": "corner", + "custom": "custom", + } + Excel.ChartLegendPosition = ChartLegendPosition; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartLineFormat = (function(_super) { + __extends(ChartLineFormat, _super); + function ChartLineFormat() { + /// Enapsulates the formatting options for line elements. + /// The request context associated with this object + /// HTML color code representing the color of lines in the chart. + } + + ChartLineFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + ChartLineFormat.prototype.clear = function() { + /// + /// Clear the line format of a chart element. + /// + /// + } + return ChartLineFormat; + })(OfficeExtension.ClientObject); + Excel.ChartLineFormat = ChartLineFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartPoint = (function(_super) { + __extends(ChartPoint, _super); + function ChartPoint() { + /// Represents a point of a series in a chart. + /// The request context associated with this object + /// Encapsulates the format properties chart point. Read-only. + /// Returns the value of a chart point. Read-only. + } + + ChartPoint.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartPoint; + })(OfficeExtension.ClientObject); + Excel.ChartPoint = ChartPoint; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartPointFormat = (function(_super) { + __extends(ChartPointFormat, _super); + function ChartPointFormat() { + /// Represents formatting object for chart points. + /// The request context associated with this object + /// Represents the fill format of a chart, which includes background formating information. Read-only. + } + + ChartPointFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartPointFormat; + })(OfficeExtension.ClientObject); + Excel.ChartPointFormat = ChartPointFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartPointsCollection = (function(_super) { + __extends(ChartPointsCollection, _super); + function ChartPointsCollection() { + /// A collection of all the chart points within a series inside a chart. + /// The request context associated with this object + /// Returns the number of chart points in the collection. Read-only. + /// Gets the loaded child items in this collection. + } + + ChartPointsCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + ChartPointsCollection.prototype.getItemAt = function(index) { + /// + /// Retrieve a point based on its position within the series. + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return ChartPointsCollection; + })(OfficeExtension.ClientObject); + Excel.ChartPointsCollection = ChartPointsCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartSeries = (function(_super) { + __extends(ChartSeries, _super); + function ChartSeries() { + /// Represents a series in a chart. + /// The request context associated with this object + /// Represents the formatting of a chart series, which includes fill and line formatting. Read-only. + /// Represents the name of a series in a chart. + /// Represents a collection of all points in the series. Read-only. + } + + ChartSeries.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartSeries; + })(OfficeExtension.ClientObject); + Excel.ChartSeries = ChartSeries; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartSeriesBy = { + __proto__: null, + "auto": "auto", + "columns": "columns", + "rows": "rows", + } + Excel.ChartSeriesBy = ChartSeriesBy; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartSeriesCollection = (function(_super) { + __extends(ChartSeriesCollection, _super); + function ChartSeriesCollection() { + /// Represents a collection of chart series. + /// The request context associated with this object + /// Returns the number of series in the collection. Read-only. + /// Gets the loaded child items in this collection. + } + + ChartSeriesCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + ChartSeriesCollection.prototype.getItemAt = function(index) { + /// + /// Retrieves a series based on its position in the collection + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return ChartSeriesCollection; + })(OfficeExtension.ClientObject); + Excel.ChartSeriesCollection = ChartSeriesCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartSeriesFormat = (function(_super) { + __extends(ChartSeriesFormat, _super); + function ChartSeriesFormat() { + /// encapsulates the format properties for the chart series + /// The request context associated with this object + /// Represents the fill format of a chart series, which includes background formating information. Read-only. + /// Represents line formatting. Read-only. + } + + ChartSeriesFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartSeriesFormat; + })(OfficeExtension.ClientObject); + Excel.ChartSeriesFormat = ChartSeriesFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartTitle = (function(_super) { + __extends(ChartTitle, _super); + function ChartTitle() { + /// Represents a chart title object of a chart. + /// The request context associated with this object + /// Represents the formatting of a chart title, which includes fill and font formatting. Read-only. + /// Boolean value representing if the chart title will overlay the chart or not. + /// Represents the title text of a chart. + /// A boolean value the represents the visibility of a chart title object. + } + + ChartTitle.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartTitle; + })(OfficeExtension.ClientObject); + Excel.ChartTitle = ChartTitle; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartTitleFormat = (function(_super) { + __extends(ChartTitleFormat, _super); + function ChartTitleFormat() { + /// Provides access to the office art formatting for chart title. + /// The request context associated with this object + /// Represents the fill format of an object, which includes background formating information. Read-only. + /// Represents the font attributes (font name, font size, color, etc.) for an object. Read-only. + } + + ChartTitleFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ChartTitleFormat; + })(OfficeExtension.ClientObject); + Excel.ChartTitleFormat = ChartTitleFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartType = { + __proto__: null, + "invalid": "invalid", + "columnClustered": "columnClustered", + "columnStacked": "columnStacked", + "columnStacked100": "columnStacked100", + "_3DColumnClustered": "_3DColumnClustered", + "_3DColumnStacked": "_3DColumnStacked", + "_3DColumnStacked100": "_3DColumnStacked100", + "barClustered": "barClustered", + "barStacked": "barStacked", + "barStacked100": "barStacked100", + "_3DBarClustered": "_3DBarClustered", + "_3DBarStacked": "_3DBarStacked", + "_3DBarStacked100": "_3DBarStacked100", + "lineStacked": "lineStacked", + "lineStacked100": "lineStacked100", + "lineMarkers": "lineMarkers", + "lineMarkersStacked": "lineMarkersStacked", + "lineMarkersStacked100": "lineMarkersStacked100", + "pieOfPie": "pieOfPie", + "pieExploded": "pieExploded", + "_3DPieExploded": "_3DPieExploded", + "barOfPie": "barOfPie", + "xyscatterSmooth": "xyscatterSmooth", + "xyscatterSmoothNoMarkers": "xyscatterSmoothNoMarkers", + "xyscatterLines": "xyscatterLines", + "xyscatterLinesNoMarkers": "xyscatterLinesNoMarkers", + "areaStacked": "areaStacked", + "areaStacked100": "areaStacked100", + "_3DAreaStacked": "_3DAreaStacked", + "_3DAreaStacked100": "_3DAreaStacked100", + "doughnutExploded": "doughnutExploded", + "radarMarkers": "radarMarkers", + "radarFilled": "radarFilled", + "surface": "surface", + "surfaceWireframe": "surfaceWireframe", + "surfaceTopView": "surfaceTopView", + "surfaceTopViewWireframe": "surfaceTopViewWireframe", + "bubble": "bubble", + "bubble3DEffect": "bubble3DEffect", + "stockHLC": "stockHLC", + "stockOHLC": "stockOHLC", + "stockVHLC": "stockVHLC", + "stockVOHLC": "stockVOHLC", + "cylinderColClustered": "cylinderColClustered", + "cylinderColStacked": "cylinderColStacked", + "cylinderColStacked100": "cylinderColStacked100", + "cylinderBarClustered": "cylinderBarClustered", + "cylinderBarStacked": "cylinderBarStacked", + "cylinderBarStacked100": "cylinderBarStacked100", + "cylinderCol": "cylinderCol", + "coneColClustered": "coneColClustered", + "coneColStacked": "coneColStacked", + "coneColStacked100": "coneColStacked100", + "coneBarClustered": "coneBarClustered", + "coneBarStacked": "coneBarStacked", + "coneBarStacked100": "coneBarStacked100", + "coneCol": "coneCol", + "pyramidColClustered": "pyramidColClustered", + "pyramidColStacked": "pyramidColStacked", + "pyramidColStacked100": "pyramidColStacked100", + "pyramidBarClustered": "pyramidBarClustered", + "pyramidBarStacked": "pyramidBarStacked", + "pyramidBarStacked100": "pyramidBarStacked100", + "pyramidCol": "pyramidCol", + "_3DColumn": "_3DColumn", + "line": "line", + "_3DLine": "_3DLine", + "_3DPie": "_3DPie", + "pie": "pie", + "xyscatter": "xyscatter", + "_3DArea": "_3DArea", + "area": "area", + "doughnut": "doughnut", + "radar": "radar", + } + Excel.ChartType = ChartType; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ChartUnderlineStyle = { + __proto__: null, + "none": "none", + "single": "single", + } + Excel.ChartUnderlineStyle = ChartUnderlineStyle; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var ClearApplyTo = { + __proto__: null, + "all": "all", + "formats": "formats", + "contents": "contents", + } + Excel.ClearApplyTo = ClearApplyTo; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var DeleteShiftDirection = { + __proto__: null, + "up": "up", + "left": "left", + } + Excel.DeleteShiftDirection = DeleteShiftDirection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var HorizontalAlignment = { + __proto__: null, + "general": "general", + "left": "left", + "center": "center", + "right": "right", + "fill": "fill", + "justify": "justify", + "centerAcrossSelection": "centerAcrossSelection", + "distributed": "distributed", + } + Excel.HorizontalAlignment = HorizontalAlignment; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var InsertShiftDirection = { + __proto__: null, + "down": "down", + "right": "right", + } + Excel.InsertShiftDirection = InsertShiftDirection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var NamedItem = (function(_super) { + __extends(NamedItem, _super); + function NamedItem() { + /// Represents a defined name for a range of cells or value. Names can be primitive named objects (as seen in the type below), range object, reference to a range. This object can be used to obtain range object associated with names. + /// The request context associated with this object + /// The name of the object. Read-only. + /// Indicates what type of reference is associated with the name. See Excel.NamedItemType for details. Read-only. + /// Represents the formula that the name is defined to refer to. E.g. =Sheet14!$B$2:$H$12, =4.75, etc. Read-only. + /// Specifies whether the object is visible or not. + } + + NamedItem.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + NamedItem.prototype.getRange = function() { + /// + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. + /// + /// + } + return NamedItem; + })(OfficeExtension.ClientObject); + Excel.NamedItem = NamedItem; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var NamedItemCollection = (function(_super) { + __extends(NamedItemCollection, _super); + function NamedItemCollection() { + /// A collection of all the nameditem objects that are part of the workbook. + /// The request context associated with this object + /// Gets the loaded child items in this collection. + } + + NamedItemCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + NamedItemCollection.prototype.getItem = function(name) { + /// + /// Gets a nameditem object using its name + /// + /// nameditem name. + /// + } + return NamedItemCollection; + })(OfficeExtension.ClientObject); + Excel.NamedItemCollection = NamedItemCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var NamedItemType = { + __proto__: null, + "string": "string", + "integer": "integer", + "double": "double", + "boolean": "boolean", + "range": "range", + } + Excel.NamedItemType = NamedItemType; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var Range = (function(_super) { + __extends(Range, _super); + function Range() { + /// Range represents a set of one or more contiguous cells such as a cell, a row, a column, block of cells, etc. + /// The request context associated with this object + /// Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. Sheet1!A1:B4). Read-only. + /// Represents range reference for the specified range in the language of the user. Read-only. + /// Number of cells in the range. Read-only. + /// Represents the total number of columns in the range. Read-only. + /// Represents the column number of the first cell in the range. Zero-indexed. Read-only. + /// Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties. Read-only. + /// Represents the formula in A1-style notation. + /// Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German. + /// Represents Excel's number format code for the given cell. + /// Returns the total number of rows in the range. Read-only. + /// Returns the row number of the first cell in the range. Zero-indexed. Read-only. + /// Text values of the specified range. The Text value will not depend on the cell width. The # sign substitution that happens in Excel UI will not affect the text value returned by the API. Read-only. + /// Represents the type of data of each cell. Read-only. + /// Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cell that contain an error will return the error string. + /// The worksheet containing the current range. Read-only. + } + + Range.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Range.prototype.clear = function(applyTo) { + /// + /// Clear range values, format, fill, border, etc. + /// + /// Determines the type of clear action. See Excel.ClearApplyTo for details. + /// + } + Range.prototype.delete = function(shift) { + /// + /// Deletes the cells associated with the range. + /// + /// Specifies which way to shift the cells. See Excel.DeleteShiftDirection for details. + /// + } + Range.prototype.getBoundingRect = function(anotherRange) { + /// + /// Gets the smallest range object that encompasses the given ranges. For example, the GetBoundingRect of "B2:C5" and "D10:E15" is "B2:E16". + /// + /// The range object or address or range name. + /// + } + Range.prototype.getCell = function(row, column) { + /// + /// Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it's stays within the worksheet grid. The returned cell is located relative to the top left cell of the range. + /// + /// Row number of the cell to be retrieved. Zero-indexed. + /// Column number of the cell to be retrieved. Zero-indexed. + /// + } + Range.prototype.getColumn = function(column) { + /// + /// Gets a column contained in the range. + /// + /// Column number of the range to be retrieved. Zero-indexed. + /// + } + Range.prototype.getEntireColumn = function() { + /// + /// Gets an object that represents the entire column of the range. + /// + /// + } + Range.prototype.getEntireRow = function() { + /// + /// Gets an object that represents the entire row of the range. + /// + /// + } + Range.prototype.getIntersection = function(anotherRange) { + /// + /// Gets the range object that represents the rectangular intersection of the given ranges. + /// + /// The range object or range address that will be used to determine the intersection of ranges. + /// + } + Range.prototype.getLastCell = function() { + /// + /// Gets the last cell within the range. For example, the last cell of "B2:D5" is "D5". + /// + /// + } + Range.prototype.getLastColumn = function() { + /// + /// Gets the last column within the range. For example, the last column of "B2:D5" is "D2:D5". + /// + /// + } + Range.prototype.getLastRow = function() { + /// + /// Gets the last row within the range. For example, the last row of "B2:D5" is "B5:D5". + /// + /// + } + Range.prototype.getOffsetRange = function(rowOffset, columnOffset) { + /// + /// Gets an object which represents a range that's offset from the specified range. The dimension of the returned range will match this range. If the resulting range is forced outside the bounds of the worksheet grid, an exception will be thrown. + /// + /// The number of rows (positive, negative, or 0) by which the range is to be offset. Positive values are offset downward, and negative values are offset upward. + /// The number of columns (positive, negative, or 0) by which the range is to be offset. Positive values are offset to the right, and negative values are offset to the left. + /// + } + Range.prototype.getRow = function(row) { + /// + /// Gets a row contained in the range. + /// + /// Row number of the range to be retrieved. Zero-indexed. + /// + } + Range.prototype.getUsedRange = function() { + /// + /// Returns the used range of the given range object. + /// + /// + } + Range.prototype.insert = function(shift) { + /// + /// Inserts a cell or a range of cells into the worksheet in place of this range, and shifts the other cells to make space. Returns a new Range object at the now blank space. + /// + /// Specifies which way to shift the cells. See Excel.InsertShiftDirection for details. + /// + } + Range.prototype.select = function() { + /// + /// Selects the specified range in the Excel UI. + /// + /// + } + return Range; + })(OfficeExtension.ClientObject); + Excel.Range = Range; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var RangeBorder = (function(_super) { + __extends(RangeBorder, _super); + function RangeBorder() { + /// Represents the border of an object. + /// The request context associated with this object + /// HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). + /// Constant value that indicates the specific side of the border. See Excel.BorderIndex for details. Read-only. + /// One of the constants of line style specifying the line style for the border. See Excel.BorderLineStyle for details. + /// Specifies the weight of the border around a range. See Excel.BorderWeight for details. + } + + RangeBorder.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return RangeBorder; + })(OfficeExtension.ClientObject); + Excel.RangeBorder = RangeBorder; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var RangeBorderCollection = (function(_super) { + __extends(RangeBorderCollection, _super); + function RangeBorderCollection() { + /// Represents the border objects that make up range border. + /// The request context associated with this object + /// Number of border objects in the collection. Read-only. + /// Gets the loaded child items in this collection. + } + + RangeBorderCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + RangeBorderCollection.prototype.getItem = function(index) { + /// + /// Gets a border object using its name + /// + /// Index value of the border object to be retrieved. See Excel.BorderIndex for details. + /// + } + RangeBorderCollection.prototype.getItemAt = function(index) { + /// + /// Gets a border object using its index + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return RangeBorderCollection; + })(OfficeExtension.ClientObject); + Excel.RangeBorderCollection = RangeBorderCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var RangeFill = (function(_super) { + __extends(RangeFill, _super); + function RangeFill() { + /// Represents the background of a range object. + /// The request context associated with this object + /// HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") + } + + RangeFill.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + RangeFill.prototype.clear = function() { + /// + /// Resets the range background. + /// + /// + } + return RangeFill; + })(OfficeExtension.ClientObject); + Excel.RangeFill = RangeFill; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var RangeFont = (function(_super) { + __extends(RangeFont, _super); + function RangeFont() { + /// This object represents the font attributes (font name, font size, color, etc.) for an object. + /// The request context associated with this object + /// Represents the bold status of font. + /// HTML color code representation of the text color. E.g. #FF0000 represents Red. + /// Represents the italic status of the font. + /// Font name (e.g. "Calibri") + /// Font size. + /// Type of underline applied to the font. See Excel.RangeUnderlineStyle for details. + } + + RangeFont.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return RangeFont; + })(OfficeExtension.ClientObject); + Excel.RangeFont = RangeFont; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var RangeFormat = (function(_super) { + __extends(RangeFormat, _super); + function RangeFormat() { + /// A format object encapsulating the range's font, fill, borders, alignment, and other properties. + /// The request context associated with this object + /// Collection of border objects that apply to the overall range selected Read-only. + /// Returns the fill object defined on the overall range. Read-only. + /// Returns the font object defined on the overall range selected Read-only. + /// Represents the horizontal alignment for the specified object. See Excel.HorizontalAlignment for details. + /// Represents the vertical alignment for the specified object. See Excel.VerticalAlignment for details. + /// Indicates if Excel wraps the text in the object. A null value indicates that the entire range doesn't have uniform wrap setting + } + + RangeFormat.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return RangeFormat; + })(OfficeExtension.ClientObject); + Excel.RangeFormat = RangeFormat; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var RangeUnderlineStyle = { + __proto__: null, + "none": "none", + "single": "single", + "double": "double", + "singleAccountant": "singleAccountant", + "doubleAccountant": "doubleAccountant", + } + Excel.RangeUnderlineStyle = RangeUnderlineStyle; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var RangeValueType = { + __proto__: null, + "unknown": "unknown", + "empty": "empty", + "string": "string", + "integer": "integer", + "double": "double", + "boolean": "boolean", + "error": "error", + } + Excel.RangeValueType = RangeValueType; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var SheetVisibility = { + __proto__: null, + "visible": "visible", + "hidden": "hidden", + "veryHidden": "veryHidden", + } + Excel.SheetVisibility = SheetVisibility; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var Table = (function(_super) { + __extends(Table, _super); + function Table() { + /// Represents an Excel table. + /// The request context associated with this object + /// Represents a collection of all the columns in the table. Read-only. + /// Returns a value that uniquely identifies the table in a given workbook. The value of the identifier remains the same even when the table is renamed. Read-only. + /// Name of the table. + /// Represents a collection of all the rows in the table. Read-only. + /// Indicates whether the header row is visible or not. This value can be set to show or remove the header row. + /// Indicates whether the total row is visible or not. This value can be set to show or remove the total row. + /// Constant value that represents the Table style. Possible values are: TableStyleLight1 thru TableStyleLight21, TableStyleMedium1 thru TableStyleMedium28, TableStyleStyleDark1 thru TableStyleStyleDark11. A custom user-defined style present in the workbook can also be specified. + } + + Table.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Table.prototype.delete = function() { + /// + /// Deletes the table. + /// + /// + } + Table.prototype.getDataBodyRange = function() { + /// + /// Gets the range object associated with the data body of the table. + /// + /// + } + Table.prototype.getHeaderRowRange = function() { + /// + /// Gets the range object associated with header row of the table. + /// + /// + } + Table.prototype.getRange = function() { + /// + /// Gets the range object associated with the entire table. + /// + /// + } + Table.prototype.getTotalRowRange = function() { + /// + /// Gets the range object associated with totals row of the table. + /// + /// + } + return Table; + })(OfficeExtension.ClientObject); + Excel.Table = Table; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var TableCollection = (function(_super) { + __extends(TableCollection, _super); + function TableCollection() { + /// Represents a collection of all the tables that are part of the workbook. + /// The request context associated with this object + /// Returns the number of tables in the workbook. Read-only. + /// Gets the loaded child items in this collection. + } + + TableCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + TableCollection.prototype.add = function(address, hasHeaders) { + /// + /// Create a new table. The range source address determines the worksheet under which the table will be added. If the table cannot be added (e.g., because the address is invalid, or the table would overlap with another table), an error will be thrown. + /// + /// Address or name of the range object representing the data source. If the address does not contain a sheet name, the currently-active sheet is used. + /// Boolean value that indicates whether the data being imported has column labels. If the source does not contain headers (i.e,. when this property set to false), Excel will automatically generate header shifting the data down by one row. + /// + } + TableCollection.prototype.getItem = function(key) { + /// + /// Gets a table by Name or ID. + /// + /// Name or ID of the table to be retrieved. + /// + } + TableCollection.prototype.getItemAt = function(index) { + /// + /// Gets a table based on its position in the collection. + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return TableCollection; + })(OfficeExtension.ClientObject); + Excel.TableCollection = TableCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var TableColumn = (function(_super) { + __extends(TableColumn, _super); + function TableColumn() { + /// Represents a column in a table. + /// The request context associated with this object + /// Returns a unique key that identifies the column within the table. Read-only. + /// Returns the index number of the column within the columns collection of the table. Zero-indexed. Read-only. + /// Returns the name of the table column. Read-only. + /// Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cell that contain an error will return the error string. + } + + TableColumn.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + TableColumn.prototype.delete = function() { + /// + /// Deletes the column from the table. + /// + /// + } + TableColumn.prototype.getDataBodyRange = function() { + /// + /// Gets the range object associated with the data body of the column. + /// + /// + } + TableColumn.prototype.getHeaderRowRange = function() { + /// + /// Gets the range object associated with the header row of the column. + /// + /// + } + TableColumn.prototype.getRange = function() { + /// + /// Gets the range object associated with the entire column. + /// + /// + } + TableColumn.prototype.getTotalRowRange = function() { + /// + /// Gets the range object associated with the totals row of the column. + /// + /// + } + return TableColumn; + })(OfficeExtension.ClientObject); + Excel.TableColumn = TableColumn; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var TableColumnCollection = (function(_super) { + __extends(TableColumnCollection, _super); + function TableColumnCollection() { + /// Represents a collection of all the columns that are part of the table. + /// The request context associated with this object + /// Returns the number of columns in the table. Read-only. + /// Gets the loaded child items in this collection. + } + + TableColumnCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + TableColumnCollection.prototype.add = function(index, values) { + /// + /// Adds a new column to the table. + /// + /// Specifies the relative position of the new column. The previous column at this position is shifted to the right. The index value should be equal to or less than the last column's index value, so it cannot be used to append a column at the end of the table. Zero-indexed. + /// A 2-dimensional array of unformatted values of the table column. + /// + } + TableColumnCollection.prototype.getItem = function(key) { + /// + /// Gets a column object by Name or ID. + /// + /// Column Name or ID. + /// + } + TableColumnCollection.prototype.getItemAt = function(index) { + /// + /// Gets a column based on its position in the collection. + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return TableColumnCollection; + })(OfficeExtension.ClientObject); + Excel.TableColumnCollection = TableColumnCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var TableRow = (function(_super) { + __extends(TableRow, _super); + function TableRow() { + /// Represents a row in a table. + /// The request context associated with this object + /// Returns the index number of the row within the rows collection of the table. Zero-indexed. Read-only. + /// Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cell that contain an error will return the error string. + } + + TableRow.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + TableRow.prototype.delete = function() { + /// + /// Deletes the row from the table. + /// + /// + } + TableRow.prototype.getRange = function() { + /// + /// Returns the range object associated with the entire row. + /// + /// + } + return TableRow; + })(OfficeExtension.ClientObject); + Excel.TableRow = TableRow; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var TableRowCollection = (function(_super) { + __extends(TableRowCollection, _super); + function TableRowCollection() { + /// Represents a collection of all the rows that are part of the table. + /// The request context associated with this object + /// Returns the number of rows in the table. Read-only. + /// Gets the loaded child items in this collection. + } + + TableRowCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + TableRowCollection.prototype.add = function(index, values) { + /// + /// Adds a new row to the table. + /// + /// Specifies the relative position of the new row. If null, the addition happens at the end. Any rows below the inserted row are shifted downwards. Zero-indexed. + /// A 2-dimensional array of unformatted values of the table row. + /// + } + TableRowCollection.prototype.getItemAt = function(index) { + /// + /// Gets a row based on its position in the collection. + /// + /// Index value of the object to be retrieved. Zero-indexed. + /// + } + return TableRowCollection; + })(OfficeExtension.ClientObject); + Excel.TableRowCollection = TableRowCollection; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var VerticalAlignment = { + __proto__: null, + "top": "top", + "center": "center", + "bottom": "bottom", + "justify": "justify", + "distributed": "distributed", + } + Excel.VerticalAlignment = VerticalAlignment; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var Workbook = (function(_super) { + __extends(Workbook, _super); + function Workbook() { + /// Workbook is the top level object which contains related workbook objects such as worksheets, tables, ranges, etc. + /// The request context associated with this object + /// Represents Excel application instance that contains this workbook. Read-only. + /// Represents a collection of bindings that are part of the workbook. Read-only. + /// Represents a collection of workbook scoped named items (named ranges and constants). Read-only. + /// Represents a collection of tables associated with the workbook. Read-only. + /// Represents a collection of worksheets associated with the workbook. Read-only. + } + + Workbook.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Workbook.prototype.getSelectedRange = function() { + /// + /// Gets the currently selected range from the workbook. + /// + /// + } + return Workbook; + })(OfficeExtension.ClientObject); + Excel.Workbook = Workbook; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var Worksheet = (function(_super) { + __extends(Worksheet, _super); + function Worksheet() { + /// An Excel worksheet is a grid of cells. It can contain data, tables, charts, etc. + /// The request context associated with this object + /// Returns collection of charts that are part of the worksheet. Read-only. + /// Returns a value that uniquely identifies the worksheet in a given workbook. The value of the identifier remains the same even when the worksheet is renamed or moved. Read-only. + /// The display name of the worksheet. + /// The zero-based position of the worksheet within the workbook. + /// Collection of tables that are part of the worksheet. Read-only. + /// The Visibility of the worksheet, Read-only. + } + + Worksheet.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Worksheet.prototype.activate = function() { + /// + /// Activate the worksheet in the Excel UI. + /// + /// + } + Worksheet.prototype.delete = function() { + /// + /// Deletes the worksheet from the workbook. + /// + /// + } + Worksheet.prototype.getCell = function(row, column) { + /// + /// Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it's stays within the worksheet grid. + /// + /// The row number of the cell to be retrieved. Zero-indexed. + /// the column number of the cell to be retrieved. Zero-indexed. + /// + } + Worksheet.prototype.getRange = function(address) { + /// + /// Gets the range object specified by the address or name. + /// + /// The address or the name of the range. If not specified, the entire worksheet range is returned. + /// + } + Worksheet.prototype.getUsedRange = function() { + /// + /// The used range is the smallest range than encompasses any cells that have a value or formatting assigned to them. If the worksheet is blank, this function will return the top left cell. + /// + /// + } + return Worksheet; + })(OfficeExtension.ClientObject); + Excel.Worksheet = Worksheet; +})(Excel || (Excel = {})); + +var Excel; +(function (Excel) { + var WorksheetCollection = (function(_super) { + __extends(WorksheetCollection, _super); + function WorksheetCollection() { + /// Represents a collection of worksheet objects that are part of the workbook. + /// The request context associated with this object + /// Gets the loaded child items in this collection. + } + + WorksheetCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + WorksheetCollection.prototype.add = function(name) { + /// + /// Adds a new worksheet to the workbook. The worksheet will be added at the end of existing worksheets. If you wish to activate the newly added worksheet, call ".activate() on it. + /// + /// The name of the worksheet to be added. If specified, name should be unqiue. If not specified, Excel determines the name of the new worksheet. + /// + } + WorksheetCollection.prototype.getActiveWorksheet = function() { + /// + /// Gets the currently active worksheet in the workbook. + /// + /// + } + WorksheetCollection.prototype.getItem = function(key) { + /// + /// Gets a worksheet object using its Name or ID. + /// + /// The Name or ID of the worksheet. + /// + } + return WorksheetCollection; + })(OfficeExtension.ClientObject); + Excel.WorksheetCollection = WorksheetCollection; +})(Excel || (Excel = {})); +var Excel; +(function (Excel) { + var RequestContext = (function (_super) { + __extends(RequestContext, _super); + function RequestContext() { + /// + /// The RequestContext object facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the request context is required to get access to the Excel object model from the add-in. + /// + /// Root object for interacting with the document + _super.call(this, null); + } + return RequestContext; + })(OfficeExtension.ClientRequestContext); + Excel.RequestContext = RequestContext; + + Excel.run = function (batch) { + /// + /// Executes a batch script that performs actions on the Excel object model. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + /// + /// + /// A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). + ///
+ /// The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the request context is required to get access to the Excel object model from the add-in. + /// + batch(new Excel.RequestContext()); + return new OfficeExtension.IPromise(); + } +})(Excel || (Excel = {})); +Excel.__proto__ = null; + + +var Word; +(function (Word) { + var Alignment = { + __proto__: null, + "unknown": "unknown", + "left": "left", + "centered": "centered", + "right": "right", + "justified": "justified", + } + Word.Alignment = Alignment; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var Body = (function(_super) { + __extends(Body, _super); + function Body() { + /// Represents the body of a document or a section. + /// The request context associated with this object + /// Gets the collection of rich text content control objects that are in the body. Read-only. + /// Gets the text format of the body. Use this to get and set font name, size, color, and other properties. Read-only. + /// Gets the collection of inlinePicture objects that are in the body. The collection does not include floating images. Read-only. + /// Gets the collection of paragraph objects that are in the body. Read-only. + /// Gets the content control that contains the body. Returns null if there isn't a parent content control. Read-only. + /// Gets or sets the style used for the body. This is the name of the pre-installed or custom style. + /// Gets the text of the body. Use the insertText method to insert text. Read-only. + } + + Body.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Body.prototype.clear = function() { + /// + /// Clears the contents of the body object. The user can perform the undo operation on the cleared content. + /// + /// + } + Body.prototype.getHtml = function() { + /// + /// Gets the HTML representation of the body object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + Body.prototype.getOoxml = function() { + /// + /// Gets the OOXML (Office Open XML) representation of the body object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + Body.prototype.insertBreak = function(breakType, insertLocation) { + /// + /// Inserts a break at the specified location. The insertLocation value can be 'Start' or 'End'. + /// + /// Required. The break type to add to the body. + /// Required. The value can be 'Start' or 'End'. + /// + } + Body.prototype.insertContentControl = function() { + /// + /// Wraps the body object with a Rich Text content control. + /// + /// + } + Body.prototype.insertFileFromBase64 = function(base64File, insertLocation) { + /// + /// Inserts a document into the body at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The base64 encoded file contents to be inserted. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Body.prototype.insertHtml = function(html, insertLocation) { + /// + /// Inserts HTML at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The HTML to be inserted in the document. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Body.prototype.insertOoxml = function(ooxml, insertLocation) { + /// + /// Inserts OOXML at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The OOXML to be inserted. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Body.prototype.insertParagraph = function(paragraphText, insertLocation) { + /// + /// Inserts a paragraph at the specified location. The insertLocation value can be 'Start' or 'End'. + /// + /// Required. The paragraph text to be inserted. + /// Required. The value can be 'Start' or 'End'. + /// + } + Body.prototype.insertText = function(text, insertLocation) { + /// + /// Inserts text into the body at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. Text to be inserted. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Body.prototype.search = function(searchText, searchOptions) { + /// + /// Performs a search with the specified searchOptions on the scope of the body object. The search results are a collection of range objects. + /// + /// Required. The search text. + /// Optional. Options for the search. + /// + } + Body.prototype.select = function() { + /// + /// Selects the body and navigates the Word UI to it. + /// + /// + } + return Body; + })(OfficeExtension.ClientObject); + Word.Body = Body; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var BreakType = { + __proto__: null, + "page": "page", + "column": "column", + "next": "next", + "sectionContinuous": "sectionContinuous", + "sectionEven": "sectionEven", + "sectionOdd": "sectionOdd", + "line": "line", + "lineClearLeft": "lineClearLeft", + "lineClearRight": "lineClearRight", + "textWrapping": "textWrapping", + } + Word.BreakType = BreakType; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var ContentControl = (function(_super) { + __extends(ContentControl, _super); + function ContentControl() { + /// Represents a content control. Content controls are bounded and potentially labeled regions in a document that serve as containers for specific types of content. Individual content controls may contain contents such as images, tables, or paragraphs of formatted text. Currently, only rich text content controls are supported. + /// The request context associated with this object + /// Gets or sets the appearance of the content control. The value can be 'boundingBox', 'tags' or 'hidden'. + /// Gets or sets a value that indicates whether the user can delete the content control. Mutually exclusive with removeWhenEdited. + /// Gets or sets a value that indicates whether the user can edit the contents of the content control. + /// Gets or sets the color of the content control. Color is set in "#RRGGBB" format or by using the color name. + /// Gets the collection of content control objects in the content control. Read-only. + /// Gets the text format of the content control. Use this to get and set font name, size, color, and other properties. Read-only. + /// Gets an integer that represents the content control identifier. Read-only. + /// Gets the collection of inlinePicture objects in the content control. The collection does not include floating images. Read-only. + /// Get the collection of paragraph objects in the content control. Read-only. + /// Gets the content control that contains the content control. Returns null if there isn't a parent content control. Read-only. + /// Gets or sets the placeholder text of the content control. Dimmed text will be displayed when the content control is empty. + /// Gets or sets a value that indicates whether the content control is removed after it is edited. Mutually exclusive with cannotDelete. + /// Gets or sets the style used for the content control. This is the name of the pre-installed or custom style. + /// Gets or sets a tag to identify a content control. + /// Gets the text of the content control. Read-only. + /// Gets or sets the title for a content control. + /// Gets the content control type. Only rich text content controls are supported currently. Read-only. + } + + ContentControl.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + ContentControl.prototype.clear = function() { + /// + /// Clears the contents of the content control. The user can perform the undo operation on the cleared content. + /// + /// + } + ContentControl.prototype.delete = function(keepContent) { + /// + /// Deletes the content control and its content. If keepContent is set to true, the content is not deleted. + /// + /// Required. Indicates whether the content should be deleted with the content control. If keepContent is set to true, the content is not deleted. + /// + } + ContentControl.prototype.getHtml = function() { + /// + /// Gets the HTML representation of the content control object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + ContentControl.prototype.getOoxml = function() { + /// + /// Gets the Office Open XML (OOXML) representation of the content control object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + ContentControl.prototype.insertBreak = function(breakType, insertLocation) { + /// + /// Inserts a break at the specified location. The insertLocation value can be 'Before', 'After', 'Start' or 'End'. + /// + /// Required. Type of break (breakType.md) + /// Required. The value can be 'Before', 'After', 'Start' or 'End'. + /// + } + ContentControl.prototype.insertFileFromBase64 = function(base64File, insertLocation) { + /// + /// Inserts a document into the current content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. Base64 encoded contents of the file to be inserted. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + ContentControl.prototype.insertHtml = function(html, insertLocation) { + /// + /// Inserts HTML into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The HTML to be inserted in to the content control. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + ContentControl.prototype.insertOoxml = function(ooxml, insertLocation) { + /// + /// Inserts OOXML into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The OOXML to be inserted in to the content control. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + ContentControl.prototype.insertParagraph = function(paragraphText, insertLocation) { + /// + /// Inserts a paragraph at the specified location. The insertLocation value can be 'Before', 'After', 'Start' or 'End'. + /// + /// Required. The paragrph text to be inserted. + /// Required. The value can be 'Before', 'After', 'Start' or 'End'. + /// + } + ContentControl.prototype.insertText = function(text, insertLocation) { + /// + /// Inserts text into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The text to be inserted in to the content control. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + ContentControl.prototype.search = function(searchText, searchOptions) { + /// + /// Performs a search with the specified searchOptions on the scope of the content control object. The search results are a collection of range objects. + /// + /// Required. The search text. + /// Optional. Options for the search. + /// + } + ContentControl.prototype.select = function() { + /// + /// Selects the content control. This causes Word to scroll to the selection. + /// + /// + } + return ContentControl; + })(OfficeExtension.ClientObject); + Word.ContentControl = ContentControl; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var ContentControlAppearance = { + __proto__: null, + "boundingBox": "boundingBox", + "tags": "tags", + "hidden": "hidden", + } + Word.ContentControlAppearance = ContentControlAppearance; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var ContentControlCollection = (function(_super) { + __extends(ContentControlCollection, _super); + function ContentControlCollection() { + /// Contains a collection of ContentControl objects. Content controls are bounded and potentially labeled regions in a document that serve as containers for specific types of content. Individual content controls may contain contents such as images, tables, or paragraphs of formatted text. Currently, only rich text content controls are supported. + /// The request context associated with this object + /// Gets the loaded child items in this collection. + } + + ContentControlCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + ContentControlCollection.prototype.getById = function(id) { + /// + /// Gets a content control by its identifier. + /// + /// Required. A content control identifier. + /// + } + ContentControlCollection.prototype.getByTag = function(tag) { + /// + /// Gets the content controls that have the specified tag. + /// + /// Required. A tag set on a content control. + /// + } + ContentControlCollection.prototype.getByTitle = function(title) { + /// + /// Gets the content controls that have the specified title. + /// + /// Required. The title of a content control. + /// + } + ContentControlCollection.prototype.getItem = function(index) { + /// + /// Gets a content control by its index in the collection. + /// + /// The index + /// + } + return ContentControlCollection; + })(OfficeExtension.ClientObject); + Word.ContentControlCollection = ContentControlCollection; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var ContentControlType = { + __proto__: null, + "richText": "richText", + } + Word.ContentControlType = ContentControlType; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var Document = (function(_super) { + __extends(Document, _super); + function Document() { + /// The Document object is the top level object. A Document object contains one or more sections, content controls, and the body that contains the contents of the document. + /// The request context associated with this object + /// Gets the body of the document. The body is the text that excludes headers, footers, footnotes, textboxes, etc.. Read-only. + /// Gets the collection of content control objects that are in the current document. This includes content controls in the body of the document, headers, footers, textboxes, etc.. Read-only. + /// Indicates whether the changes in the document have been saved. A value of true indicates that the document hasn't changed since it was saved. Read-only. + /// Gets the collection of section objects that are in the document. Read-only. + } + + Document.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Document.prototype.getSelection = function() { + /// + /// Gets the current selection of the document. Multiple selections are not supported. + /// + /// + } + Document.prototype.save = function() { + /// + /// Saves the document. This will use the Word default file naming convention if the document has not been saved before. + /// + /// + } + return Document; + })(OfficeExtension.ClientObject); + Word.Document = Document; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var Font = (function(_super) { + __extends(Font, _super); + function Font() { + /// Represents a font. + /// The request context associated with this object + /// Gets or sets a value that indicates whether the font is bold. True if the font is formatted as bold, otherwise, false. + /// Gets or sets the color for the specified font. You can provide the value in the "#RRGGBB" format or the color name. + /// Gets or sets a value that indicates whether the font has a double strike through. True if the font is formatted as double strikethrough text, otherwise, false. + /// Gets or sets the highlight color for the specified font. You can provide the value as either in the "#RRGGBB" format or the color name. + /// Gets or sets a value that indicates whether the font is italicized. True if the font is italicized, otherwise, false. + /// Gets or sets a value that represents the name of the font. + /// Gets or sets a value that represents the font size in points. + /// Gets or sets a value that indicates whether the font has a strike through. True if the font is formatted as strikethrough text, otherwise, false. + /// Gets or sets a value that indicates whether the font is a subscript. True if the font is formatted as subscript, otherwise, false. + /// Gets or sets a value that indicates whether the font is a superscript. True if the font is formatted as superscript, otherwise, false. + /// Gets or sets a value that indicates the font's underline type. 'None' if the font is not underlined. + } + + Font.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return Font; + })(OfficeExtension.ClientObject); + Word.Font = Font; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var HeaderFooterType = { + __proto__: null, + "primary": "primary", + "firstPage": "firstPage", + "evenPages": "evenPages", + } + Word.HeaderFooterType = HeaderFooterType; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var InlinePicture = (function(_super) { + __extends(InlinePicture, _super); + function InlinePicture() { + /// Represents an inline picture. + /// The request context associated with this object + /// Gets or sets a string that represents the alternative text associated with the inline image + /// Gets or sets a string that contains the title for the inline image. + /// Gets or sets a number that describes the height of the inline image. + /// Gets or sets the hyperlink associated with the inline image. + /// Gets or sets a value that indicates whether the inline image retains its original proportions when you resize it. + /// Gets the content control that contains the inline image. Returns null if there isn't a parent content control. Read-only. + /// Gets or sets a number that describes the width of the inline image. + } + + InlinePicture.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + InlinePicture.prototype.getBase64ImageSrc = function() { + /// + /// Gets the base64 encoded string representation of the inline image. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + InlinePicture.prototype.insertContentControl = function() { + /// + /// Wraps the inline picture with a rich text content control. + /// + /// + } + return InlinePicture; + })(OfficeExtension.ClientObject); + Word.InlinePicture = InlinePicture; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var InlinePictureCollection = (function(_super) { + __extends(InlinePictureCollection, _super); + function InlinePictureCollection() { + /// Contains a collection of [inlinePicture](inlinePicture.md) objects. + /// The request context associated with this object + /// Gets the loaded child items in this collection. + } + + InlinePictureCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return InlinePictureCollection; + })(OfficeExtension.ClientObject); + Word.InlinePictureCollection = InlinePictureCollection; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var InsertLocation = { + __proto__: null, + "before": "before", + "after": "after", + "start": "start", + "end": "end", + "replace": "replace", + } + Word.InsertLocation = InsertLocation; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var Paragraph = (function(_super) { + __extends(Paragraph, _super); + function Paragraph() { + /// Represents a single paragraph in a selection, range, content control, or document body. + /// The request context associated with this object + /// Gets or sets the alignment for a paragraph. The value can be "left", "centered", "right", or "justified". + /// Gets the collection of content control objects that are in the paragraph. Read-only. + /// Gets or sets the value, in points, for a first line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent. + /// Gets the text format of the paragraph. Use this to get and set font name, size, color, and other properties. Read-only. + /// Gets the collection of inlinePicture objects that are in the paragraph. The collection does not include floating images. Read-only. + /// Gets or sets the left indent value, in points, for the paragraph. + /// Gets or sets the line spacing, in points, for the specified paragraph. In the Word UI, this value is divided by 12. + /// Gets or sets the amount of spacing, in grid lines. after the paragraph. + /// Gets or sets the amount of spacing, in grid lines, before the paragraph. + /// Gets or sets the outline level for the paragraph. + /// Gets the content control that contains the paragraph. Returns null if there isn't a parent content control. Read-only. + /// Gets or sets the right indent value, in points, for the paragraph. + /// Gets or sets the spacing, in points, after the paragraph. + /// Gets or sets the spacing, in points, before the paragraph. + /// Gets or sets the style used for the paragraph. This is the name of the pre-installed or custom style. + /// Gets the text of the paragraph. Read-only. + } + + Paragraph.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Paragraph.prototype.clear = function() { + /// + /// Clears the contents of the paragraph object. The user can perform the undo operation on the cleared content. + /// + /// + } + Paragraph.prototype.delete = function() { + /// + /// Deletes the paragraph and its content from the document. + /// + /// + } + Paragraph.prototype.getHtml = function() { + /// + /// Gets the HTML representation of the paragraph object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + Paragraph.prototype.getOoxml = function() { + /// + /// Gets the Office Open XML (OOXML) representation of the paragraph object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + Paragraph.prototype.insertBreak = function(breakType, insertLocation) { + /// + /// Inserts a break at the specified location. The insertLocation value can be 'Start' or 'End'. + /// + /// Required. The break type to add to the document. + /// Required. The value can be 'Before' or 'After'. + /// + } + Paragraph.prototype.insertContentControl = function() { + /// + /// Wraps the paragraph object with a rich text content control. + /// + /// + } + Paragraph.prototype.insertFileFromBase64 = function(base64File, insertLocation) { + /// + /// Inserts a document into the current paragraph at the specified location. The insertLocation value can be 'Start' or 'End'. + /// + /// Required. The file base64 encoded file contents to be inserted. + /// Required. The value can be 'Start' or 'End'. + /// + } + Paragraph.prototype.insertHtml = function(html, insertLocation) { + /// + /// Inserts HTML into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The HTML to be inserted in the paragraph. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Paragraph.prototype.insertInlinePictureFromBase64 = function(base64EncodedImage, insertLocation) { + /// + /// Inserts a picture into the paragraph at the specified location. The insertLocation value can be 'Before', 'After', 'Start' or 'End'. + /// + /// Required. The HTML to be inserted in the paragraph. + /// Required. The value can be 'Before', 'After', 'Start' or 'End'. + /// + } + Paragraph.prototype.insertOoxml = function(ooxml, insertLocation) { + /// + /// Inserts OOXML into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The OOXML to be inserted in the paragraph. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Paragraph.prototype.insertParagraph = function(paragraphText, insertLocation) { + /// + /// Inserts a paragraph at the specified location. The insertLocation value can be 'Before' or 'After'. + /// + /// Required. The paragraph text to be inserted. + /// Required. The value can be 'Before' or 'After'. + /// + } + Paragraph.prototype.insertText = function(text, insertLocation) { + /// + /// Inserts text into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. Text to be inserted. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Paragraph.prototype.search = function(searchText, searchOptions) { + /// + /// Performs a search with the specified searchOptions on the scope of the paragraph object. The search results are a collection of range objects. + /// + /// Required. The search text. + /// Optional. Options for the search. + /// + } + Paragraph.prototype.select = function() { + /// + /// Selects and navigates the Word UI to the paragraph. + /// + /// + } + return Paragraph; + })(OfficeExtension.ClientObject); + Word.Paragraph = Paragraph; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var ParagraphCollection = (function(_super) { + __extends(ParagraphCollection, _super); + function ParagraphCollection() { + /// Contains a collection of [paragraph](paragraph.md) objects. + /// The request context associated with this object + /// Gets the loaded child items in this collection. + } + + ParagraphCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return ParagraphCollection; + })(OfficeExtension.ClientObject); + Word.ParagraphCollection = ParagraphCollection; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var Range = (function(_super) { + __extends(Range, _super); + function Range() { + /// Represents a contiguous area in a document. + /// The request context associated with this object + /// Gets the collection of content control objects that are in the range. Read-only. + /// Gets the text format of the range. Use this to get and set font name, size, color, and other properties. Read-only. + /// Gets the collection of paragraph objects that are in the range. Read-only. + /// Gets the content control that contains the range. Returns null if there isn't a parent content control. Read-only. + /// Gets or sets the style used for the range. This is the name of the pre-installed or custom style. + /// Gets the text of the range. Read-only. + } + + Range.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Range.prototype.clear = function() { + /// + /// Clears the contents of the range object. The user can perform the undo operation on the cleared content. + /// + /// + } + Range.prototype.delete = function() { + /// + /// Deletes the range and its content from the document. + /// + /// + } + Range.prototype.getHtml = function() { + /// + /// Gets the HTML representation of the range object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + Range.prototype.getOoxml = function() { + /// + /// Gets the OOXML representation of the range object. + /// + /// + var result = new OfficeExtension.ClientResult(); + result.__proto__ = null; + result.value = ''; + return result; + } + Range.prototype.insertBreak = function(breakType, insertLocation) { + /// + /// Inserts a break at the specified location. The insertLocation value can be 'Replace', 'Before' or 'After'. + /// + /// Required. The break type to add to the range. + /// Required. The value can be 'Replace', 'Before' or 'After'. + /// + } + Range.prototype.insertContentControl = function() { + /// + /// Wraps the range object with a rich text content control. + /// + /// + } + Range.prototype.insertFileFromBase64 = function(base64File, insertLocation) { + /// + /// Inserts a document into the range at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The file base64 encoded file contents to be inserted. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Range.prototype.insertHtml = function(html, insertLocation) { + /// + /// Inserts HTML into the range at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The HTML to be inserted in the range. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Range.prototype.insertOoxml = function(ooxml, insertLocation) { + /// + /// Inserts OOXML into the range at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. The OOXML to be inserted in the range. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Range.prototype.insertParagraph = function(paragraphText, insertLocation) { + /// + /// Inserts a paragraph into the range at the specified location. The insertLocation value can be 'Before' or 'After'. + /// + /// Required. The paragraph text to be inserted. + /// Required. The value can be 'Before' or 'After'. + /// + } + Range.prototype.insertText = function(text, insertLocation) { + /// + /// Inserts text into the range at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. + /// + /// Required. Text to be inserted. + /// Required. The value can be 'Replace', 'Start' or 'End'. + /// + } + Range.prototype.search = function(searchText, searchOptions) { + /// + /// Performs a search with the specified searchOptions on the scope of the range object. The search results are a collection of range objects. + /// + /// Required. The search text. + /// Optional. Options for the search. + /// + } + Range.prototype.select = function() { + /// + /// Selects and navigates the Word UI to the range. + /// + /// + } + return Range; + })(OfficeExtension.ClientObject); + Word.Range = Range; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var SearchOptions = (function(_super) { + __extends(SearchOptions, _super); + function SearchOptions() { + /// Specifies the options to be included in a search operation. + /// The request context associated with this object + /// Gets or sets a value that indicates whether to ignore all punctuation characters between words. Corresponds to the Ignore punctuation check box in the Find and Replace dialog box. + /// Gets or sets a value that indicates whether to ignore all white space between words. Corresponds to the Ignore white-space characters check box in the Find and Replace dialog box. + /// Gets or sets a value that indicates whether to perform a case sensitive search. Corresponds to the Match case check box in the Find and Replace dialog box (Edit menu). + /// Gets or sets a value that indicates whether to match words that begin with the search string. Corresponds to the Match prefix check box in the Find and Replace dialog box. + /// Gets or sets a value that indicates whether to find words that sound similar to the search string. Corresponds to the Sounds like check box in the Find and Replace dialog box + /// Gets or sets a value that indicates whether to match words that end with the search string. Corresponds to the Match suffix check box in the Find and Replace dialog box. + /// Gets or sets a value that indicates whether to find operation only entire words, not text that is part of a larger word. Corresponds to the Find whole words only check box in the Find and Replace dialog box. + /// Gets or sets a value that indicates whether the search will be performed using special search operators. Corresponds to the Use wildcards check box in the Find and Replace dialog box. + } + + SearchOptions.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return SearchOptions; + })(OfficeExtension.ClientObject); + Word.SearchOptions = SearchOptions; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var SearchResultCollection = (function(_super) { + __extends(SearchResultCollection, _super); + function SearchResultCollection() { + /// Contains a collection of [range](range.md) objects as a result of a search operation. + /// The request context associated with this object + /// Gets the loaded child items in this collection. + } + + SearchResultCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return SearchResultCollection; + })(OfficeExtension.ClientObject); + Word.SearchResultCollection = SearchResultCollection; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var Section = (function(_super) { + __extends(Section, _super); + function Section() { + /// Represents a section in a Word document. + /// The request context associated with this object + /// Gets the body of the section. This does not include the header/footer and other section metadata. Read-only. + } + + Section.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + Section.prototype.getFooter = function(type) { + /// + /// Gets one of the section's footers. + /// + /// Required. The type of footer to return. This value can be: 'primary', 'firstPage' or 'evenPages'. + /// + } + Section.prototype.getHeader = function(type) { + /// + /// Gets one of the section's headers. + /// + /// Required. The type of header to return. This value can be: 'primary', 'firstPage' or 'evenPages'. + /// + } + return Section; + })(OfficeExtension.ClientObject); + Word.Section = Section; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var SectionCollection = (function(_super) { + __extends(SectionCollection, _super); + function SectionCollection() { + /// Contains the collection of the document's [section](section.md) objects. + /// The request context associated with this object + /// Gets the loaded child items in this collection. + } + + SectionCollection.prototype.load = function(option) { + /// + /// Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + /// + /// + /// + } + return SectionCollection; + })(OfficeExtension.ClientObject); + Word.SectionCollection = SectionCollection; +})(Word || (Word = {})); + +var Word; +(function (Word) { + var UnderlineType = { + __proto__: null, + "none": "none", + "single": "single", + "word": "word", + "double": "double", + "dotted": "dotted", + "hidden": "hidden", + "thick": "thick", + "dashLine": "dashLine", + "dotLine": "dotLine", + "dotDashLine": "dotDashLine", + "twoDotDashLine": "twoDotDashLine", + "wave": "wave", + } + Word.UnderlineType = UnderlineType; +})(Word || (Word = {})); +var Word; +(function (Word) { + var RequestContext = (function (_super) { + __extends(RequestContext, _super); + function RequestContext() { + /// + /// The RequestContext object facilitates requests to the Word application. Since the Office add-in and the Word application run in two different processes, the request context is required to get access to the Word object model from the add-in. + /// + /// Root object for interacting with the document + _super.call(this, null); + } + return RequestContext; + })(OfficeExtension.ClientRequestContext); + Word.RequestContext = RequestContext; + + Word.run = function (batch) { + /// + /// Executes a batch script that performs actions on the Word object model. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + /// + /// + /// A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). + ///
+ /// The context parameter facilitates requests to the Word application. Since the Office add-in and the Word application run in two different processes, the request context is required to get access to the Word object model from the add-in. + /// + batch(new Word.RequestContext()); + return new OfficeExtension.IPromise(); + } +})(Word || (Word = {})); +Word.__proto__ = null; + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office.debug.js new file mode 100644 index 000000000..0ccd041ca --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office.debug.js @@ -0,0 +1,680 @@ +/* Office JavaScript API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + + +var OSF = OSF || {}; + +OSF.HostSpecificFileVersion = "16.00"; + +OSF.SupportedLocales = { + "ar-sa": true, + "bg-bg": true, + "ca-es": true, + "cs-cz": true, + "da-dk": true, + "de-de": true, + "el-gr": true, + "en-us": true, + "es-es": true, + "et-ee": true, + "eu-es": true, + "fi-fi": true, + "fr-fr": true, + "gl-es": true, + "he-il": true, + "hi-in": true, + "hr-hr": true, + "hu-hu": true, + "id-id": true, + "it-it": true, + "ja-jp": true, + "kk-kz": true, + "ko-kr": true, + "lt-lt": true, + "lv-lv": true, + "ms-my": true, + "nb-no": true, + "nl-nl": true, + "pl-pl": true, + "pt-br": true, + "pt-pt": true, + "ro-ro": true, + "ru-ru": true, + "sk-sk": true, + "sl-si": true, + "sr-cyrl-cs": true, + "sr-cyrl-rs": true, + "sr-latn-cs": true, + "sr-latn-rs": true, + "sv-se": true, + "th-th": true, + "tr-tr": true, + "uk-ua": true, + "vi-vn": true, + "zh-cn": true, + "zh-tw": true +}; + +OSF.AssociatedLocales = { + ar: "ar-sa", + bg: "bg-bg", + ca: "ca-es", + cs: "cs-cz", + da: "da-dk", + de: "de-de", + el: "el-gr", + en: "en-us", + es: "es-es", + et: "et-ee", + eu: "eu-es", + fi: "fi-fi", + fr: "fr-fr", + gl: "gl-es", + he: "he-il", + hi: "hi-in", + hr: "hr-hr", + hu: "hu-hu", + id: "id-id", + it: "it-it", + ja: "ja-jp", + kk: "kk-kz", + ko: "ko-kr", + lt: "lt-lt", + lv: "lv-lv", + ms: "ms-my", + nb: "nb-no", + nl: "nl-nl", + pl: "pl-pl", + pt: "pt-br", + ro: "ro-ro", + ru: "ru-ru", + sk: "sk-sk", + sl: "sl-si", + sr: "sr-cyrl-cs", + sv: "sv-se", + th: "th-th", + tr: "tr-tr", + uk: "uk-ua", + vi: "vi-vn", + zh: "zh-cn" +}; +var ScriptLoading; +(function (ScriptLoading) { + var ScriptInfo = (function () { + function ScriptInfo(url, isReady, hasStarted, timer, pendingCallback) { + this.url = url; + this.isReady = isReady; + this.hasStarted = hasStarted; + this.timer = timer; + this.hasError = false; + this.pendingCallbacks = []; + this.pendingCallbacks.push(pendingCallback); + } + return ScriptInfo; + })(); + var ScriptTelemetry = (function () { + function ScriptTelemetry(scriptId, startTime, msResponseTime) { + this.scriptId = scriptId; + this.startTime = startTime; + this.msResponseTime = msResponseTime; + } + return ScriptTelemetry; + })(); + var LoadScriptHelper = (function () { + function LoadScriptHelper() { + this.defaultScriptLoadingTimeout = 10000; + this.loadedScriptByIds = {}; + this.scriptTelemetryBuffer = []; + this.osfControlAppCorrelationId = ""; + } + LoadScriptHelper.prototype.isScriptLoading = function (id) { + return !!(this.loadedScriptByIds[id] && this.loadedScriptByIds[id].hasStarted); + }; + LoadScriptHelper.prototype.loadScript = function (url, scriptId, callback, highPriority, timeoutInMs) { + this.loadScriptInternal(url, scriptId, callback, highPriority, timeoutInMs); + }; + LoadScriptHelper.prototype.loadScriptParallel = function (url, scriptId, timeoutInMs) { + this.loadScriptInternal(url, scriptId, null, false, timeoutInMs); + }; + LoadScriptHelper.prototype.waitForFunction = function (scriptLoadTest, callback, numberOfTries, delay) { + var attemptsRemaining = numberOfTries; + var timerId; + var validateFunction = function () { + attemptsRemaining--; + if (scriptLoadTest()) { + callback(true); + return; + } else if (attemptsRemaining > 0) { + timerId = window.setTimeout(validateFunction, delay); + attemptsRemaining--; + } else { + window.clearTimeout(timerId); + callback(false); + } + }; + validateFunction(); + }; + LoadScriptHelper.prototype.waitForScripts = function (ids, callback) { + var _this = this; + if (this.invokeCallbackIfScriptsReady(ids, callback) == false) { + for (var i = 0; i < ids.length; i++) { + var id = ids[i]; + var loadedScriptEntry = this.loadedScriptByIds[id]; + if (loadedScriptEntry) { + loadedScriptEntry.pendingCallbacks.push(function () { + _this.invokeCallbackIfScriptsReady(ids, callback); + }); + } + } + } + }; + LoadScriptHelper.prototype.logScriptLoading = function (scriptId, startTime, msResponseTime) { + startTime = Math.floor(startTime); + if (OSF.AppTelemetry && OSF.AppTelemetry.onScriptDone) { + if (OSF.AppTelemetry.onScriptDone.length == 3) { + OSF.AppTelemetry.onScriptDone(scriptId, startTime, msResponseTime); + } else { + OSF.AppTelemetry.onScriptDone(scriptId, startTime, msResponseTime, this.osfControlAppCorrelationId); + } + } else { + var scriptTelemetry = new ScriptTelemetry(scriptId, startTime, msResponseTime); + this.scriptTelemetryBuffer.push(scriptTelemetry); + } + }; + LoadScriptHelper.prototype.setAppCorrelationId = function (appCorrelationId) { + this.osfControlAppCorrelationId = appCorrelationId; + }; + LoadScriptHelper.prototype.invokeCallbackIfScriptsReady = function (ids, callback) { + var hasError = false; + for (var i = 0; i < ids.length; i++) { + var id = ids[i]; + var loadedScriptEntry = this.loadedScriptByIds[id]; + if (!loadedScriptEntry) { + loadedScriptEntry = new ScriptInfo("", false, false, null, null); + this.loadedScriptByIds[id] = loadedScriptEntry; + } + if (loadedScriptEntry.isReady == false) { + return false; + } else if (loadedScriptEntry.hasError) { + hasError = true; + } + } + callback(!hasError); + return true; + }; + LoadScriptHelper.prototype.getScriptEntryByUrl = function (url) { + for (var key in this.loadedScriptByIds) { + var scriptEntry = this.loadedScriptByIds[key]; + if (this.loadedScriptByIds.hasOwnProperty(key) && scriptEntry.url === url) { + return scriptEntry; + } + } + return null; + }; + LoadScriptHelper.prototype.loadScriptInternal = function (url, scriptId, callback, highPriority, timeoutInMs) { + if (url) { + var self = this; + var doc = window.document; + var loadedScriptEntry = (scriptId && this.loadedScriptByIds[scriptId]) ? this.loadedScriptByIds[scriptId] : this.getScriptEntryByUrl(url); + if (!loadedScriptEntry || loadedScriptEntry.hasError || loadedScriptEntry.url.toLowerCase() != url.toLowerCase()) { + var script = doc.createElement("script"); + script.type = "text/javascript"; + if (scriptId) { + script.id = scriptId; + } + if (!loadedScriptEntry) { + loadedScriptEntry = new ScriptInfo(url, false, false, null, null); + this.loadedScriptByIds[(scriptId ? scriptId : url)] = loadedScriptEntry; + } else { + loadedScriptEntry.url = url; + loadedScriptEntry.hasError = false; + loadedScriptEntry.isReady = false; + } + if (callback) { + if (highPriority) { + loadedScriptEntry.pendingCallbacks.unshift(callback); + } else { + loadedScriptEntry.pendingCallbacks.push(callback); + } + } + var timeFromPageInit = -1; + if (window.performance && window.performance.now) { + timeFromPageInit = window.performance.now(); + } + var startTime = (new Date()).getTime(); + var logTelemetry = function (succeeded) { + if (scriptId) { + var totalTime = (new Date()).getTime() - startTime; + if (!succeeded) { + totalTime = -totalTime; + } + self.logScriptLoading(scriptId, timeFromPageInit, totalTime); + } + self.flushTelemetryBuffer(); + }; + var onLoadCallback = function OSF_OUtil_loadScript$onLoadCallback() { + logTelemetry(true); + loadedScriptEntry.isReady = true; + + if (loadedScriptEntry.timer != null) { + clearTimeout(loadedScriptEntry.timer); + delete loadedScriptEntry.timer; + } + var pendingCallbackCount = loadedScriptEntry.pendingCallbacks.length; + for (var i = 0; i < pendingCallbackCount; i++) { + var currentCallback = loadedScriptEntry.pendingCallbacks.shift(); + if (currentCallback) { + var result = currentCallback(false); + + if (result === false) { + break; + } + } + } + }; + var onLoadError = function () { + logTelemetry(false); + loadedScriptEntry.hasError = true; + loadedScriptEntry.isReady = true; + if (loadedScriptEntry.timer != null) { + clearTimeout(loadedScriptEntry.timer); + delete loadedScriptEntry.timer; + } + var pendingCallbackCount = loadedScriptEntry.pendingCallbacks.length; + for (var i = 0; i < pendingCallbackCount; i++) { + var currentCallback = loadedScriptEntry.pendingCallbacks.shift(); + if (currentCallback) { + var result = currentCallback(false); + + if (result === false) { + break; + } + } + } + }; + if (script.readyState) { + script.onreadystatechange = function () { + if (script.readyState == "loaded" || script.readyState == "complete") { + script.onreadystatechange = null; + onLoadCallback(); + } + }; + } else { + script.onload = onLoadCallback; + } + script.onerror = onLoadError; + + timeoutInMs = timeoutInMs || this.defaultScriptLoadingTimeout; + loadedScriptEntry.timer = setTimeout(onLoadError, timeoutInMs); + loadedScriptEntry.hasStarted = true; + script.src = url; + doc.getElementsByTagName("head")[0].appendChild(script); + } else if (loadedScriptEntry.isReady) { + callback(true); + } else { + if (highPriority) { + loadedScriptEntry.pendingCallbacks.unshift(callback); + } else { + loadedScriptEntry.pendingCallbacks.push(callback); + } + } + } + }; + LoadScriptHelper.prototype.flushTelemetryBuffer = function () { + if (OSF.AppTelemetry && OSF.AppTelemetry.onScriptDone) { + for (var i = 0; i < this.scriptTelemetryBuffer.length; i++) { + var scriptTelemetry = this.scriptTelemetryBuffer[i]; + if (OSF.AppTelemetry.onScriptDone.length == 3) { + OSF.AppTelemetry.onScriptDone(scriptTelemetry.scriptId, scriptTelemetry.startTime, scriptTelemetry.msResponseTime); + } else { + OSF.AppTelemetry.onScriptDone(scriptTelemetry.scriptId, scriptTelemetry.startTime, scriptTelemetry.msResponseTime, this.osfControlAppCorrelationId); + } + } + this.scriptTelemetryBuffer = []; + } + }; + return LoadScriptHelper; + })(); + ScriptLoading.LoadScriptHelper = LoadScriptHelper; +})(ScriptLoading || (ScriptLoading = {})); +OSF.ConstantNames = { + FileVersion: "OAssemblyFileVer", + HostSpecificFallbackVersion: OSF.HostSpecificFileVersion, + OfficeJS: "office.js", + OfficeDebugJS: "office.debug.js", + DefaultLocale: "en-us", + LocaleStringLoadingTimeout: 5000, + MicrosoftAjaxId: "MSAJAX", + OfficeStringsId: "OFFICESTRINGS", + OfficeJsId: "OFFICEJS", + HostFileId: "HOST", + O15MappingId: "O15Mapping", + OfficeStringJS: "office_strings.debug.js", + O15InitHelper: "o15apptofilemappingtable.debug.js", + SupportedLocales: OSF.SupportedLocales, + AssociatedLocales: OSF.AssociatedLocales +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { +}; +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { +}; + +OSF._OfficeAppFactory = (function OSF__OfficeAppFactory() { + var _setNamespace = function OSF_OUtil$_setNamespace(name, parent) { + if (parent && name && !parent[name]) { + parent[name] = {}; + } + }; + _setNamespace("Office", window); + _setNamespace("Microsoft", window); + _setNamespace("Office", Microsoft); + _setNamespace("WebExtension", Microsoft.Office); + window.Office = Microsoft.Office.WebExtension; + var _context = {}; + var _settings = {}; + var _hostFacade = {}; + var _WebAppState = { id: null, webAppUrl: null, conversationID: null, clientEndPoint: null, wnd: window.parent, focused: false }; + var _hostInfo = { isO15: true, isRichClient: true, hostType: "", hostPlatform: "", hostSpecificFileVersion: "", hostLocale: "", osfControlAppCorrelationId: "" }; + var _initializationHelper = {}; + var _appInstanceId = null; + var _loadScriptHelper = new ScriptLoading.LoadScriptHelper(); + if (window.performance && window.performance.now) { + _loadScriptHelper.logScriptLoading(OSF.ConstantNames.OfficeJsId, -1, window.performance.now()); + } + + var _windowLocationHash = window.location.hash; + var _windowLocationSearch = window.location.search; + var getQueryStringValue = function OSF__OfficeAppFactory$getQueryStringValue(paramName) { + var hostInfoValue; + var searchString = window.location.search; + if (searchString) { + var hostInfoParts = searchString.split(paramName + "="); + if (hostInfoParts.length > 1) { + var hostInfoValueRestString = hostInfoParts[1]; + var separatorRegex = new RegExp("[&#]", "g"); + var hostInfoValueParts = hostInfoValueRestString.split(separatorRegex); + if (hostInfoValueParts.length > 0) { + hostInfoValue = hostInfoValueParts[0]; + } + } + } + return hostInfoValue; + }; + var _retrieveHostInfo = function OSF__OfficeAppFactory$_retrieveHostInfo() { + var hostInfoValue = getQueryStringValue("_host_Info"); + var getSessionStorage = function OSF__OfficeAppFactory$_retrieveHostInfo$getSessionStorage() { + var osfSessionStorage = null; + try { + if (window.sessionStorage) { + osfSessionStorage = window.sessionStorage; + } + } catch (ex) { + } + return osfSessionStorage; + }; + var osfSessionStorage = getSessionStorage(); + if (!hostInfoValue && osfSessionStorage && osfSessionStorage.getItem("hostInfoValue")) { + hostInfoValue = osfSessionStorage.getItem("hostInfoValue"); + } + if (hostInfoValue) { + hostInfoValue = decodeURIComponent(hostInfoValue); + _hostInfo.isO15 = false; + var items = hostInfoValue.split("$"); + if (typeof items[2] == "undefined") { + items = hostInfoValue.split("|"); + } + _hostInfo.hostType = items[0]; + _hostInfo.hostPlatform = items[1]; + _hostInfo.hostSpecificFileVersion = items[2]; + _hostInfo.hostLocale = items[3]; + _hostInfo.osfControlAppCorrelationId = (typeof items[4] == "undefined") ? "" : items[4]; + var hostSpecificFileVersionValue = parseFloat(_hostInfo.hostSpecificFileVersion); + + if (hostSpecificFileVersionValue > OSF.ConstantNames.HostSpecificFallbackVersion) { + _hostInfo.hostSpecificFileVersion = OSF.ConstantNames.HostSpecificFallbackVersion.toString(); + } + if (osfSessionStorage) { + try { + osfSessionStorage.setItem("hostInfoValue", hostInfoValue); + } catch (e) { + } + } + } else { + _hostInfo.isO15 = true; + + _hostInfo.hostLocale = getQueryStringValue("locale"); + } + }; + var getAppContextAsync = function OSF__OfficeAppFactory$getAppContextAsync(wnd, gotAppContext) { + if (OSF.AppTelemetry && OSF.AppTelemetry.logAppCommonMessage) { + OSF.AppTelemetry.logAppCommonMessage("getAppContextAsync starts"); + } + _initializationHelper.getAppContext(wnd, gotAppContext); + }; + var initialize = function OSF__OfficeAppFactory$initialize() { + _retrieveHostInfo(); + + _loadScriptHelper.setAppCorrelationId(_hostInfo.osfControlAppCorrelationId); + var getScriptBase = function OSF__OfficeAppFactory_initialize$getScriptBase(scriptSrc, scriptNameToCheck) { + var scriptBase, indexOfJS, scriptSrcLowerCase; + scriptSrcLowerCase = scriptSrc.toLowerCase(); + indexOfJS = scriptSrcLowerCase.indexOf(scriptNameToCheck); + if (indexOfJS >= 0 && indexOfJS === (scriptSrc.length - scriptNameToCheck.length) && (indexOfJS === 0 || scriptSrc.charAt(indexOfJS - 1) === '/' || scriptSrc.charAt(indexOfJS - 1) === '\\')) { + scriptBase = scriptSrc.substring(0, indexOfJS); + } + return scriptBase; + }; + var scripts = document.getElementsByTagName("script"); + var scriptsCount = scripts.length; + var officeScripts = [OSF.ConstantNames.OfficeJS, OSF.ConstantNames.OfficeDebugJS]; + var officeScriptsCount = officeScripts.length; + var i, j, basePath; + for (i = 0; !basePath && i < scriptsCount; i++) { + if (scripts[i].src) { + for (j = 0; !basePath && j < officeScriptsCount; j++) { + basePath = getScriptBase(scripts[i].src, officeScripts[j]); + } + } + } + + var requiresMsAjax = true; + if (!basePath) + throw "Office Web Extension script library file name should be " + OSF.ConstantNames.OfficeJS + " or " + OSF.ConstantNames.OfficeDebugJS + "."; + var isMicrosftAjaxLoaded = function OSF$isMicrosftAjaxLoaded() { + if ((typeof (Sys) !== 'undefined' && typeof (Type) !== 'undefined' && Sys.StringBuilder && typeof (Sys.StringBuilder) === "function" && Type.registerNamespace && typeof (Type.registerNamespace) === "function" && Type.registerClass && typeof (Type.registerClass) === "function") || typeof (OfficeExt) !== "undefined" && typeof (OfficeExt.MicrosoftAjaxFactory) !== "undefined" && OfficeExt.MicrosoftAjaxFactory.msAjaxError) { + return true; + } else { + return false; + } + }; + var officeStrings = null; + var loadLocaleStrings = function OSF__OfficeAppFactory_initialize$loadLocaleStrings(appLocale) { + var getSupportedLocale = function OSF__OfficeAppFactory_initialize$getSupportedLocale(locale) { + if (!locale) { + return OSF.ConstantNames.DefaultLocale; + } + var supportedLocale; + locale = locale.toLowerCase(); + if (locale in OSF.ConstantNames.SupportedLocales) { + supportedLocale = locale; + } else { + var localeParts = locale.split('-', 1); + if (localeParts && localeParts.length > 0) { + supportedLocale = OSF.ConstantNames.AssociatedLocales[localeParts[0]]; + } + } + if (!supportedLocale) { + supportedLocale = OSF.ConstantNames.DefaultLocale; + } + return supportedLocale; + }; + var fallbackLocaleTried = false; + var loadLocaleStringCallback = function OSF__OfficeAppFactory_initialize$loadLocaleStringCallback() { + if (typeof Strings == 'undefined' || typeof Strings.OfficeOM == 'undefined') { + if (!fallbackLocaleTried) { + fallbackLocaleTried = true; + var fallbackLocaleStringFile = basePath + OSF.ConstantNames.DefaultLocale + "/" + OSF.ConstantNames.OfficeStringJS; + _loadScriptHelper.loadScript(fallbackLocaleStringFile, OSF.ConstantNames.OfficeStringsId, loadLocaleStringCallback, true, OSF.ConstantNames.LocaleStringLoadingTimeout); + return false; + } else { + throw "Neither the locale, " + appLocale.toLowerCase() + ", provided by the host app nor the fallback locale " + OSF.ConstantNames.DefaultLocale + " are supported."; + } + } else { + fallbackLocaleTried = false; + officeStrings = Strings.OfficeOM; + } + }; + + if (!isMicrosftAjaxLoaded()) { + window.Type = Function; + Type.registerNamespace = function (ns) { + window[ns] = window[ns] || {}; + }; + Type.prototype.registerClass = function (cls) { + cls = {}; + }; + } + var localeStringFile = basePath + getSupportedLocale(appLocale) + "/" + OSF.ConstantNames.OfficeStringJS; + _loadScriptHelper.loadScript(localeStringFile, OSF.ConstantNames.OfficeStringsId, loadLocaleStringCallback, true, OSF.ConstantNames.LocaleStringLoadingTimeout); + }; + var onAppCodeAndMSAjaxReady = function OSF__OfficeAppFactory_initialize$onAppCodeAndMSAjaxReady(loadSuccess) { + if (loadSuccess) { + _initializationHelper = new OSF.InitializationHelper(_hostInfo, _WebAppState, _context, _settings, _hostFacade); + _initializationHelper.setAgaveHostCommunication(); + getAppContextAsync(_WebAppState.wnd, function (appContext) { + if (OSF.AppTelemetry && OSF.AppTelemetry.logAppCommonMessage) { + OSF.AppTelemetry.logAppCommonMessage("getAppContextAsync callback start"); + } + _appInstanceId = appContext._appInstanceId; + var appReady = function appReady() { + _initializationHelper.prepareApiSurface && _initializationHelper.prepareApiSurface(appContext); + _loadScriptHelper.waitForFunction(function () { + return Microsoft.Office.WebExtension.initialize != undefined; + }, function (initializedDeclared) { + if (initializedDeclared) { + if (_initializationHelper.prepareApiSurface) { + Microsoft.Office.WebExtension.initialize(_initializationHelper.getInitializationReason(appContext)); + } else { + _initializationHelper.prepareRightBeforeWebExtensionInitialize(appContext); + } + } else { + throw "Office.js has not been fully loaded yet. Please try again later or make sure to add your initialization code on the Office.initialize function."; + } + }, 400, 50); + }; + if (!_loadScriptHelper.isScriptLoading(OSF.ConstantNames.OfficeStringsId)) { + loadLocaleStrings(appContext.get_appUILocale()); + } + _loadScriptHelper.waitForScripts([OSF.ConstantNames.OfficeStringsId], function () { + if (officeStrings && !Strings.OfficeOM) { + Strings.OfficeOM = officeStrings; + } + _initializationHelper.loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath); + }); + }); + } else { + var errorMsg = "MicrosoftAjax.js is not loaded successfully."; + if (OSF.AppTelemetry && OSF.AppTelemetry.logAppException) { + OSF.AppTelemetry.logAppException(errorMsg); + } + throw errorMsg; + } + }; + var onAppCodeReady = function OSF__OfficeAppFactory_initialize$onAppCodeReady() { + if (OSF.AppTelemetry && OSF.AppTelemetry.setOsfControlAppCorrelationId) { + OSF.AppTelemetry.setOsfControlAppCorrelationId(_hostInfo.osfControlAppCorrelationId); + } + if (_loadScriptHelper.isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId)) { + _loadScriptHelper.waitForScripts([OSF.ConstantNames.MicrosoftAjaxId], onAppCodeAndMSAjaxReady); + } else { + _loadScriptHelper.waitForFunction(isMicrosftAjaxLoaded, onAppCodeAndMSAjaxReady, 500, 100); + } + }; + if (_hostInfo.isO15) { + _loadScriptHelper.loadScript(basePath + OSF.ConstantNames.O15InitHelper, OSF.ConstantNames.O15MappingId, onAppCodeReady); + } else { + var hostSpecificFileName; + hostSpecificFileName = _hostInfo.hostType + "-" + _hostInfo.hostPlatform + "-" + _hostInfo.hostSpecificFileVersion + ".debug.js"; + _loadScriptHelper.loadScript(basePath + hostSpecificFileName.toLowerCase(), OSF.ConstantNames.HostFileId, onAppCodeReady); + } + if (_hostInfo.hostLocale) { + loadLocaleStrings(_hostInfo.hostLocale); + } + if (requiresMsAjax && !isMicrosftAjaxLoaded()) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + _loadScriptHelper.loadScriptParallel(msAjaxCDNPath, OSF.ConstantNames.MicrosoftAjaxId); + } + window.confirm = function OSF__OfficeAppFactory_initialize$confirm(message) { + throw 'Function window.confirm is not supported.'; + return false; + }; + window.alert = function OSF__OfficeAppFactory_initialize$alert(message) { + throw 'Function window.alert is not supported.'; + }; + window.prompt = function OSF__OfficeAppFactory_initialize$prompt(message, defaultvalue) { + throw 'Function window.prompt is not supported.'; + return null; + }; + + window.history.replaceState = null; + window.history.pushState = null; + }; + initialize(); + return { + getId: function OSF__OfficeAppFactory$getId() { + return _WebAppState.id; + }, + getClientEndPoint: function OSF__OfficeAppFactory$getClientEndPoint() { + return _WebAppState.clientEndPoint; + }, + getContext: function OSF__OfficeAppFactory$getContext() { + return _context; + }, + setContext: function OSF__OfficeAppFactory$setContext(context) { + _context = context; + }, + getHostFacade: function OSF__OfficeAppFactory$getHostFacade() { + return _hostFacade; + }, + setHostFacade: function setHostFacade(hostFacade) { + _hostFacade = hostFacade; + }, + getInitializationHelper: function OSF__OfficeAppFactory$getInitializationHelper() { + return _initializationHelper; + }, + getCachedSessionSettingsKey: function OSF__OfficeAppFactory$getCachedSessionSettingsKey() { + return (_WebAppState.conversationID != null ? _WebAppState.conversationID : _appInstanceId) + "CachedSessionSettings"; + }, + getWebAppState: function OSF__OfficeAppFactory$getWebAppState() { + return _WebAppState; + }, + getWindowLocationHash: function OSF__OfficeAppFactory$getHash() { + return _windowLocationHash; + }, + getWindowLocationSearch: function OSF__OfficeAppFactory$getSearch() { + return _windowLocationSearch; + }, + getLoadScriptHelper: function OSF__OfficeAppFactory$getLoadScriptHelper() { + return _loadScriptHelper; + } + }; +})(); diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office.js new file mode 100644 index 000000000..500e9397d --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/office.js @@ -0,0 +1,11 @@ +/* Office JavaScript API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var OSF=OSF||{};OSF.HostSpecificFileVersion="16.00";OSF.SupportedLocales={"ar-sa":true,"bg-bg":true,"ca-es":true,"cs-cz":true,"da-dk":true,"de-de":true,"el-gr":true,"en-us":true,"es-es":true,"et-ee":true,"eu-es":true,"fi-fi":true,"fr-fr":true,"gl-es":true,"he-il":true,"hi-in":true,"hr-hr":true,"hu-hu":true,"id-id":true,"it-it":true,"ja-jp":true,"kk-kz":true,"ko-kr":true,"lt-lt":true,"lv-lv":true,"ms-my":true,"nb-no":true,"nl-nl":true,"pl-pl":true,"pt-br":true,"pt-pt":true,"ro-ro":true,"ru-ru":true,"sk-sk":true,"sl-si":true,"sr-cyrl-cs":true,"sr-cyrl-rs":true,"sr-latn-cs":true,"sr-latn-rs":true,"sv-se":true,"th-th":true,"tr-tr":true,"uk-ua":true,"vi-vn":true,"zh-cn":true,"zh-tw":true};OSF.AssociatedLocales={ar:"ar-sa",bg:"bg-bg",ca:"ca-es",cs:"cs-cz",da:"da-dk",de:"de-de",el:"el-gr",en:"en-us",es:"es-es",et:"et-ee",eu:"eu-es",fi:"fi-fi",fr:"fr-fr",gl:"gl-es",he:"he-il",hi:"hi-in",hr:"hr-hr",hu:"hu-hu",id:"id-id",it:"it-it",ja:"ja-jp",kk:"kk-kz",ko:"ko-kr",lt:"lt-lt",lv:"lv-lv",ms:"ms-my",nb:"nb-no",nl:"nl-nl",pl:"pl-pl",pt:"pt-br",ro:"ro-ro",ru:"ru-ru",sk:"sk-sk",sl:"sl-si",sr:"sr-cyrl-cs",sv:"sv-se",th:"th-th",tr:"tr-tr",uk:"uk-ua",vi:"vi-vn",zh:"zh-cn"};var ScriptLoading;(function(e){var a=false,b=function(){function b(g,e,d,f,c){var b=this;b.url=g;b.isReady=e;b.hasStarted=d;b.timer=f;b.hasError=a;b.pendingCallbacks=[];b.pendingCallbacks.push(c)}return b}(),d=function(){function a(c,b,a){this.scriptId=c;this.startTime=b;this.msResponseTime=a}return a}(),c=function(){var c=true,e=null;function f(){var a=this;a.defaultScriptLoadingTimeout=1e4;a.loadedScriptByIds={};a.scriptTelemetryBuffer=[];a.osfControlAppCorrelationId=""}f.prototype.isScriptLoading=function(a){return !!(this.loadedScriptByIds[a]&&this.loadedScriptByIds[a].hasStarted)};f.prototype.loadScript=function(e,d,c,a,b){this.loadScriptInternal(e,d,c,a,b)};f.prototype.loadScriptParallel=function(d,c,b){this.loadScriptInternal(d,c,e,a,b)};f.prototype.waitForFunction=function(g,e,h,i){var b=h,f,d=function(){b--;if(g()){e(c);return}else if(b>0){f=window.setTimeout(d,i);b--}else{window.clearTimeout(f);e(a)}};d()};f.prototype.waitForScripts=function(b,e){var f=this;if(this.invokeCallbackIfScriptsReady(b,e)==a)for(var c=0;c1){var e=b[1],f=new RegExp("[&#]","g"),a=e.split(f);if(a.length>0)c=a[0]}}return c},q=function(){var h="hostInfoValue",f=l("_host_Info"),k=function(){var a=d;try{if(window.sessionStorage)a=window.sessionStorage}catch(b){}return a},i=k();if(!f&&i&&i.getItem(h))f=i.getItem(h);if(f){f=decodeURIComponent(f);e.isO15=b;var g=f.split("$");if(typeof g[2]==a)g=f.split("|");e.hostType=g[0];e.hostPlatform=g[1];e.hostSpecificFileVersion=g[2];e.hostLocale=g[3];e.osfControlAppCorrelationId=typeof g[4]==a?"":g[4];var j=parseFloat(e.hostSpecificFileVersion);if(j>OSF.ConstantNames.HostSpecificFallbackVersion)e.hostSpecificFileVersion=OSF.ConstantNames.HostSpecificFallbackVersion.toString();if(i)try{i.setItem(h,f)}catch(m){}}else{e.isO15=c;e.hostLocale=l("locale")}},p=function(b,a){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage&&OSF.AppTelemetry.logAppCommonMessage("getAppContextAsync starts");g.getAppContext(b,a)},r=function(){q();f.setAppCorrelationId(e.osfControlAppCorrelationId);for(var B=function(b,d){var e,a,c;c=b.toLowerCase();a=c.indexOf(d);if(a>=0&&a===b.length-d.length&&(a===0||b.charAt(a-1)==="/"||b.charAt(a-1)==="\\"))e=b.substring(0,a);return e},t=document.getElementsByTagName("script"),D=t.length,y=[OSF.ConstantNames.OfficeJS,OSF.ConstantNames.OfficeDebugJS],z=y.length,n,i,l=0;!i&&l0)b=OSF.ConstantNames.AssociatedLocales[c[0]]}if(!b)b=OSF.ConstantNames.DefaultLocale;return b},d=b,e=function(){if(typeof Strings==a||typeof Strings.OfficeOM==a)if(!d){d=c;var h=i+OSF.ConstantNames.DefaultLocale+"/"+OSF.ConstantNames.OfficeStringJS;f.loadScript(h,OSF.ConstantNames.OfficeStringsId,e,c,OSF.ConstantNames.LocaleStringLoadingTimeout);return b}else throw"Neither the locale, "+g.toLowerCase()+", provided by the host app nor the fallback locale "+OSF.ConstantNames.DefaultLocale+" are supported.";else{d=b;r=Strings.OfficeOM}};if(!o()){window.Type=Function;Type.registerNamespace=function(a){window[a]=window[a]||{}};Type.prototype.registerClass=function(a){a={}}}var j=i+h(g)+"/"+OSF.ConstantNames.OfficeStringJS;f.loadScript(j,OSF.ConstantNames.OfficeStringsId,e,c,OSF.ConstantNames.LocaleStringLoadingTimeout)},u=function(b){if(b){g=new OSF.InitializationHelper(e,h,k,s,j);g.setAgaveHostCommunication();p(h.wnd,function(a){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage&&OSF.AppTelemetry.logAppCommonMessage("getAppContextAsync callback start");m=a._appInstanceId;var b=function(){g.prepareApiSurface&&g.prepareApiSurface(a);f.waitForFunction(function(){return Microsoft.Office.WebExtension.initialize!=undefined},function(b){if(b)if(g.prepareApiSurface)Microsoft.Office.WebExtension.initialize(g.getInitializationReason(a));else g.prepareRightBeforeWebExtensionInitialize(a);else throw"Office.js has not been fully loaded yet. Please try again later or make sure to add your initialization code on the Office.initialize function."},400,50)};!f.isScriptLoading(OSF.ConstantNames.OfficeStringsId)&&w(a.get_appUILocale());f.waitForScripts([OSF.ConstantNames.OfficeStringsId],function(){if(r&&!Strings.OfficeOM)Strings.OfficeOM=r;g.loadAppSpecificScriptAndCreateOM(a,b,i)})})}else{var a="MicrosoftAjax.js is not loaded successfully.";OSF.AppTelemetry&&OSF.AppTelemetry.logAppException&&OSF.AppTelemetry.logAppException(a);throw a}},x=function(){OSF.AppTelemetry&&OSF.AppTelemetry.setOsfControlAppCorrelationId&&OSF.AppTelemetry.setOsfControlAppCorrelationId(e.osfControlAppCorrelationId);if(f.isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))f.waitForScripts([OSF.ConstantNames.MicrosoftAjaxId],u);else f.waitForFunction(o,u,500,100)};if(e.isO15)f.loadScript(i+OSF.ConstantNames.O15InitHelper,OSF.ConstantNames.O15MappingId,x);else{var v;v=e.hostType+"-"+e.hostPlatform+"-"+e.hostSpecificFileVersion+".js";f.loadScript(i+v.toLowerCase(),OSF.ConstantNames.HostFileId,x)}e.hostLocale&&w(e.hostLocale);if(A&&!o()){var C=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";f.loadScriptParallel(C,OSF.ConstantNames.MicrosoftAjaxId)}window.confirm=function(){throw"Function window.confirm is not supported.";return b};window.alert=function(){throw"Function window.alert is not supported."};window.prompt=function(){throw"Function window.prompt is not supported.";return d};window.history.replaceState=d;window.history.pushState=d};r();return {getId:function(){return h.id},getClientEndPoint:function(){return h.clientEndPoint},getContext:function(){return k},setContext:function(a){k=a},getHostFacade:function(){return j},setHostFacade:function(a){j=a},getInitializationHelper:function(){return g},getCachedSessionSettingsKey:function(){return (h.conversationID!=d?h.conversationID:m)+"CachedSessionSettings"},getWebAppState:function(){return h},getWindowLocationHash:function(){return o},getWindowLocationSearch:function(){return n},getLoadScriptHelper:function(){return f}}}() \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.01.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.01.debug.js new file mode 100644 index 000000000..595e6ae22 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.01.debug.js @@ -0,0 +1,3543 @@ +/* Outlook specific API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +; +Type.registerNamespace('Microsoft.Office.WebExtension.MailboxEnums'); +Microsoft.Office.WebExtension.MailboxEnums.EntityType={ + MeetingSuggestion: "meetingSuggestion", TaskSuggestion: "taskSuggestion", Address: "address", EmailAddress: "emailAddress", Url: "url", PhoneNumber: "phoneNumber", Contact: "contact" +}; +Microsoft.Office.WebExtension.MailboxEnums.ItemType={ + Message: 'message', Appointment: 'appointment' +}; +Microsoft.Office.WebExtension.MailboxEnums.ResponseType={ + None: "none", Organizer: "organizer", Tentative: "tentative", Accepted: "accepted", Declined: "declined" +}; +Microsoft.Office.WebExtension.MailboxEnums.RecipientType={ + Other: "other", DistributionList: "distributionList", User: "user", ExternalUser: "externalUser" +}; +Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={ + File: "file", Item: "item" +}; +Microsoft.Office.WebExtension.MailboxEnums.BodyType={ + Text: "text", Html: "html" +}; +Microsoft.Office.WebExtension.CoercionType={ + Text: "text", Html: "html" +}; +; +Type.registerNamespace('OSF.DDA'); +OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(officeAppContext, targetWindow, appReadyCallback) +{ + this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this, this._callAppReadyCallback$p$0); + this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this, this._displayNewAppointmentFormApi$p$0); + this.$$d_windowOpenOverrideHandler=Function.createDelegate(this, this.windowOpenOverrideHandler); + this.$$d__getEwsUrl$p$0=Function.createDelegate(this, this._getEwsUrl$p$0); + this.$$d__getDiagnostics$p$0=Function.createDelegate(this, this._getDiagnostics$p$0); + this.$$d__getUserProfile$p$0=Function.createDelegate(this, this._getUserProfile$p$0); + this.$$d__getItem$p$0=Function.createDelegate(this, this._getItem$p$0); + this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this, this._getInitialDataResponseHandler$p$0); + OSF.DDA.OutlookAppOm._instance$p=this; + this._officeAppContext$p$0=officeAppContext; + this._appReadyCallback$p$0=appReadyCallback; + var $$t_4=this; + var stringLoadedCallback=function() + { + if (appReadyCallback) + { + $$t_4._invokeHostMethod$i$0(1, 'GetInitialData', null, $$t_4.$$d__getInitialDataResponseHandler$p$0) + } + }; + if (this._areStringsLoaded$p$0()) + { + stringLoadedCallback() + } + else + { + this._loadLocalizedScript$p$0(stringLoadedCallback) + } +}; +OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function OSF_DDA_OutlookAppOm$_throwOnPropertyAccessForRestrictedPermission$i(currentPermissionLevel) +{ + if (!currentPermissionLevel) + { + throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text); + } +}; +OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function OSF_DDA_OutlookAppOm$_throwOnOutOfRange$i(value, minValue, maxValue, argumentName) +{ + if (value < minValue || value > maxValue) + { + throw Error.argumentOutOfRange(argumentName); + } +}; +OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function OSF_DDA_OutlookAppOm$_throwOnArgumentType$p(value, expectedType, argumentName) +{ + if (Object.getType(value) !==expectedType) + { + throw Error.argumentType(argumentName); + } +}; +OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function OSF_DDA_OutlookAppOm$_validateOptionalStringParameter$p(value, minLength, maxLength, name) +{ + if ($h.ScriptHelpers.isNullOrUndefined(value)) + { + return + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value, String, name); + var stringValue=value; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(stringValue.length, minLength, maxLength, name) +}; +OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function OSF_DDA_OutlookAppOm$_convertToOutlookParameters$p(dispid, data) +{ + var executeParameters=null; + switch (dispid) + { + case 1: + case 2: + case 12: + case 3: + case 14: + case 18: + case 26: + break; + case 4: + var jsonProperty=JSON.stringify(data['customProperties']); + executeParameters=[jsonProperty]; + break; + case 5: + executeParameters=[data['body']]; + break; + case 8: + case 9: + executeParameters=[data['itemId']]; + break; + case 7: + executeParameters=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['requiredAttendees']), OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['optionalAttendees']), data['start'], data['end'], data['location'], OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['resources']), data['subject'], data['body']]; + break; + case 11: + case 10: + executeParameters=[data['htmlBody']]; + break; + case 23: + case 13: + executeParameters=[data['data'], data['coercionType'] || null]; + break; + case 17: + executeParameters=[data['subject']]; + break; + case 15: + executeParameters=[data['recipientField']]; + break; + case 22: + case 21: + executeParameters=[data['recipientField'], OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(data['recipientArray'])]; + break; + case 19: + executeParameters=[data['itemId'], data['name']]; + break; + case 16: + executeParameters=[data['uri'], data['name']]; + break; + case 20: + executeParameters=[data['attachmentIndex']]; + break; + case 25: + executeParameters=[data['TimeProperty'], data['time']]; + break; + case 24: + executeParameters=[data['TimeProperty']]; + break; + case 27: + executeParameters=[data['location']]; + break; + default: + Sys.Debug.fail('Unexpected method dispid'); + break + } + return executeParameters +}; +OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function OSF_DDA_OutlookAppOm$_convertRecipientArrayParameterForOutlookForDisplayApi$p(array) +{ + return (array) ? array.join(';') : null +}; +OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function OSF_DDA_OutlookAppOm$_convertComposeEmailDictionaryParameterForSetApi$p(recipients) +{ + if (!recipients) + { + return null + } + var results=new Array(recipients.length); + for (var i=0; i < recipients.length; i++) + { + results[i]=[recipients[i]['address'], recipients[i]['name']] + } + return results +}; +OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function OSF_DDA_OutlookAppOm$_validateAndNormalizeRecipientEmails$p(emailset, name) +{ + if ($h.ScriptHelpers.isNullOrUndefined(emailset)) + { + return null + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset, Array, name); + var originalAttendees=emailset; + var updatedAttendees=null; + var normalizationNeeded=false; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(originalAttendees.length, 0, OSF.DDA.OutlookAppOm._maxRecipients$p, String.format('{0}.length', name)); + for (var i=0; i < originalAttendees.length; i++) + { + if ($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) + { + normalizationNeeded=true; + break + } + } + if (normalizationNeeded) + { + updatedAttendees=[] + } + for (var i=0; i < originalAttendees.length; i++) + { + if (normalizationNeeded) + { + updatedAttendees[i]=($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) ? (originalAttendees[i]).emailAddress : originalAttendees[i]; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i], String, String.format('{0}[{1}]', name, i)) + } + else + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i], String, String.format('{0}[{1}]', name, i)) + } + } + return updatedAttendees +}; +OSF.DDA.OutlookAppOm.prototype={ + _initialData$p$0: null, _item$p$0: null, _userProfile$p$0: null, _diagnostics$p$0: null, _officeAppContext$p$0: null, _appReadyCallback$p$0: null, _clientEndPoint$p$0: null, get_clientEndPoint: function OSF_DDA_OutlookAppOm$get_clientEndPoint() + { + if (!this._clientEndPoint$p$0) + { + this._clientEndPoint$p$0=OSF._OfficeAppFactory.getClientEndPoint() + } + return this._clientEndPoint$p$0 + }, set_clientEndPoint: function OSF_DDA_OutlookAppOm$set_clientEndPoint(value) + { + this._clientEndPoint$p$0=value; + return value + }, get_initialData: function OSF_DDA_OutlookAppOm$get_initialData() + { + return this._initialData$p$0 + }, get__appName$i$0: function OSF_DDA_OutlookAppOm$get__appName$i$0() + { + return this._officeAppContext$p$0.get_appName() + }, initialize: function OSF_DDA_OutlookAppOm$initialize(initialData) + { + var ItemTypeKey='itemType'; + this._initialData$p$0=new $h.InitialData(initialData); + if (1===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.Message(this._initialData$p$0) + } + else if (3===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.MeetingRequest(this._initialData$p$0) + } + else if (2===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.Appointment(this._initialData$p$0) + } + else if (4===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.MessageCompose(this._initialData$p$0) + } + else if (5===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0) + } + else + { + Sys.Debug.trace('Unexpected item type was received from the host.') + } + this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0); + this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0, this._officeAppContext$p$0.get_appName()); + this._initializeMethods$p$0(); + $h.InitialData._defineReadOnlyProperty$i(this, 'item', this.$$d__getItem$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'userProfile', this.$$d__getUserProfile$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'diagnostics', this.$$d__getDiagnostics$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'ewsUrl', this.$$d__getEwsUrl$p$0); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + { + if (this._initialData$p$0.get__overrideWindowOpen$i$0()) + { + window.open=this.$$d_windowOpenOverrideHandler + } + } + }, windowOpenOverrideHandler: function OSF_DDA_OutlookAppOm$windowOpenOverrideHandler(url, targetName, features, replace) + { + this._invokeHostMethod$i$0(0, 'LaunchPalUrl', {launchUrl: url}, null) + }, makeEwsRequestAsync: function OSF_DDA_OutlookAppOm$makeEwsRequestAsync(data) + { + var args=[]; + for (var $$pai_5=1; $$pai_5 < arguments.length;++$$pai_5) + { + args[$$pai_5 - 1]=arguments[$$pai_5] + } + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + if (data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) + { + throw Error.argument('data', _u.ExtensibilityStrings.l_EwsRequestOversized_Text); + } + this._throwOnMethodCallForInsufficientPermission$i$0(3, 'makeEwsRequestAsync'); + var parameters=$h.CommonParameters.parse(args, true, true); + var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0); + var $$t_4=this; + ewsRequest.onreadystatechange=function() + { + if (4===ewsRequest.get__requestState$i$1()) + { + parameters.get_callback()(ewsRequest._asyncResult$p$0) + } + }; + ewsRequest.send(data) + }, recordDataPoint: function OSF_DDA_OutlookAppOm$recordDataPoint(data) + { + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordDataPoint', data, null) + }, recordTrace: function OSF_DDA_OutlookAppOm$recordTrace(data) + { + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordTrace', data, null) + }, trackCtq: function OSF_DDA_OutlookAppOm$trackCtq(data) + { + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'TrackCtq', data, null) + }, convertToLocalClientTime: function OSF_DDA_OutlookAppOm$convertToLocalClientTime(timeValue) + { + var date=new Date(timeValue.getTime()); + var offset=date.getTimezoneOffset() * -1; + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + date.setUTCMinutes(date.getUTCMinutes() - offset); + offset=this._findOffset$p$0(date); + date.setUTCMinutes(date.getUTCMinutes()+offset) + } + var retValue=this._dateToDictionary$i$0(date); + retValue['timezoneOffset']=offset; + return retValue + }, convertToUtcClientTime: function OSF_DDA_OutlookAppOm$convertToUtcClientTime(input) + { + var retValue=this._dictionaryToDate$i$0(input); + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + var offset=this._findOffset$p$0(retValue); + retValue.setUTCMinutes(retValue.getUTCMinutes() - offset); + offset=(!input['timezoneOffset']) ? retValue.getTimezoneOffset() * -1 : input['timezoneOffset']; + retValue.setUTCMinutes(retValue.getUTCMinutes()+offset) + } + return retValue + }, getUserIdentityTokenAsync: function OSF_DDA_OutlookAppOm$getUserIdentityTokenAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + this._throwOnMethodCallForInsufficientPermission$i$0(1, 'getUserIdentityTokenAsync'); + var parameters=$h.CommonParameters.parse(args, true, true); + this._invokeGetTokenMethodAsync$p$0(2, 'GetUserIdentityToken', parameters.get_callback(), parameters._asyncContext$p$0) + }, getCallbackTokenAsync: function OSF_DDA_OutlookAppOm$getCallbackTokenAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + this._throwOnMethodCallForInsufficientPermission$i$0(1, 'getCallbackTokenAsync'); + var parameters=$h.CommonParameters.parse(args, true, true); + this._invokeGetTokenMethodAsync$p$0(12, 'GetCallbackToken', parameters.get_callback(), parameters._asyncContext$p$0) + }, displayMessageForm: function OSF_DDA_OutlookAppOm$displayMessageForm(itemId) + { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) + { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(8, 'DisplayExistingMessageForm', {itemId: itemId}, null) + }, displayAppointmentForm: function OSF_DDA_OutlookAppOm$displayAppointmentForm(itemId) + { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) + { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(9, 'DisplayExistingAppointmentForm', {itemId: itemId}, null) + }, createAsyncResult: function OSF_DDA_OutlookAppOm$createAsyncResult(value, errorCode, errorDescription, userContext) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if (0 !==errorCode) + { + errorArgs={}; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorCode; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorDescription + } + return new OSF.DDA.AsyncResult(initArgs, errorArgs) + }, standardCreateAsyncResult: function OSF_DDA_OutlookAppOm$standardCreateAsyncResult(value, errorCode, detailedErrorCode, userContext) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if (0 !==errorCode) + { + errorArgs={}; + var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorProperties['name']; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorProperties['message']; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=detailedErrorCode + } + return new OSF.DDA.AsyncResult(initArgs, errorArgs) + }, _throwOnMethodCallForInsufficientPermission$i$0: function OSF_DDA_OutlookAppOm$_throwOnMethodCallForInsufficientPermission$i$0(requiredPermissionLevel, methodName) + { + if (this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel) + { + throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text, methodName)); + } + }, _displayReplyForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyForm$i$0(htmlBody) + { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody') + } + this._invokeHostMethod$i$0(10, 'DisplayReplyForm', {htmlBody: htmlBody}, null) + }, _displayReplyAllForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyAllForm$i$0(htmlBody) + { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody') + } + this._invokeHostMethod$i$0(11, 'DisplayReplyAllForm', {htmlBody: htmlBody}, null) + }, _standardInvokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_standardInvokeHostMethod$i$0(dispid, name, data, format, userContext, callback) + { + var $$t_C=this; + this._invokeHostMethod$i$0(dispid, name, data, function(resultCode, response) + { + if (callback) + { + var asyncResult=null; + if (Object.isInstanceOfType(response)) + { + var responseDictionary=response; + if (('error' in responseDictionary) || ('data' in responseDictionary) || ('errorCode' in responseDictionary)) + { + if (!responseDictionary['error']) + { + var formattedData=(format) ? format(responseDictionary['data']) : responseDictionary['data']; + asyncResult=$$t_C.standardCreateAsyncResult(formattedData, 0, 0, userContext) + } + else + { + var errorCode=responseDictionary['errorCode']; + asyncResult=$$t_C.standardCreateAsyncResult(null, 1, errorCode, userContext) + } + } + } + if (!asyncResult && resultCode) + { + asyncResult=$$t_C.standardCreateAsyncResult(null, 1, 9002, userContext) + } + callback(asyncResult) + } + }) + }, _invokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_invokeHostMethod$i$0(dispid, name, data, responseCallback) + { + if (64===this._officeAppContext$p$0.get_appName()) + { + this.get_clientEndPoint().invoke(name, responseCallback, data) + } + else if (dispid) + { + var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid, data); + var $$t_B=this; + window.external.Execute(dispid, executeParameters, function(nativeData, resultCode) + { + if (responseCallback) + { + var responseData=nativeData.toArray(); + var rawData=JSON.parse(responseData[0]); + if (Object.isInstanceOfType(rawData)) + { + var deserializedData=rawData; + if (responseData.length > 1 && responseData[1]) + { + deserializedData['error']=true; + deserializedData['errorCode']=responseData[1] + } + else + { + deserializedData['error']=false + } + responseCallback(resultCode, deserializedData) + } + else if (Number.isInstanceOfType(rawData)) + { + var returnDict={}; + returnDict['error']=true; + returnDict['errorCode']=rawData; + responseCallback(resultCode, returnDict) + } + else + { + throw Error.notImplemented('Return data type from host must be Dictionary or int'); + } + } + }) + } + else if (responseCallback) + { + responseCallback(-2, null) + } + }, _dictionaryToDate$i$0: function OSF_DDA_OutlookAppOm$_dictionaryToDate$i$0(input) + { + var retValue=new Date(input['year'], input['month'], input['date'], input['hours'], input['minutes'], input['seconds'], (!input['milliseconds']) ? 0 : input['milliseconds']); + if (isNaN(retValue.getTime())) + { + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + } + return retValue + }, _dateToDictionary$i$0: function OSF_DDA_OutlookAppOm$_dateToDictionary$i$0(input) + { + var retValue={}; + retValue['month']=input.getMonth(); + retValue['date']=input.getDate(); + retValue['year']=input.getFullYear(); + retValue['hours']=input.getHours(); + retValue['minutes']=input.getMinutes(); + retValue['seconds']=input.getSeconds(); + retValue['milliseconds']=input.getMilliseconds(); + return retValue + }, _displayNewAppointmentFormApi$p$0: function OSF_DDA_OutlookAppOm$_displayNewAppointmentFormApi$p$0(parameters) + { + var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['requiredAttendees'], 'requiredAttendees'); + var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['optionalAttendees'], 'optionalAttendees'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['location'], 0, OSF.DDA.OutlookAppOm._maxLocationLength$p, 'location'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['body'], 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'body'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['subject'], 0, OSF.DDA.OutlookAppOm._maxSubjectLength$p, 'subject'); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['start'])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['start'], Date, 'start'); + var startDateTime=parameters['start']; + parameters['start']=startDateTime.getTime(); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['end'])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['end'], Date, 'end'); + var endDateTime=parameters['end']; + if (endDateTime < startDateTime) + { + throw Error.argumentOutOfRange('end', endDateTime, _u.ExtensibilityStrings.l_InvalidEventDates_Text); + } + parameters['end']=endDateTime.getTime() + } + } + var updatedParameters=null; + if (normalizedRequiredAttendees || normalizedOptionalAttendees) + { + updatedParameters={}; + var $$dict_6=parameters; + for (var $$key_7 in $$dict_6) + { + var entry={ + key: $$key_7, value: $$dict_6[$$key_7] + }; + updatedParameters[entry.key]=entry.value + } + if (normalizedRequiredAttendees) + { + updatedParameters['requiredAttendees']=normalizedRequiredAttendees + } + if (normalizedOptionalAttendees) + { + updatedParameters['optionalAttendees']=normalizedOptionalAttendees + } + } + this._invokeHostMethod$i$0(7, 'DisplayNewAppointmentForm', updatedParameters || parameters, null) + }, _initializeMethods$p$0: function OSF_DDA_OutlookAppOm$_initializeMethods$p$0() + { + var currentInstance=this; + if ($h.Item.isInstanceOfType(this._item$p$0)) + { + currentInstance.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0 + } + }, _getInitialDataResponseHandler$p$0: function OSF_DDA_OutlookAppOm$_getInitialDataResponseHandler$p$0(resultCode, data) + { + if (resultCode) + { + return + } + this.initialize(data); + (this).displayName='mailbox'; + window.setTimeout(this.$$d__callAppReadyCallback$p$0, 0) + }, _callAppReadyCallback$p$0: function OSF_DDA_OutlookAppOm$_callAppReadyCallback$p$0() + { + this._appReadyCallback$p$0() + }, _invokeGetTokenMethodAsync$p$0: function OSF_DDA_OutlookAppOm$_invokeGetTokenMethodAsync$p$0(outlookDispid, methodName, callback, userContext) + { + if ($h.ScriptHelpers.isNullOrUndefined(callback)) + { + throw Error.argumentNull('callback'); + } + var $$t_8=this; + this._invokeHostMethod$i$0(outlookDispid, methodName, null, function(resultCode, response) + { + var asyncResult; + if (resultCode) + { + asyncResult=$$t_8.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext) + } + else + { + var responseDictionary=response; + if (responseDictionary['wasSuccessful']) + { + asyncResult=$$t_8.createAsyncResult(responseDictionary['token'], 0, null, userContext) + } + else + { + asyncResult=$$t_8.createAsyncResult(null, 1, responseDictionary['errorMessage'], userContext) + } + } + callback(asyncResult) + }) + }, _getItem$p$0: function OSF_DDA_OutlookAppOm$_getItem$p$0() + { + return this._item$p$0 + }, _getUserProfile$p$0: function OSF_DDA_OutlookAppOm$_getUserProfile$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._userProfile$p$0 + }, _getDiagnostics$p$0: function OSF_DDA_OutlookAppOm$_getDiagnostics$p$0() + { + return this._diagnostics$p$0 + }, _getEwsUrl$p$0: function OSF_DDA_OutlookAppOm$_getEwsUrl$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._initialData$p$0.get__ewsUrl$i$0() + }, _findOffset$p$0: function OSF_DDA_OutlookAppOm$_findOffset$p$0(value) + { + var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0(); + for (var r=0; r < ranges.length; r++) + { + var range=ranges[r]; + var start=parseInt(range['start']); + var end=parseInt(range['end']); + if (value.getTime() - start >=0 && value.getTime() - end < 0) + { + return parseInt(range['offset']) + } + } + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + }, _areStringsLoaded$p$0: function OSF_DDA_OutlookAppOm$_areStringsLoaded$p$0() + { + var stringsLoaded=false; + try + { + stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text) + } + catch($$e_1) {} + return stringsLoaded + }, _loadLocalizedScript$p$0: function OSF_DDA_OutlookAppOm$_loadLocalizedScript$p$0(stringLoadedCallback) + { + var url=null; + var baseUrl=''; + var scripts=document.getElementsByTagName('script'); + for (var i=scripts.length - 1; i >=0; i--) + { + var filename=null; + var attributes=scripts[i].attributes; + if (attributes) + { + var attribute=attributes.getNamedItem('src'); + if (attribute) + { + filename=attribute.value + } + if (filename) + { + var debug=false; + filename=filename.toLowerCase(); + var officeIndex=filename.indexOf('office_strings.js'); + if (officeIndex < 0) + { + officeIndex=filename.indexOf('office_strings.debug.js'); + debug=true + } + if ((officeIndex > 0) && (officeIndex < filename.length)) + { + url=filename.replace((debug) ? 'office_strings.debug.js' : 'office_strings.js', 'outlook_strings.js'); + var languageUrl=filename.substring(0, officeIndex); + var lastIndexOfSlash=languageUrl.lastIndexOf('/', languageUrl.length - 2); + if (lastIndexOfSlash===-1) + { + lastIndexOfSlash=languageUrl.lastIndexOf('\\', languageUrl.length - 2) + } + if (lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) + { + baseUrl=languageUrl.substring(0, lastIndexOfSlash+1) + } + break + } + } + } + } + if (url) + { + var head=document.getElementsByTagName('head')[0]; + var scriptElement=null; + var $$t_H=this; + var scriptElementCallback=function() + { + if (stringLoadedCallback && (!scriptElement.readyState || (scriptElement.readyState && (scriptElement.readyState==='loaded' || scriptElement.readyState==='complete')))) + { + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + stringLoadedCallback() + } + }; + var $$t_I=this; + var failureCallback=function() + { + if (!$$t_I._areStringsLoaded$p$0()) + { + var fallbackUrl=baseUrl+'en-us/'+'outlook_strings.js'; + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + head.appendChild(scriptElement) + } + }; + scriptElement=this._createScriptElement$p$0(url); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + window.setTimeout(failureCallback, 2000); + head.appendChild(scriptElement) + } + }, _createScriptElement$p$0: function OSF_DDA_OutlookAppOm$_createScriptElement$p$0(url) + { + var scriptElement=document.createElement('script'); + scriptElement.type='text/javascript'; + scriptElement.src=url; + return scriptElement + } +}; +OSF.DDA.Settings=function OSF_DDA_Settings(data) +{ + this._rawData$p$0=data +}; +OSF.DDA.Settings._convertFromRawSettings$p=function OSF_DDA_Settings$_convertFromRawSettings$p(rawSettings) +{ + if (!rawSettings) + { + return {} + } + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) + { + var outlookSettings=rawSettings['SettingsKey']; + if (outlookSettings) + { + return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings) + } + } + return rawSettings +}; +OSF.DDA.Settings.prototype={ + _rawData$p$0: null, _settingsData$p$0: null, get__data$p$0: function OSF_DDA_Settings$get__data$p$0() + { + if (!this._settingsData$p$0) + { + this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0); + this._rawData$p$0=null + } + return this._settingsData$p$0 + }, get: function OSF_DDA_Settings$get(name) + { + return this.get__data$p$0()[name] + }, set: function OSF_DDA_Settings$set(name, value) + { + this.get__data$p$0()[name]=value + }, remove: function OSF_DDA_Settings$remove(name) + { + delete this.get__data$p$0()[name] + }, saveAsync: function OSF_DDA_Settings$saveAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + var commonParameters=$h.CommonParameters.parse(args, false); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + { + this._saveSettingsForOwa$p$0(commonParameters.get_callback(), commonParameters._asyncContext$p$0) + } + else + { + this._saveSettingsForOutlook$p$0(commonParameters.get_callback(), commonParameters._asyncContext$p$0) + } + }, _saveSettingsForOutlook$p$0: function OSF_DDA_Settings$_saveSettingsForOutlook$p$0(callback, userContext) + { + var storedException=null; + try + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var jsonSettings=JSON.stringify(serializedSettings); + var settingsObjectToSave={SettingsKey: jsonSettings}; + OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave) + } + catch(ex) + { + storedException=ex + } + if (callback) + { + var asyncResult; + if (storedException) + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, storedException.message, userContext) + } + else + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 0, null, userContext) + } + callback(asyncResult) + } + }, _saveSettingsForOwa$p$0: function OSF_DDA_Settings$_saveSettingsForOwa$p$0(callback, userContext) + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var $$t_7=this; + OSF._OfficeAppFactory.getClientEndPoint().invoke('saveSettingsAsync', function(resultCode, response) + { + if (callback) + { + var asyncResult; + if (resultCode) + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext) + } + else + { + var responseDictionary=response; + if (!(responseDictionary['error'])) + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 0, null, userContext) + } + else + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, responseDictionary['errorMessage'], userContext) + } + } + callback(asyncResult) + } + }, [serializedSettings]) + } +}; +Type.registerNamespace('$h'); +Type.registerNamespace('Office.cast'); +$h.Appointment=function $h_Appointment(dataDictionary) +{ + this.$$d__getOrganizer$p$2=Function.createDelegate(this, this._getOrganizer$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this, this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this, this._getSubject$p$2); + this.$$d__getResources$p$2=Function.createDelegate(this, this._getResources$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2); + this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2); + $h.Appointment.initializeBase(this, [dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'resources', this.$$d__getResources$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'organizer', this.$$d__getOrganizer$p$2) +}; +$h.Appointment.prototype={ + getEntities: function $h_Appointment$getEntities() + { + return this._data$p$0._getEntities$i$0() + }, getEntitiesByType: function $h_Appointment$getEntitiesByType(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, getRegExMatches: function $h_Appointment$getRegExMatches() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0() + }, getFilteredEntitiesByName: function $h_Appointment$getFilteredEntitiesByName(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, getRegExMatchesByName: function $h_Appointment$getRegExMatchesByName(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, displayReplyForm: function $h_Appointment$displayReplyForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody) + }, displayReplyAllForm: function $h_Appointment$displayReplyAllForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody) + }, getItemType: function $h_Appointment$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, _getStart$p$2: function $h_Appointment$_getStart$p$2() + { + return this._data$p$0.get__start$i$0() + }, _getEnd$p$2: function $h_Appointment$_getEnd$p$2() + { + return this._data$p$0.get__end$i$0() + }, _getLocation$p$2: function $h_Appointment$_getLocation$p$2() + { + return this._data$p$0.get__location$i$0() + }, _getOptionalAttendees$p$2: function $h_Appointment$_getOptionalAttendees$p$2() + { + return this._data$p$0.get__cc$i$0() + }, _getRequiredAttendees$p$2: function $h_Appointment$_getRequiredAttendees$p$2() + { + return this._data$p$0.get__to$i$0() + }, _getResources$p$2: function $h_Appointment$_getResources$p$2() + { + return this._data$p$0.get__resources$i$0() + }, _getSubject$p$2: function $h_Appointment$_getSubject$p$2() + { + return this._data$p$0.get__subject$i$0() + }, _getNormalizedSubject$p$2: function $h_Appointment$_getNormalizedSubject$p$2() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, _getOrganizer$p$2: function $h_Appointment$_getOrganizer$p$2() + { + return this._data$p$0.get__organizer$i$0() + } +}; +$h.AppointmentCompose=function $h_AppointmentCompose(data) +{ + this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2); + $h.AppointmentCompose.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2) +}; +$h.AppointmentCompose.prototype={ + _requiredAttendees$p$2: null, _optionalAttendees$p$2: null, _start$p$2: null, _end$p$2: null, _location$p$2: null, getItemType: function $h_AppointmentCompose$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, _getRequiredAttendees$p$2: function $h_AppointmentCompose$_getRequiredAttendees$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._requiredAttendees$p$2) + { + this._requiredAttendees$p$2=new $h.ComposeRecipient(0, 'requiredAttendees') + } + return this._requiredAttendees$p$2 + }, _getOptionalAttendees$p$2: function $h_AppointmentCompose$_getOptionalAttendees$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._optionalAttendees$p$2) + { + this._optionalAttendees$p$2=new $h.ComposeRecipient(1, 'optionalAttendees') + } + return this._optionalAttendees$p$2 + }, _getStart$p$2: function $h_AppointmentCompose$_getStart$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._start$p$2) + { + this._start$p$2=new $h.ComposeTime(1) + } + return this._start$p$2 + }, _getEnd$p$2: function $h_AppointmentCompose$_getEnd$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._end$p$2) + { + this._end$p$2=new $h.ComposeTime(2) + } + return this._end$p$2 + }, _getLocation$p$2: function $h_AppointmentCompose$_getLocation$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._location$p$2) + { + this._location$p$2=new $h.ComposeLocation + } + return this._location$p$2 + } +}; +$h.AttachmentDetails=function $h_AttachmentDetails(data) +{ + this.$$d__getIsInline$p$0=Function.createDelegate(this, this._getIsInline$p$0); + this.$$d__getAttachmentType$p$0=Function.createDelegate(this, this._getAttachmentType$p$0); + this.$$d__getSize$p$0=Function.createDelegate(this, this._getSize$p$0); + this.$$d__getContentType$p$0=Function.createDelegate(this, this._getContentType$p$0); + this.$$d__getName$p$0=Function.createDelegate(this, this._getName$p$0); + this.$$d__getId$p$0=Function.createDelegate(this, this._getId$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'id', this.$$d__getId$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'name', this.$$d__getName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contentType', this.$$d__getContentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'size', this.$$d__getSize$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attachmentType', this.$$d__getAttachmentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'isInline', this.$$d__getIsInline$p$0) +}; +$h.AttachmentDetails.prototype={ + _data$p$0: null, _getId$p$0: function $h_AttachmentDetails$_getId$p$0() + { + return this._data$p$0['id'] + }, _getName$p$0: function $h_AttachmentDetails$_getName$p$0() + { + return this._data$p$0['name'] + }, _getContentType$p$0: function $h_AttachmentDetails$_getContentType$p$0() + { + return this._data$p$0['contentType'] + }, _getSize$p$0: function $h_AttachmentDetails$_getSize$p$0() + { + return this._data$p$0['size'] + }, _getAttachmentType$p$0: function $h_AttachmentDetails$_getAttachmentType$p$0() + { + var response=this._data$p$0['attachmentType']; + return (response < $h.AttachmentDetails._attachmentTypeMap$p.length) ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File + }, _getIsInline$p$0: function $h_AttachmentDetails$_getIsInline$p$0() + { + return this._data$p$0['isInline'] + } +}; +$h.ComposeBody=function $h_ComposeBody(){}; +$h.ComposeBody._createParameterDictionaryToHost$p=function $h_ComposeBody$_createParameterDictionaryToHost$p(data, parameters) +{ + var dataToHost={data: data}; + if (parameters._options$p$0 && parameters._options$p$0['coercionType']) + { + var hostCoercionType; + var $$t_4, + $$t_5; + if (!(($$t_5=$h.ComposeBody._tryMapToHostCoercionType$p(parameters._options$p$0['coercionType'], ($$t_4={val: hostCoercionType}))), hostCoercionType=$$t_4.val, $$t_5)) + { + if (parameters.get_callback()) + { + parameters.get_callback()(OSF.DDA.OutlookAppOm._instance$p.standardCreateAsyncResult(null, 1, 1000, parameters._asyncContext$p$0)) + } + return null + } + dataToHost['coercionType']=hostCoercionType + } + else + { + dataToHost['coercionType']=0 + } + return dataToHost +}; +$h.ComposeBody._tryMapToHostCoercionType$p=function $h_ComposeBody$_tryMapToHostCoercionType$p(coercionType, hostCoercionType) +{ + hostCoercionType.val=undefined; + if (coercionType===Microsoft.Office.WebExtension.CoercionType.Html) + { + hostCoercionType.val=3 + } + else if (coercionType===Microsoft.Office.WebExtension.CoercionType.Text) + { + hostCoercionType.val=0 + } + else + { + return false + } + return true +}; +$h.ComposeBody.prototype={ + getTypeAsync: function $h_ComposeBody$getTypeAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'body.getTypeAsync'); + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14, 'GetBodyTypeAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, setSelectedDataAsync: function $h_ComposeBody$setSelectedDataAsync(data) + { + var args=[]; + for (var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + { + args[$$pai_4 - 1]=arguments[$$pai_4] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'body.setSelectedDataAsync'); + var parameters=$h.CommonParameters.parse(args, false); + if (!(String.isInstanceOfType(data))) + { + throw Error.argumentType('data', Object.getType(data), String); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 1000000, 'data'); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$p(data, parameters); + if (!dataToHost) + { + return + } + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13, 'BodySetSelectedDataAsync', dataToHost, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, prependAsync: function $h_ComposeBody$prependAsync(data) + { + var args=[]; + for (var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + { + args[$$pai_4 - 1]=arguments[$$pai_4] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'body.prependAsync'); + var parameters=$h.CommonParameters.parse(args, false); + if (!(String.isInstanceOfType(data))) + { + throw Error.argumentType('data', Object.getType(data), String); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 1000000, 'data'); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$p(data, parameters); + if (!dataToHost) + { + return + } + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23, 'BodyPrependAsync', dataToHost, null, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeItem=function $h_ComposeItem(data) +{ + this.$$d__getBody$p$1=Function.createDelegate(this, this._getBody$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1); + $h.ComposeItem.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'body', this.$$d__getBody$p$1) +}; +$h.ComposeItem.prototype={ + _subject$p$1: null, _body$p$1: null, addFileAttachmentAsync: function $h_ComposeItem$addFileAttachmentAsync(uri, attachmentName) + { + var args=[]; + for (var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + { + args[$$pai_5 - 2]=arguments[$$pai_5] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'addFileAttachmentAsync'); + if (!$h.ScriptHelpers.isNonEmptyString(uri)) + { + throw Error.argument('uri'); + } + if (!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + { + throw Error.argument('attachmentName'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(uri.length, 0, 2048, 'uri'); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length, 0, 255, 'attachmentName'); + var commonParameters=$h.CommonParameters.parse(args, false); + var parameters={ + uri: uri, name: attachmentName, __timeout__: 600000 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16, 'AddFileAttachmentAsync', parameters, null, commonParameters._asyncContext$p$0, commonParameters.get_callback()) + }, addItemAttachmentAsync: function $h_ComposeItem$addItemAttachmentAsync(itemId, attachmentName) + { + var args=[]; + for (var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + { + args[$$pai_5 - 2]=arguments[$$pai_5] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'addItemAttachmentAsync'); + if (!$h.ScriptHelpers.isNonEmptyString(itemId)) + { + throw Error.argument('itemId'); + } + if (!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + { + throw Error.argument('attachmentName'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(itemId.length, 0, 200, 'itemId'); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length, 0, 255, 'attachmentName'); + var commonParameters=$h.CommonParameters.parse(args, false); + var parameters={ + itemId: itemId, name: attachmentName, __timeout__: 600000 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19, 'AddItemAttachmentAsync', parameters, null, commonParameters._asyncContext$p$0, commonParameters.get_callback()) + }, removeAttachmentAsync: function $h_ComposeItem$removeAttachmentAsync(attachmentId) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'removeAttachmentAsync'); + if (!$h.ScriptHelpers.isNonEmptyString(attachmentId)) + { + throw Error.argument('attachmentId'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentId.length, 0, 200, 'attachmentId'); + var commonParameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20, 'RemoveAttachmentAsync', {attachmentIndex: attachmentId}, null, commonParameters._asyncContext$p$0, commonParameters.get_callback()) + }, _getBody$p$1: function $h_ComposeItem$_getBody$p$1() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._body$p$1) + { + this._body$p$1=new $h.ComposeBody + } + return this._body$p$1 + }, _getSubject$p$1: function $h_ComposeItem$_getSubject$p$1() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._subject$p$1) + { + this._subject$p$1=new $h.ComposeSubject + } + return this._subject$p$1 + } +}; +$h.ComposeRecipient=function $h_ComposeRecipient(type, propertyName) +{ + this._type$p$0=type; + this._propertyName$p$0=propertyName +}; +$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function $h_ComposeRecipient$_throwOnInvalidDisplayNameOrEmail$p(displayName, emailAddress) +{ + if (!displayName && !emailAddress) + { + throw Error.argument('recipients'); + } + if (displayName && displayName.length > 255) + { + throw Error.argumentOutOfRange('recipients', displayName.length, _u.ExtensibilityStrings.l_DisplayNameTooLong_Text); + } + if (emailAddress && emailAddress.length > 571) + { + throw Error.argumentOutOfRange('recipients', emailAddress.length, _u.ExtensibilityStrings.l_EmailAddressTooLong_Text); + } +}; +$h.ComposeRecipient._getAsyncFormatter$p=function $h_ComposeRecipient$_getAsyncFormatter$p(rawInput) +{ + var input=rawInput; + var output=[]; + for (var i=0; i < input.length; i++) + { + var email=new $h.EmailAddressDetails(input[i]); + output[i]=email + } + return output +}; +$h.ComposeRecipient._createEmailDictionaryForHost$p=function $h_ComposeRecipient$_createEmailDictionaryForHost$p(address, name) +{ + return { + address: address, name: name + } +}; +$h.ComposeRecipient.prototype={ + _propertyName$p$0: null, _type$p$0: 0, getAsync: function $h_ComposeRecipient$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, this._propertyName$p$0+'.getAsync'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15, 'GetRecipientsAsync', {recipientField: this._type$p$0}, $h.ComposeRecipient._getAsyncFormatter$p, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeRecipient$setAsync(recipients) + { + var args=[]; + for (var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2 - 1]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._propertyName$p$0+'.setAsync'); + this.setAddHelper(recipients, args, true) + }, addAsync: function $h_ComposeRecipient$addAsync(recipients) + { + var args=[]; + for (var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2 - 1]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._propertyName$p$0+'.addAsync'); + this.setAddHelper(recipients, args, false) + }, setAddHelper: function $h_ComposeRecipient$setAddHelper(recipients, args, isSet) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(recipients.length, 0, 100, 'recipients'); + var parameters=$h.CommonParameters.parse(args, false); + var recipientData=[]; + if (Array.isInstanceOfType(recipients)) + { + for (var i=0; i < recipients.length; i++) + { + if (String.isInstanceOfType(recipients[i])) + { + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i], recipients[i]); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i], recipients[i]) + } + else if ($h.EmailAddressDetails.isInstanceOfType(recipients[i])) + { + var address=recipients[i]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address.displayName, address.emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address.emailAddress, address.displayName) + } + else if (Object.isInstanceOfType(recipients[i])) + { + var input=recipients[i]; + var emailAddress=input['emailAddress']; + var displayName=input['displayName']; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName, emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress, displayName) + } + else + { + throw Error.argument('recipients'); + } + } + } + else + { + throw Error.argument('recipients'); + } + var $$t_B=this; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0((isSet) ? 21 : 22, (isSet) ? 'SetRecipientsAsync' : 'AddRecipientsAsync', { + recipientField: this._type$p$0, recipientArray: recipientData + }, function(rawInput) + { + return rawInput + }, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeRecipient.RecipientField=function(){}; +$h.ComposeRecipient.RecipientField.prototype={ + to: 0, cc: 1, bcc: 2, requiredAttendees: 0, optionalAttendees: 1 +}; +$h.ComposeRecipient.RecipientField.registerEnum('$h.ComposeRecipient.RecipientField', false); +$h.ComposeLocation=function $h_ComposeLocation(){}; +$h.ComposeLocation.prototype={ + getAsync: function $h_ComposeLocation$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'location.getAsync'); + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26, 'GetLocationAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeLocation$setAsync(location) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'location.setAsync'); + var parameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(location.length, 0, 255, 'location'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27, 'SetLocationAsync', {location: location}, null, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeSubject=function $h_ComposeSubject(){}; +$h.ComposeSubject.prototype={ + getAsync: function $h_ComposeSubject$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'subject.getAsync'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18, 'GetSubjectAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeSubject$setAsync(data) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + var parameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'subject.setAsync'); + if (!(String.isInstanceOfType(data))) + { + throw Error.argument('data'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 255, 'data'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17, 'SetSubjectAsync', {subject: data}, null, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeTime=function $h_ComposeTime(type) +{ + this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this, this._ticksToDateFormatter$p$0); + this._timeType$p$0=type +}; +$h.ComposeTime.prototype={ + _timeType$p$0: 0, getAsync: function $h_ComposeTime$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, this._getPropertyName$p$0()+'.getAsync'); + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24, 'GetTimeAsync', {TimeProperty: this._timeType$p$0}, this.$$d__ticksToDateFormatter$p$0, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeTime$setAsync(dateTime) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._getPropertyName$p$0()+'.setAsync'); + if (!(Date.isInstanceOfType(dateTime))) + { + throw Error.argumentType('dateTime', Object.getType(dateTime), Date); + } + var parameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25, 'SetTimeAsync', { + TimeProperty: this._timeType$p$0, time: dateTime.getTime() + }, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, _ticksToDateFormatter$p$0: function $h_ComposeTime$_ticksToDateFormatter$p$0(rawInput) + { + var ticks=rawInput; + return new Date(ticks) + }, _getPropertyName$p$0: function $h_ComposeTime$_getPropertyName$p$0() + { + return (this._timeType$p$0===1) ? 'start' : 'end' + } +}; +$h.ComposeTime.TimeType=function(){}; +$h.ComposeTime.TimeType.prototype={ + start: 1, end: 2 +}; +$h.ComposeTime.TimeType.registerEnum('$h.ComposeTime.TimeType', false); +$h.Contact=function $h_Contact(data) +{ + this.$$d__getContactString$p$0=Function.createDelegate(this, this._getContactString$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getBusinessName$p$0=Function.createDelegate(this, this._getBusinessName$p$0); + this.$$d__getPersonName$p$0=Function.createDelegate(this, this._getPersonName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'personName', this.$$d__getPersonName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'businessName', this.$$d__getBusinessName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contactString', this.$$d__getContactString$p$0) +}; +$h.Contact.prototype={ + _data$p$0: null, _phoneNumbers$p$0: null, _getPersonName$p$0: function $h_Contact$_getPersonName$p$0() + { + return this._data$p$0['PersonName'] + }, _getBusinessName$p$0: function $h_Contact$_getBusinessName$p$0() + { + return this._data$p$0['BusinessName'] + }, _getAddresses$p$0: function $h_Contact$_getAddresses$p$0() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses') + }, _getEmailAddresses$p$0: function $h_Contact$_getEmailAddresses$p$0() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses') + }, _getUrls$p$0: function $h_Contact$_getUrls$p$0() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls') + }, _getPhoneNumbers$p$0: function $h_Contact$_getPhoneNumbers$p$0() + { + if (!this._phoneNumbers$p$0) + { + var $$t_1=this; + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', function(data) + { + return new $h.PhoneNumber(data) + }) + } + return this._phoneNumbers$p$0 + }, _getContactString$p$0: function $h_Contact$_getContactString$p$0() + { + return this._data$p$0['ContactString'] + } +}; +$h.CustomProperties=function $h_CustomProperties(data) +{ + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + if (Array.isInstanceOfType(data)) + { + var customPropertiesArray=data; + if (customPropertiesArray.length > 0) + { + this._data$p$0=customPropertiesArray[0] + } + else + { + throw Error.argument('data'); + } + } + else + { + this._data$p$0=data + } +}; +$h.CustomProperties.prototype={ + _data$p$0: null, get: function $h_CustomProperties$get(name) + { + var value=this._data$p$0[name]; + if (typeof(value)==='string') + { + var valueString=value; + if (valueString.length > 6 && valueString.startsWith('Date(') && valueString.endsWith(')')) + { + var ticksString=valueString.substring(5, valueString.length - 1); + var ticks=parseInt(ticksString); + if (!isNaN(ticks)) + { + var dateTimeValue=new Date(ticks); + if (dateTimeValue) + { + value=dateTimeValue + } + } + } + } + return value + }, set: function $h_CustomProperties$set(name, value) + { + if (OSF.OUtil.isDate(value)) + { + value='Date('+(value).getTime()+')' + } + this._data$p$0[name]=value + }, remove: function $h_CustomProperties$remove(name) + { + delete this._data$p$0[name] + }, saveAsync: function $h_CustomProperties$saveAsync() + { + var args=[]; + for (var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) + { + args[$$pai_4]=arguments[$$pai_4] + } + var MaxCustomPropertiesLength=2500; + if (JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) + { + throw Error.argument(); + } + var parameters=$h.CommonParameters.parse(args, false, true); + var saveCustomProperties=new $h._saveDictionaryRequest(parameters.get_callback(), parameters._asyncContext$p$0); + saveCustomProperties._sendRequest$i$0(4, 'SaveCustomProperties', {customProperties: this._data$p$0}) + } +}; +$h.Diagnostics=function $h_Diagnostics(data, appName) +{ + this.$$d__getOwaView$p$0=Function.createDelegate(this, this._getOwaView$p$0); + this.$$d__getHostVersion$p$0=Function.createDelegate(this, this._getHostVersion$p$0); + this.$$d__getHostName$p$0=Function.createDelegate(this, this._getHostName$p$0); + this._data$p$0=data; + this._appName$p$0=appName; + $h.InitialData._defineReadOnlyProperty$i(this, 'hostName', this.$$d__getHostName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'hostVersion', this.$$d__getHostVersion$p$0); + if (64===this._appName$p$0) + { + $h.InitialData._defineReadOnlyProperty$i(this, 'OWAView', this.$$d__getOwaView$p$0) + } +}; +$h.Diagnostics.prototype={ + _data$p$0: null, _appName$p$0: 0, _getHostName$p$0: function $h_Diagnostics$_getHostName$p$0() + { + if (8===this._appName$p$0) + { + return 'Outlook' + } + else if (64===this._appName$p$0) + { + return 'OutlookWebApp' + } + return null + }, _getHostVersion$p$0: function $h_Diagnostics$_getHostVersion$p$0() + { + return this._data$p$0.get__hostVersion$i$0() + }, _getOwaView$p$0: function $h_Diagnostics$_getOwaView$p$0() + { + return this._data$p$0.get__owaView$i$0() + } +}; +$h.EmailAddressDetails=function $h_EmailAddressDetails(data) +{ + this.$$d__getRecipientType$p$0=Function.createDelegate(this, this._getRecipientType$p$0); + this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this, this._getAppointmentResponse$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'appointmentResponse')) + { + $h.InitialData._defineReadOnlyProperty$i(this, 'appointmentResponse', this.$$d__getAppointmentResponse$p$0) + } + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'recipientType')) + { + $h.InitialData._defineReadOnlyProperty$i(this, 'recipientType', this.$$d__getRecipientType$p$0) + } +}; +$h.EmailAddressDetails._createFromEmailUserDictionary$i=function $h_EmailAddressDetails$_createFromEmailUserDictionary$i(data) +{ + var emailAddressDetailsDictionary={}; + var displayName=data['Name']; + var emailAddress=data['UserId']; + emailAddressDetailsDictionary['name']=displayName || $h.EmailAddressDetails._emptyString$p; + emailAddressDetailsDictionary['address']=emailAddress || $h.EmailAddressDetails._emptyString$p; + return new $h.EmailAddressDetails(emailAddressDetailsDictionary) +}; +$h.EmailAddressDetails.prototype={ + _data$p$0: null, toJSON: function $h_EmailAddressDetails$toJSON() + { + var result={}; + result['emailAddress']=this._getEmailAddress$p$0(); + result['displayName']=this._getDisplayName$p$0(); + if ($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0, 'appointmentResponse')) + { + result['appointmentResponse']=this._getAppointmentResponse$p$0() + } + if ($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0, 'recipientType')) + { + result['recipientType']=this._getRecipientType$p$0() + } + return result + }, _getEmailAddress$p$0: function $h_EmailAddressDetails$_getEmailAddress$p$0() + { + return this._data$p$0['address'] + }, _getDisplayName$p$0: function $h_EmailAddressDetails$_getDisplayName$p$0() + { + return this._data$p$0['name'] + }, _getAppointmentResponse$p$0: function $h_EmailAddressDetails$_getAppointmentResponse$p$0() + { + var response=this._data$p$0['appointmentResponse']; + return (response < $h.EmailAddressDetails._responseTypeMap$p.length) ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None + }, _getRecipientType$p$0: function $h_EmailAddressDetails$_getRecipientType$p$0() + { + var response=this._data$p$0['recipientType']; + return (response < $h.EmailAddressDetails._recipientTypeMap$p.length) ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other + } +}; +$h.Entities=function $h_Entities(data, filteredEntitiesData, timeSent, permissionLevel) +{ + this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this, this._createMeetingSuggestion$p$0); + this.$$d__getContacts$p$0=Function.createDelegate(this, this._getContacts$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this, this._getMeetingSuggestions$p$0); + this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this, this._getTaskSuggestions$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this._data$p$0=data || {}; + this._filteredData$p$0=filteredEntitiesData || {}; + this._dateTimeSent$p$0=timeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'taskSuggestions', this.$$d__getTaskSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingSuggestions', this.$$d__getMeetingSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contacts', this.$$d__getContacts$p$0); + this._permissionLevel$p$0=permissionLevel +}; +$h.Entities._getExtractedObjects$i=function $h_Entities$_getExtractedObjects$i(T, data, name, creator, removeDuplicates, stringPropertyName) +{ + var results=null; + var extractedObjects=data[name]; + if (!extractedObjects) + { + return new Array(0) + } + if (removeDuplicates) + { + extractedObjects=$h.Entities._removeDuplicate$p(Object, extractedObjects, $h.Entities._entityDictionaryEquals$p, stringPropertyName) + } + results=new Array(extractedObjects.length); + var count=0; + for (var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) + { + var extractedObject=$$arr_9[$$idx_B]; + results[count++]=creator(extractedObject) + } + return results +}; +$h.Entities._getExtractedStringProperty$i=function $h_Entities$_getExtractedStringProperty$i(data, name, removeDuplicate) +{ + var extractedProperties=data[name]; + if (!extractedProperties) + { + return new Array(0) + } + if (removeDuplicate) + { + extractedProperties=$h.Entities._removeDuplicate$p(String, extractedProperties, $h.Entities._stringEquals$p, null) + } + return extractedProperties +}; +$h.Entities._createContact$p=function $h_Entities$_createContact$p(data) +{ + return new $h.Contact(data) +}; +$h.Entities._createTaskSuggestion$p=function $h_Entities$_createTaskSuggestion$p(data) +{ + return new $h.TaskSuggestion(data) +}; +$h.Entities._createPhoneNumber$p=function $h_Entities$_createPhoneNumber$p(data) +{ + return new $h.PhoneNumber(data) +}; +$h.Entities._entityDictionaryEquals$p=function $h_Entities$_entityDictionaryEquals$p(dictionary1, dictionary2, entityPropertyIdentifier) +{ + if (dictionary1===dictionary2) + { + return true + } + if (!dictionary1 || !dictionary2) + { + return false + } + if (dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) + { + return true + } + return false +}; +$h.Entities._stringEquals$p=function $h_Entities$_stringEquals$p(string1, string2, entityProperty) +{ + return string1===string2 +}; +$h.Entities._removeDuplicate$p=function $h_Entities$_removeDuplicate$p(T, array, entityEquals, entityPropertyIdentifier) +{ + for (var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) + { + var removeMatch=false; + for (var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) + { + if (entityEquals(array[matchIndex1], array[matchIndex2], entityPropertyIdentifier)) + { + removeMatch=true; + break + } + } + if (removeMatch) + { + Array.removeAt(array, matchIndex1) + } + } + return array +}; +$h.Entities.prototype={ + _dateTimeSent$p$0: null, _data$p$0: null, _filteredData$p$0: null, _filteredEntitiesCache$p$0: null, _permissionLevel$p$0: 0, _taskSuggestions$p$0: null, _meetingSuggestions$p$0: null, _phoneNumbers$p$0: null, _contacts$p$0: null, _addresses$p$0: null, _emailAddresses$p$0: null, _urls$p$0: null, _getByType$i$0: function $h_Entities$_getByType$i$0(entityType) + { + if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) + { + return this._getMeetingSuggestions$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) + { + return this._getTaskSuggestions$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) + { + return this._getAddresses$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) + { + return this._getPhoneNumbers$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) + { + return this._getEmailAddresses$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) + { + return this._getUrls$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) + { + return this._getContacts$p$0() + } + return null + }, _getFilteredEntitiesByName$i$0: function $h_Entities$_getFilteredEntitiesByName$i$0(name) + { + if (!this._filteredEntitiesCache$p$0) + { + this._filteredEntitiesCache$p$0={} + } + if (!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0, name)) + { + var found=false; + for (var i=0; i < $h.Entities._allEntityKeys$p.length; i++) + { + var entityTypeKey=$h.Entities._allEntityKeys$p[i]; + var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey]; + if (!perEntityTypeDictionary) + { + continue + } + if ($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary, name)) + { + switch (entityTypeKey) + { + case'EmailAddresses': + case'Urls': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name); + break; + case'Addresses': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name, true); + break; + case'PhoneNumbers': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber, perEntityTypeDictionary, name, $h.Entities._createPhoneNumber$p, false, null); + break; + case'TaskSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, perEntityTypeDictionary, name, $h.Entities._createTaskSuggestion$p, true, 'TaskString'); + break; + case'MeetingSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, perEntityTypeDictionary, name, this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString'); + break; + case'Contacts': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact, perEntityTypeDictionary, name, $h.Entities._createContact$p, true, 'ContactString'); + break + } + found=true; + break + } + } + if (!found) + { + this._filteredEntitiesCache$p$0[name]=null + } + } + return this._filteredEntitiesCache$p$0[name] + }, _createMeetingSuggestion$p$0: function $h_Entities$_createMeetingSuggestion$p$0(data) + { + return new $h.MeetingSuggestion(data, this._dateTimeSent$p$0) + }, _getAddresses$p$0: function $h_Entities$_getAddresses$p$0() + { + if (!this._addresses$p$0) + { + this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses', true) + } + return this._addresses$p$0 + }, _getEmailAddresses$p$0: function $h_Entities$_getEmailAddresses$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._emailAddresses$p$0) + { + this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses', false) + } + return this._emailAddresses$p$0 + }, _getUrls$p$0: function $h_Entities$_getUrls$p$0() + { + if (!this._urls$p$0) + { + this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls', false) + } + return this._urls$p$0 + }, _getPhoneNumbers$p$0: function $h_Entities$_getPhoneNumbers$p$0() + { + if (!this._phoneNumbers$p$0) + { + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', $h.Entities._createPhoneNumber$p) + } + return this._phoneNumbers$p$0 + }, _getTaskSuggestions$p$0: function $h_Entities$_getTaskSuggestions$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._taskSuggestions$p$0) + { + this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, this._data$p$0, 'TaskSuggestions', $h.Entities._createTaskSuggestion$p, true, 'TaskString') + } + return this._taskSuggestions$p$0 + }, _getMeetingSuggestions$p$0: function $h_Entities$_getMeetingSuggestions$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._meetingSuggestions$p$0) + { + this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, this._data$p$0, 'MeetingSuggestions', this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString') + } + return this._meetingSuggestions$p$0 + }, _getContacts$p$0: function $h_Entities$_getContacts$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._contacts$p$0) + { + this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact, this._data$p$0, 'Contacts', $h.Entities._createContact$p, true, 'ContactString') + } + return this._contacts$p$0 + } +}; +Office.cast.item=function Office_cast_item(){}; +Office.cast.item.toItemRead=function Office_cast_item$toItemRead(item) +{ + if ($h.Item.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toItemCompose=function Office_cast_item$toItemCompose(item) +{ + if ($h.ComposeItem.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toMessage=function Office_cast_item$toMessage(item) +{ + return Office.cast.item.toMessageRead(item) +}; +Office.cast.item.toMessageRead=function Office_cast_item$toMessageRead(item) +{ + if ($h.Message.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toMessageCompose=function Office_cast_item$toMessageCompose(item) +{ + if ($h.MessageCompose.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toMeetingRequest=function Office_cast_item$toMeetingRequest(item) +{ + if ($h.MeetingRequest.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toAppointment=function Office_cast_item$toAppointment(item) +{ + return Office.cast.item.toAppointmentRead(item) +}; +Office.cast.item.toAppointmentRead=function Office_cast_item$toAppointmentRead(item) +{ + if ($h.Appointment.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toAppointmentCompose=function Office_cast_item$toAppointmentCompose(item) +{ + if ($h.AppointmentCompose.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +$h.Item=function $h_Item(data) +{ + this.$$d__getAttachments$p$1=Function.createDelegate(this, this._getAttachments$p$1); + this.$$d__getItemClass$p$1=Function.createDelegate(this, this._getItemClass$p$1); + this.$$d__getItemId$p$1=Function.createDelegate(this, this._getItemId$p$1); + this.$$d__getDateTimeModified$p$1=Function.createDelegate(this, this._getDateTimeModified$p$1); + this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this, this._getDateTimeCreated$p$1); + $h.Item.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeCreated', this.$$d__getDateTimeCreated$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeModified', this.$$d__getDateTimeModified$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemId', this.$$d__getItemId$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemClass', this.$$d__getItemClass$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'attachments', this.$$d__getAttachments$p$1) +}; +$h.Item.prototype={ + _getItemId$p$1: function $h_Item$_getItemId$p$1() + { + return this._data$p$0.get__itemId$i$0() + }, _getItemClass$p$1: function $h_Item$_getItemClass$p$1() + { + return this._data$p$0.get__itemClass$i$0() + }, _getDateTimeCreated$p$1: function $h_Item$_getDateTimeCreated$p$1() + { + return this._data$p$0.get__dateTimeCreated$i$0() + }, _getDateTimeModified$p$1: function $h_Item$_getDateTimeModified$p$1() + { + return this._data$p$0.get__dateTimeModified$i$0() + }, _getAttachments$p$1: function $h_Item$_getAttachments$p$1() + { + return this._data$p$0.get__attachments$i$0() + } +}; +$h.ItemBase=function $h_ItemBase(data) +{ + this.$$d__createCustomProperties$i$0=Function.createDelegate(this, this._createCustomProperties$i$0); + this.$$d_getItemType=Function.createDelegate(this, this.getItemType); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'itemType', this.$$d_getItemType) +}; +$h.ItemBase.prototype={ + _data$p$0: null, get_data: function $h_ItemBase$get_data() + { + return this._data$p$0 + }, loadCustomPropertiesAsync: function $h_ItemBase$loadCustomPropertiesAsync() + { + var args=[]; + for (var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3]=arguments[$$pai_3] + } + var parameters=$h.CommonParameters.parse(args, true, true); + var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0, 'customProperties', parameters.get_callback(), parameters._asyncContext$p$0); + loadCustomProperties._sendRequest$i$0(3, 'LoadCustomProperties', {}) + }, _createCustomProperties$i$0: function $h_ItemBase$_createCustomProperties$i$0(data) + { + return new $h.CustomProperties(data) + } +}; +$h.MeetingRequest=function $h_MeetingRequest(data) +{ + this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this, this._getRequiredAttendees$p$3); + this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this, this._getOptionalAttendees$p$3); + this.$$d__getLocation$p$3=Function.createDelegate(this, this._getLocation$p$3); + this.$$d__getEnd$p$3=Function.createDelegate(this, this._getEnd$p$3); + this.$$d__getStart$p$3=Function.createDelegate(this, this._getStart$p$3); + $h.MeetingRequest.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$3) +}; +$h.MeetingRequest.prototype={ + _getStart$p$3: function $h_MeetingRequest$_getStart$p$3() + { + return this._data$p$0.get__start$i$0() + }, _getEnd$p$3: function $h_MeetingRequest$_getEnd$p$3() + { + return this._data$p$0.get__end$i$0() + }, _getLocation$p$3: function $h_MeetingRequest$_getLocation$p$3() + { + return this._data$p$0.get__location$i$0() + }, _getOptionalAttendees$p$3: function $h_MeetingRequest$_getOptionalAttendees$p$3() + { + return this._data$p$0.get__cc$i$0() + }, _getRequiredAttendees$p$3: function $h_MeetingRequest$_getRequiredAttendees$p$3() + { + return this._data$p$0.get__to$i$0() + } +}; +$h.MeetingSuggestion=function $h_MeetingSuggestion(data, dateTimeSent) +{ + this.$$d__getEndTime$p$0=Function.createDelegate(this, this._getEndTime$p$0); + this.$$d__getStartTime$p$0=Function.createDelegate(this, this._getStartTime$p$0); + this.$$d__getSubject$p$0=Function.createDelegate(this, this._getSubject$p$0); + this.$$d__getLocation$p$0=Function.createDelegate(this, this._getLocation$p$0); + this.$$d__getAttendees$p$0=Function.createDelegate(this, this._getAttendees$p$0); + this.$$d__getMeetingString$p$0=Function.createDelegate(this, this._getMeetingString$p$0); + this._data$p$0=data; + this._dateTimeSent$p$0=dateTimeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingString', this.$$d__getMeetingString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attendees', this.$$d__getAttendees$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStartTime$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEndTime$p$0) +}; +$h.MeetingSuggestion.prototype={ + _dateTimeSent$p$0: null, _data$p$0: null, _attendees$p$0: null, _getMeetingString$p$0: function $h_MeetingSuggestion$_getMeetingString$p$0() + { + return this._data$p$0['MeetingString'] + }, _getLocation$p$0: function $h_MeetingSuggestion$_getLocation$p$0() + { + return this._data$p$0['Location'] + }, _getSubject$p$0: function $h_MeetingSuggestion$_getSubject$p$0() + { + return this._data$p$0['Subject'] + }, _getStartTime$p$0: function $h_MeetingSuggestion$_getStartTime$p$0() + { + var time=this._createDateTimeFromParameter$p$0('StartTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) + { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)) + } + return time + }, _getEndTime$p$0: function $h_MeetingSuggestion$_getEndTime$p$0() + { + var time=this._createDateTimeFromParameter$p$0('EndTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) + { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)) + } + return time + }, _createDateTimeFromParameter$p$0: function $h_MeetingSuggestion$_createDateTimeFromParameter$p$0(keyName) + { + var dateTimeString=this._data$p$0[keyName]; + if (!dateTimeString) + { + return null + } + return new Date(dateTimeString) + }, _getAttendees$p$0: function $h_MeetingSuggestion$_getAttendees$p$0() + { + if (!this._attendees$p$0) + { + var $$t_1=this; + this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Attendees', function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._attendees$p$0 + } +}; +$h.MeetingSuggestionTimeDecoder=function $h_MeetingSuggestionTimeDecoder(){}; +$h.MeetingSuggestionTimeDecoder.resolve=function $h_MeetingSuggestionTimeDecoder$resolve(inTime, sentTime) +{ + if (!sentTime) + { + return inTime + } + try + { + var tod; + var outDate; + var extractedDate; + var sentDate=new Date(sentTime.getFullYear(), sentTime.getMonth(), sentTime.getDate(), 0, 0, 0, 0); + var $$t_7, + $$t_8, + $$t_9; + if (!(($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime, ($$t_7={val: extractedDate}), ($$t_8={val: tod}))), extractedDate=$$t_7.val, tod=$$t_8.val, $$t_9)) + { + return inTime + } + else + { + if ($h._preciseDate.isInstanceOfType(extractedDate)) + { + outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate, extractedDate) + } + else + { + if ($h._relativeDate.isInstanceOfType(extractedDate)) + { + outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate, extractedDate) + } + else + { + outDate=sentDate + } + } + if (isNaN(outDate.getTime())) + { + return sentTime + } + outDate.setMilliseconds(outDate.getMilliseconds()+tod); + return outDate + } + } + catch($$e_6) + { + return sentTime + } +}; +$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function $h_MeetingSuggestionTimeDecoder$_isNullOrUndefined$i(value) +{ + return null===value || value===undefined +}; +$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_resolvePreciseDate$p(sentDate, precise) +{ + var year=precise._year$i$1; + var month=(!precise._month$i$1) ? sentDate.getMonth() : precise._month$i$1 - 1; + var day=precise._day$i$1; + if (!day) + { + return sentDate + } + var candidate; + if ($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + candidate=new Date(sentDate.getFullYear(), month, day); + if (candidate.getTime() < sentDate.getTime()) + { + candidate=new Date(sentDate.getFullYear()+1, month, day) + } + } + else + { + candidate=new Date((year < 50) ? 2000+year : 1900+year, month, day) + } + if (candidate.getMonth() !==month) + { + return sentDate + } + return candidate +}; +$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_resolveRelativeDate$p(sentDate, relative) +{ + var date; + switch (relative._unit$i$1) + { + case 0: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(date.getDate()+relative._offset$i$1); + return date; + case 5: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate, relative._offset$i$1, relative._tag$i$1); + case 2: + var days=1; + switch (relative._modifier$i$1) + { + case 1: + break; + case 2: + days=16; + break; + default: + if (!relative._offset$i$1) + { + days=sentDate.getDate() + } + break + } + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), days); + date.setMonth(date.getMonth()+relative._offset$i$1); + if (date.getTime() < sentDate.getTime()) + { + date.setDate(date.getDate()+sentDate.getDate() - 1) + } + return date; + case 1: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(sentDate.getDate()+(7 * relative._offset$i$1)); + if (relative._modifier$i$1===1 || !relative._modifier$i$1) + { + date.setDate(date.getDate()+1 - date.getDay()); + if (date.getTime() < sentDate.getTime()) + { + return sentDate + } + return date + } + else if (relative._modifier$i$1===2) + { + date.setDate(date.getDate()+5 - date.getDay()); + return date + } + break; + case 4: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate, relative); + case 3: + if (relative._offset$i$1 > 0) + { + return new Date(sentDate.getFullYear()+relative._offset$i$1, 0, 1) + } + break; + default: + break + } + return sentDate +}; +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekDate$p(sentDate, offset, tag) +{ + if (offset > -5 && offset < 5) + { + var dayOfWeek; + var days; + dayOfWeek=((tag+6) % 7)+1; + days=(7 * offset)+(dayOfWeek - sentDate.getDay()); + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } + else + { + var days=(tag - sentDate.getDay()) % 7; + if (days < 0) + { + days+=7 + } + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } +}; +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekOfMonthDate$p(sentDate, relative) +{ + var date; + var firstDay; + var newDate; + date=sentDate; + if (relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) + { + return sentDate + } + var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12; + firstDay=new Date(date.getFullYear(), date.getMonth()+monthOffset, 1); + if (relative._modifier$i$1===1) + { + if (relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay() !==0) + { + return firstDay + } + else + { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), firstDay.getDate()); + newDate.setDate(newDate.getDate()+((7+(1 - firstDay.getDay())) % 7)); + if (firstDay.getDay() !==6 && firstDay.getDay() !==0 && firstDay.getDay() !==1) + { + newDate.setDate(newDate.getDate() - 7) + } + newDate.setDate(newDate.getDate()+(7 * (relative._offset$i$1 - 1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) + { + return sentDate + } + return newDate + } + } + else + { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), $h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(), firstDay.getFullYear())); + var offset=1 - newDate.getDay(); + if (offset > 0) + { + offset=offset - 7 + } + newDate.setDate(newDate.getDate()+offset); + newDate.setDate(newDate.getDate()+(7 * (1 - relative._offset$i$1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) + { + if (firstDay.getDay() !==6 && firstDay.getDay() !==0) + { + return firstDay + } + else + { + return sentDate + } + } + else + { + return newDate + } + } +}; +$h.MeetingSuggestionTimeDecoder._decode$p=function $h_MeetingSuggestionTimeDecoder$_decode$p(inDate, date, time) +{ + var DateValueMask=32767; + date.val=null; + time.val=0; + if (!inDate) + { + return false + } + time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate); + var inDateAtMidnight=inDate.getTime() - time.val; + var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 86400000; + if (value < 0) + { + return false + } + else if (value >=262144) + { + return false + } + else + { + var type=value >> 15; + value=value & DateValueMask; + switch (type) + { + case 0: + return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value, date); + case 1: + return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value, date); + default: + return false + } + } +}; +$h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_decodePreciseDate$p(value, date) +{ + var c_SubTypeMask=7; + var c_MonthMask=15; + var c_DayMask=31; + var c_YearMask=127; + var year=null; + var month=0; + var day=0; + date.val=null; + var subType=(value >> 12) & c_SubTypeMask; + if ((subType & 4)===4) + { + year=(value >> 5) & c_YearMask; + if ((subType & 2)===2) + { + if ((subType & 1)===1) + { + return false + } + month=(value >> 1) & c_MonthMask + } + } + else + { + if ((subType & 2)===2) + { + month=(value >> 8) & c_MonthMask + } + if ((subType & 1)===1) + { + day=(value >> 3) & c_DayMask + } + } + date.val=new $h._preciseDate(day, month, year); + return true +}; +$h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_decodeRelativeDate$p(value, date) +{ + var TagMask=15; + var OffsetMask=63; + var UnitMask=7; + var ModifierMask=3; + var tag=value & TagMask; + value >>=4; + var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask, 6); + value >>=6; + var unit=value & UnitMask; + value >>=3; + var modifier=value & ModifierMask; + try + { + date.val=new $h._relativeDate(modifier, offset, unit, tag); + return true + } + catch($$e_A) + { + date.val=null; + return false + } +}; +$h.MeetingSuggestionTimeDecoder._fromComplement$p=function $h_MeetingSuggestionTimeDecoder$_fromComplement$p(value, n) +{ + var signed=1 << (n - 1); + var mask=(1 << n) - 1; + if ((value & signed)===signed) + { + return -((value ^ mask)+1) + } + else + { + return value + } +}; +$h.MeetingSuggestionTimeDecoder._daysInMonth$p=function $h_MeetingSuggestionTimeDecoder$_daysInMonth$p(month, year) +{ + return 32 - new Date(year, month, 32).getDate() +}; +$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function $h_MeetingSuggestionTimeDecoder$_getTimeOfDayInMillisecondsUTC$p(inputTime) +{ + var timeOfDay=0; + timeOfDay+=inputTime.getUTCHours() * 3600; + timeOfDay+=inputTime.getUTCMinutes() * 60; + timeOfDay+=inputTime.getUTCSeconds(); + timeOfDay *=1000; + timeOfDay+=inputTime.getUTCMilliseconds(); + return timeOfDay +}; +$h._extractedDate=function $h__extractedDate(){}; +$h._preciseDate=function $h__preciseDate(day, month, year) +{ + $h._preciseDate.initializeBase(this); + if (day < 0 || day > 31) + { + throw Error.argumentOutOfRange('day'); + } + if (month < 0 || month > 12) + { + throw Error.argumentOutOfRange('month'); + } + this._day$i$1=day; + this._month$i$1=month; + if (!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + if (!month && day) + { + throw Error.argument('Invalid arguments'); + } + if (year < 0 || year > 2099) + { + throw Error.argumentOutOfRange('year'); + } + this._year$i$1=year % 100 + } + else if (!this._month$i$1 && !this._day$i$1) + { + throw Error.argument('Invalid datetime'); + } +}; +$h._preciseDate.prototype={ + _day$i$1: 0, _month$i$1: 0, _year$i$1: null +}; +$h._relativeDate=function $h__relativeDate(modifier, offset, unit, tag) +{ + $h._relativeDate.initializeBase(this); + if (offset < -32 || offset > 31) + { + throw Error.argumentOutOfRange('offset'); + } + if (tag < 0 || tag > 15) + { + throw Error.argumentOutOfRange('tag'); + } + if (!unit && offset < 0) + { + throw Error.argument('unit & offset do not form a valid date'); + } + this._modifier$i$1=modifier; + this._offset$i$1=offset; + this._unit$i$1=unit; + this._tag$i$1=tag +}; +$h._relativeDate.prototype={ + _modifier$i$1: 0, _offset$i$1: 0, _unit$i$1: 0, _tag$i$1: 0 +}; +$h.Message=function $h_Message(dataDictionary) +{ + this.$$d__getConversationId$p$2=Function.createDelegate(this, this._getConversationId$p$2); + this.$$d__getInternetMessageId$p$2=Function.createDelegate(this, this._getInternetMessageId$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this, this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this, this._getTo$p$2); + this.$$d__getFrom$p$2=Function.createDelegate(this, this._getFrom$p$2); + this.$$d__getSender$p$2=Function.createDelegate(this, this._getSender$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this, this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this, this._getSubject$p$2); + $h.Message.initializeBase(this, [dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'sender', this.$$d__getSender$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'from', this.$$d__getFrom$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'internetMessageId', this.$$d__getInternetMessageId$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$2) +}; +$h.Message.prototype={ + getEntities: function $h_Message$getEntities() + { + return this._data$p$0._getEntities$i$0() + }, getEntitiesByType: function $h_Message$getEntitiesByType(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, getFilteredEntitiesByName: function $h_Message$getFilteredEntitiesByName(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, getRegExMatches: function $h_Message$getRegExMatches() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0() + }, getRegExMatchesByName: function $h_Message$getRegExMatchesByName(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, displayReplyForm: function $h_Message$displayReplyForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody) + }, displayReplyAllForm: function $h_Message$displayReplyAllForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody) + }, getItemType: function $h_Message$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, _getSubject$p$2: function $h_Message$_getSubject$p$2() + { + return this._data$p$0.get__subject$i$0() + }, _getNormalizedSubject$p$2: function $h_Message$_getNormalizedSubject$p$2() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, _getSender$p$2: function $h_Message$_getSender$p$2() + { + return this._data$p$0.get__sender$i$0() + }, _getFrom$p$2: function $h_Message$_getFrom$p$2() + { + return this._data$p$0.get__from$i$0() + }, _getTo$p$2: function $h_Message$_getTo$p$2() + { + return this._data$p$0.get__to$i$0() + }, _getCc$p$2: function $h_Message$_getCc$p$2() + { + return this._data$p$0.get__cc$i$0() + }, _getInternetMessageId$p$2: function $h_Message$_getInternetMessageId$p$2() + { + return this._data$p$0.get__internetMessageId$i$0() + }, _getConversationId$p$2: function $h_Message$_getConversationId$p$2() + { + return this._data$p$0.get__conversationId$i$0() + } +}; +$h.MessageCompose=function $h_MessageCompose(data) +{ + this.$$d__getConversationId$p$2=Function.createDelegate(this, this._getConversationId$p$2); + this.$$d__getBcc$p$2=Function.createDelegate(this, this._getBcc$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this, this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this, this._getTo$p$2); + $h.MessageCompose.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'bcc', this.$$d__getBcc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$2) +}; +$h.MessageCompose.prototype={ + _to$p$2: null, _cc$p$2: null, _bcc$p$2: null, getItemType: function $h_MessageCompose$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, _getTo$p$2: function $h_MessageCompose$_getTo$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._to$p$2) + { + this._to$p$2=new $h.ComposeRecipient(0, 'to') + } + return this._to$p$2 + }, _getCc$p$2: function $h_MessageCompose$_getCc$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._cc$p$2) + { + this._cc$p$2=new $h.ComposeRecipient(1, 'cc') + } + return this._cc$p$2 + }, _getBcc$p$2: function $h_MessageCompose$_getBcc$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._bcc$p$2) + { + this._bcc$p$2=new $h.ComposeRecipient(2, 'bcc') + } + return this._bcc$p$2 + }, _getConversationId$p$2: function $h_MessageCompose$_getConversationId$p$2() + { + return this._data$p$0.get__conversationId$i$0() + } +}; +$h.OutlookErrorManager=function $h_OutlookErrorManager(){}; +$h.OutlookErrorManager.getErrorArgs=function $h_OutlookErrorManager$getErrorArgs(errorCode) +{ + if (!$h.OutlookErrorManager._isInitialized$p) + { + $h.OutlookErrorManager._initialize$p() + } + return OSF.DDA.ErrorCodeManager.getErrorArgs(errorCode) +}; +$h.OutlookErrorManager._initialize$p=function $h_OutlookErrorManager$_initialize$p() +{ + $h.OutlookErrorManager._addErrorMessage$p(9000, 'AttachmentSizeExceeded', _u.ExtensibilityStrings.l_AttachmentExceededSize_Text); + $h.OutlookErrorManager._addErrorMessage$p(9001, 'NumberOfAttachmentsExceeded', _u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text); + $h.OutlookErrorManager._addErrorMessage$p(9002, 'InternalFormatError', _u.ExtensibilityStrings.l_InternalFormatError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9003, 'InvalidAttachmentId', _u.ExtensibilityStrings.l_InvalidAttachmentId_Text); + $h.OutlookErrorManager._addErrorMessage$p(9004, 'InvalidAttachmentPath', _u.ExtensibilityStrings.l_InvalidAttachmentPath_Text); + $h.OutlookErrorManager._addErrorMessage$p(9005, 'CannotAddAttachmentBeforeUpgrade', _u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text); + $h.OutlookErrorManager._addErrorMessage$p(9006, 'AttachmentDeletedBeforeUploadCompletes', _u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text); + $h.OutlookErrorManager._addErrorMessage$p(9007, 'AttachmentUploadGeneralFailure', _u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9008, 'AttachmentToDeleteDoesNotExist', _u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text); + $h.OutlookErrorManager._addErrorMessage$p(9009, 'AttachmentDeleteGeneralFailure', _u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9010, 'InvalidEndTime', _u.ExtensibilityStrings.l_InvalidEndTime_Text); + $h.OutlookErrorManager._addErrorMessage$p(9011, 'HtmlSanitizationFailure', _u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9012, 'NumberOfRecipientsExceeded', String.format(_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text, 100)); + $h.OutlookErrorManager._addErrorMessage$p(9013, 'NoValidRecipientsProvided', _u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text); + $h.OutlookErrorManager._addErrorMessage$p(9014, 'CursorPositionChanged', _u.ExtensibilityStrings.l_CursorPositionChanged_Text); + $h.OutlookErrorManager._isInitialized$p=true +}; +$h.OutlookErrorManager._addErrorMessage$p=function $h_OutlookErrorManager$_addErrorMessage$p(errorCode, errorName, errorMessage) +{ + OSF.DDA.ErrorCodeManager.addErrorMessage(errorCode, { + name: errorName, message: errorMessage + }) +}; +$h.OutlookErrorManager.OutlookErrorCodes=function $h_OutlookErrorManager_OutlookErrorCodes(){}; +$h.OutlookErrorManager.OsfDdaErrorCodes=function $h_OutlookErrorManager_OsfDdaErrorCodes(){}; +$h.PhoneNumber=function $h_PhoneNumber(data) +{ + this.$$d__getPhoneType$p$0=Function.createDelegate(this, this._getPhoneType$p$0); + this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this, this._getOriginalPhoneString$p$0); + this.$$d__getPhoneString$p$0=Function.createDelegate(this, this._getPhoneString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneString', this.$$d__getPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'originalPhoneString', this.$$d__getOriginalPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'type', this.$$d__getPhoneType$p$0) +}; +$h.PhoneNumber.prototype={ + _data$p$0: null, _getPhoneString$p$0: function $h_PhoneNumber$_getPhoneString$p$0() + { + return this._data$p$0['PhoneString'] + }, _getOriginalPhoneString$p$0: function $h_PhoneNumber$_getOriginalPhoneString$p$0() + { + return this._data$p$0['OriginalPhoneString'] + }, _getPhoneType$p$0: function $h_PhoneNumber$_getPhoneType$p$0() + { + return this._data$p$0['Type'] + } +}; +$h.TaskSuggestion=function $h_TaskSuggestion(data) +{ + this.$$d__getAssignees$p$0=Function.createDelegate(this, this._getAssignees$p$0); + this.$$d__getTaskString$p$0=Function.createDelegate(this, this._getTaskString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'taskString', this.$$d__getTaskString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'assignees', this.$$d__getAssignees$p$0) +}; +$h.TaskSuggestion.prototype={ + _data$p$0: null, _assignees$p$0: null, _getTaskString$p$0: function $h_TaskSuggestion$_getTaskString$p$0() + { + return this._data$p$0['TaskString'] + }, _getAssignees$p$0: function $h_TaskSuggestion$_getAssignees$p$0() + { + if (!this._assignees$p$0) + { + var $$t_1=this; + this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Assignees', function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._assignees$p$0 + } +}; +$h.UserProfile=function $h_UserProfile(data) +{ + this.$$d__getTimeZone$p$0=Function.createDelegate(this, this._getTimeZone$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'timeZone', this.$$d__getTimeZone$p$0) +}; +$h.UserProfile.prototype={ + _data$p$0: null, _getDisplayName$p$0: function $h_UserProfile$_getDisplayName$p$0() + { + return this._data$p$0.get__userDisplayName$i$0() + }, _getEmailAddress$p$0: function $h_UserProfile$_getEmailAddress$p$0() + { + return this._data$p$0.get__userEmailAddress$i$0() + }, _getTimeZone$p$0: function $h_UserProfile$_getTimeZone$p$0() + { + return this._data$p$0.get__userTimeZone$i$0() + } +}; +$h.RequestState=function(){}; +$h.RequestState.prototype={ + unsent: 0, opened: 1, headersReceived: 2, loading: 3, done: 4 +}; +$h.RequestState.registerEnum('$h.RequestState', false); +$h.CommonParameters=function $h_CommonParameters(options, callback, asyncContext) +{ + this._options$p$0=options; + this._callback$p$0=callback; + this._asyncContext$p$0=asyncContext +}; +$h.CommonParameters.parse=function $h_CommonParameters$parse(args, isCallbackRequired, tryLegacy) +{ + var legacyParameters; + var $$t_8, + $$t_9; + if (tryLegacy && (($$t_9=$h.CommonParameters._tryParseLegacy$p(args, ($$t_8={val: legacyParameters}))), legacyParameters=$$t_8.val, $$t_9)) + { + return legacyParameters + } + var argsLength=args.length; + var options=null; + var callback=null; + var asyncContext=null; + if (argsLength===1) + { + if (Function.isInstanceOfType(args[0])) + { + callback=args[0] + } + else if (Object.isInstanceOfType(args[0])) + { + options=args[0] + } + else + { + throw Error.argumentType(); + } + } + else if (argsLength===2) + { + if (!(Object.isInstanceOfType(args[0]))) + { + throw Error.argument('options'); + } + if (!(Function.isInstanceOfType(args[1]))) + { + throw Error.argument('callback'); + } + options=args[0]; + callback=args[1] + } + else if (argsLength) + { + throw Error.parameterCount(_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text); + } + if (isCallbackRequired && !callback) + { + throw Error.argumentNull('callback'); + } + if (options && !$h.ScriptHelpers.isNullOrUndefined(options['asyncContext'])) + { + asyncContext=options['asyncContext'] + } + return new $h.CommonParameters(options, callback, asyncContext) +}; +$h.CommonParameters._tryParseLegacy$p=function $h_CommonParameters$_tryParseLegacy$p(args, commonParameters) +{ + commonParameters.val=null; + var argsLength=args.length; + var callback=null; + var userContext=null; + if (!argsLength || argsLength > 2) + { + return false + } + if (!(Function.isInstanceOfType(args[0]))) + { + return false + } + callback=args[0]; + if (argsLength > 1) + { + userContext=args[1] + } + commonParameters.val=new $h.CommonParameters(null, callback, userContext); + return true +}; +$h.CommonParameters.prototype={ + _options$p$0: null, _callback$p$0: null, _asyncContext$p$0: null, get_options: function $h_CommonParameters$get_options() + { + return this._options$p$0 + }, get_callback: function $h_CommonParameters$get_callback() + { + return this._callback$p$0 + }, get_asyncContext: function $h_CommonParameters$get_asyncContext() + { + return this._asyncContext$p$0 + } +}; +$h.EwsRequest=function $h_EwsRequest(userContext) +{ + this.readyState=1; + $h.EwsRequest.initializeBase(this, [userContext]) +}; +$h.EwsRequest.prototype={ + status: 0, statusText: null, onreadystatechange: null, responseText: null, get__statusCode$i$1: function $h_EwsRequest$get__statusCode$i$1() + { + return this.status + }, set__statusCode$i$1: function $h_EwsRequest$set__statusCode$i$1(value) + { + this.status=value; + return value + }, get__statusDescription$i$1: function $h_EwsRequest$get__statusDescription$i$1() + { + return this.statusText + }, set__statusDescription$i$1: function $h_EwsRequest$set__statusDescription$i$1(value) + { + this.statusText=value; + return value + }, get__requestState$i$1: function $h_EwsRequest$get__requestState$i$1() + { + return this.readyState + }, set__requestState$i$1: function $h_EwsRequest$set__requestState$i$1(value) + { + this.readyState=value; + return value + }, get__response$i$1: function $h_EwsRequest$get__response$i$1() + { + return this.responseText + }, set__response$i$1: function $h_EwsRequest$set__response$i$1(value) + { + this.responseText=value; + return value + }, send: function $h_EwsRequest$send(data) + { + this._checkSendConditions$i$1(); + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + this._throwInvalidStateException$i$1() + } + this._sendRequest$i$0(5, 'EwsRequest', {body: data}) + }, _callOnReadyStateChangeCallback$i$1: function $h_EwsRequest$_callOnReadyStateChangeCallback$i$1() + { + if (!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) + { + this.onreadystatechange() + } + }, _parseExtraResponseData$i$1: function $h_EwsRequest$_parseExtraResponseData$i$1(response){} +}; +$h.InitialData=function $h_InitialData(data) +{ + this._data$p$0=data; + this._permissionLevel$p$0=this._calculatePermissionLevel$p$0() +}; +$h.InitialData._defineReadOnlyProperty$i=function $h_InitialData$_defineReadOnlyProperty$i(o, methodName, getter) +{ + var propertyDescriptor={ + get: getter, configurable: false + }; + Object.defineProperty(o, methodName, propertyDescriptor) +}; +$h.InitialData.prototype={ + _toRecipients$p$0: null, _ccRecipients$p$0: null, _attachments$p$0: null, _resources$p$0: null, _entities$p$0: null, _data$p$0: null, _permissionLevel$p$0: 0, get__itemId$i$0: function $h_InitialData$get__itemId$i$0() + { + return this._data$p$0['id'] + }, get__itemClass$i$0: function $h_InitialData$get__itemClass$i$0() + { + return this._data$p$0['itemClass'] + }, get__dateTimeCreated$i$0: function $h_InitialData$get__dateTimeCreated$i$0() + { + return new Date(this._data$p$0['dateTimeCreated']) + }, get__dateTimeModified$i$0: function $h_InitialData$get__dateTimeModified$i$0() + { + return new Date(this._data$p$0['dateTimeModified']) + }, get__dateTimeSent$i$0: function $h_InitialData$get__dateTimeSent$i$0() + { + return new Date(this._data$p$0['dateTimeSent']) + }, get__subject$i$0: function $h_InitialData$get__subject$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0['subject'] + }, get__normalizedSubject$i$0: function $h_InitialData$get__normalizedSubject$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0['normalizedSubject'] + }, get__internetMessageId$i$0: function $h_InitialData$get__internetMessageId$i$0() + { + return this._data$p$0['internetMessageId'] + }, get__conversationId$i$0: function $h_InitialData$get__conversationId$i$0() + { + return this._data$p$0['conversationId'] + }, get__sender$i$0: function $h_InitialData$get__sender$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var sender=this._data$p$0['sender']; + return ($h.ScriptHelpers.isNullOrUndefined(sender)) ? null : new $h.EmailAddressDetails(sender) + }, get__from$i$0: function $h_InitialData$get__from$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var from=this._data$p$0['from']; + return ($h.ScriptHelpers.isNullOrUndefined(from)) ? null : new $h.EmailAddressDetails(from) + }, get__to$i$0: function $h_InitialData$get__to$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._toRecipients$p$0) + { + this._toRecipients$p$0=this._createEmailAddressDetails$p$0('to') + } + return this._toRecipients$p$0 + }, get__cc$i$0: function $h_InitialData$get__cc$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._ccRecipients$p$0) + { + this._ccRecipients$p$0=this._createEmailAddressDetails$p$0('cc') + } + return this._ccRecipients$p$0 + }, get__attachments$i$0: function $h_InitialData$get__attachments$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._attachments$p$0) + { + this._attachments$p$0=this._createAttachmentDetails$p$0() + } + return this._attachments$p$0 + }, get__ewsUrl$i$0: function $h_InitialData$get__ewsUrl$i$0() + { + return this._data$p$0['ewsUrl'] + }, get__start$i$0: function $h_InitialData$get__start$i$0() + { + return new Date(this._data$p$0['start']) + }, get__end$i$0: function $h_InitialData$get__end$i$0() + { + return new Date(this._data$p$0['end']) + }, get__location$i$0: function $h_InitialData$get__location$i$0() + { + return this._data$p$0['location'] + }, get__resources$i$0: function $h_InitialData$get__resources$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._resources$p$0) + { + this._resources$p$0=this._createEmailAddressDetails$p$0('resources') + } + return this._resources$p$0 + }, get__organizer$i$0: function $h_InitialData$get__organizer$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var organizer=this._data$p$0['organizer']; + return ($h.ScriptHelpers.isNullOrUndefined(organizer)) ? null : new $h.EmailAddressDetails(organizer) + }, get__userDisplayName$i$0: function $h_InitialData$get__userDisplayName$i$0() + { + return this._data$p$0['userDisplayName'] + }, get__userEmailAddress$i$0: function $h_InitialData$get__userEmailAddress$i$0() + { + return this._data$p$0['userEmailAddress'] + }, get__userTimeZone$i$0: function $h_InitialData$get__userTimeZone$i$0() + { + return this._data$p$0['userTimeZone'] + }, get__timeZoneOffsets$i$0: function $h_InitialData$get__timeZoneOffsets$i$0() + { + return this._data$p$0['timeZoneOffsets'] + }, get__hostVersion$i$0: function $h_InitialData$get__hostVersion$i$0() + { + return this._data$p$0['hostVersion'] + }, get__owaView$i$0: function $h_InitialData$get__owaView$i$0() + { + return this._data$p$0['owaView'] + }, get__overrideWindowOpen$i$0: function $h_InitialData$get__overrideWindowOpen$i$0() + { + return this._data$p$0['overrideWindowOpen'] + }, _getEntities$i$0: function $h_InitialData$_getEntities$i$0() + { + if (!this._entities$p$0) + { + this._entities$p$0=new $h.Entities(this._data$p$0['entities'], this._data$p$0['filteredEntities'], this.get__dateTimeSent$i$0(), this._permissionLevel$p$0) + } + return this._entities$p$0 + }, _getEntitiesByType$i$0: function $h_InitialData$_getEntitiesByType$i$0(entityType) + { + var entites=this._getEntities$i$0(); + return entites._getByType$i$0(entityType) + }, _getFilteredEntitiesByName$i$0: function $h_InitialData$_getFilteredEntitiesByName$i$0(name) + { + var entities=this._getEntities$i$0(); + return entities._getFilteredEntitiesByName$i$0(name) + }, _getRegExMatches$i$0: function $h_InitialData$_getRegExMatches$i$0() + { + if (!this._data$p$0['regExMatches']) + { + return null + } + return this._data$p$0['regExMatches'] + }, _getRegExMatchesByName$i$0: function $h_InitialData$_getRegExMatchesByName$i$0(regexName) + { + var regexMatches=this._getRegExMatches$i$0(); + if (!regexMatches || !regexMatches[regexName]) + { + return null + } + return regexMatches[regexName] + }, _throwOnRestrictedPermissionLevel$i$0: function $h_InitialData$_throwOnRestrictedPermissionLevel$i$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0) + }, _createEmailAddressDetails$p$0: function $h_InitialData$_createEmailAddressDetails$p$0(key) + { + var to=this._data$p$0[key]; + if ($h.ScriptHelpers.isNullOrUndefined(to)) + { + return [] + } + var recipients=[]; + for (var i=0; i < to.length; i++) + { + if (!$h.ScriptHelpers.isNullOrUndefined(to[i])) + { + recipients[i]=new $h.EmailAddressDetails(to[i]) + } + } + return recipients + }, _createAttachmentDetails$p$0: function $h_InitialData$_createAttachmentDetails$p$0() + { + var attachments=this._data$p$0['attachments']; + if ($h.ScriptHelpers.isNullOrUndefined(attachments)) + { + return [] + } + var attachmentDetails=[]; + for (var i=0; i < attachments.length; i++) + { + if (!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) + { + attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]) + } + } + return attachmentDetails + }, _calculatePermissionLevel$p$0: function $h_InitialData$_calculatePermissionLevel$p$0() + { + var HostReadItem=1; + var HostReadWriteMailbox=2; + var HostReadWriteItem=3; + var permissionLevelFromHost=this._data$p$0['permissionLevel']; + if ($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0)) + { + return 0 + } + switch (permissionLevelFromHost) + { + case HostReadItem: + return 1; + case HostReadWriteItem: + return 2; + case HostReadWriteMailbox: + return 3; + default: + return 0 + } + } +}; +$h._loadDictionaryRequest=function $h__loadDictionaryRequest(createResultObject, dictionaryName, callback, userContext) +{ + $h._loadDictionaryRequest.initializeBase(this, [userContext]); + this._createResultObject$p$1=createResultObject; + this._dictionaryName$p$1=dictionaryName; + this._callback$p$1=callback +}; +$h._loadDictionaryRequest.prototype={ + _dictionaryName$p$1: null, _createResultObject$p$1: null, _callback$p$1: null, handleResponse: function $h__loadDictionaryRequest$handleResponse(response) + { + if (response['wasSuccessful']) + { + var value=response[this._dictionaryName$p$1]; + var responseData=JSON.parse(value); + this.createAsyncResult(this._createResultObject$p$1(responseData), 0, null) + } + else + { + this.createAsyncResult(null, 1, response['errorMessage']) + } + this._callback$p$1(this._asyncResult$p$0) + } +}; +$h.ProxyRequestBase=function $h_ProxyRequestBase(userContext) +{ + $h.ProxyRequestBase.initializeBase(this, [userContext]) +}; +$h.ProxyRequestBase.prototype={ + handleResponse: function $h_ProxyRequestBase$handleResponse(response) + { + if (!(response['wasProxySuccessful'])) + { + this.set__statusCode$i$1(500); + this.set__statusDescription$i$1('Error'); + var errorMessage=response['errorMessage']; + this.set__response$i$1(errorMessage); + this.createAsyncResult(null, 1, errorMessage) + } + else + { + this.set__statusCode$i$1(response['statusCode']); + this.set__statusDescription$i$1(response['statusDescription']); + this.set__response$i$1(response['body']); + this.createAsyncResult(this.get__response$i$1(), 0, null) + } + this._parseExtraResponseData$i$1(response); + this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() + }, _throwInvalidStateException$i$1: function $h_ProxyRequestBase$_throwInvalidStateException$i$1() + { + throw Error.create('DOMException', { + code: 11, message: 'INVALID_STATE_ERR' + }); + }, _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function $h_ProxyRequestBase$_cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() + { + var $$t_0=this; + this._changeReadyState$i$1(2, function() + { + $$t_0._changeReadyState$i$1(3, function() + { + $$t_0._changeReadyState$i$1(4, null) + }) + }) + }, _changeReadyState$i$1: function $h_ProxyRequestBase$_changeReadyState$i$1(state, nextStep) + { + this.set__requestState$i$1(state); + var $$t_2=this; + window.setTimeout(function() + { + try + { + $$t_2._callOnReadyStateChangeCallback$i$1() + } + finally + { + if (!$h.ScriptHelpers.isNullOrUndefined(nextStep)) + { + nextStep() + } + } + }, 0) + }, _checkSendConditions$i$1: function $h_ProxyRequestBase$_checkSendConditions$i$1() + { + if (this.get__requestState$i$1() !==1) + { + this._throwInvalidStateException$i$1() + } + if (this._isSent$p$0) + { + this._throwInvalidStateException$i$1() + } + } +}; +$h.RequestBase=function $h_RequestBase(userContext) +{ + this._userContext$p$0=userContext +}; +$h.RequestBase.prototype={ + _isSent$p$0: false, _asyncResult$p$0: null, _userContext$p$0: null, _sendRequest$i$0: function $h_RequestBase$_sendRequest$i$0(dispid, methodName, dataToSend) + { + this._isSent$p$0=true; + var $$t_5=this; + OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid, methodName, dataToSend, function(resultCode, response) + { + if (resultCode) + { + $$t_5.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode)) + } + else + { + $$t_5.handleResponse(response) + } + }) + }, createAsyncResult: function $h_RequestBase$createAsyncResult(value, errorCode, errorDescription) + { + this._asyncResult$p$0=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(value, errorCode, errorDescription, this._userContext$p$0) + } +}; +$h._saveDictionaryRequest=function $h__saveDictionaryRequest(callback, userContext) +{ + $h._saveDictionaryRequest.initializeBase(this, [userContext]); + if (!$h.ScriptHelpers.isNullOrUndefined(callback)) + { + this._callback$p$1=callback + } +}; +$h._saveDictionaryRequest.prototype={ + _callback$p$1: null, handleResponse: function $h__saveDictionaryRequest$handleResponse(response) + { + if (response['wasSuccessful']) + { + this.createAsyncResult(null, 0, null) + } + else + { + this.createAsyncResult(null, 1, response['errorMessage']) + } + if (!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) + { + this._callback$p$1(this._asyncResult$p$0) + } + } +}; +$h.ScriptHelpers=function $h_ScriptHelpers(){}; +$h.ScriptHelpers.isNull=function $h_ScriptHelpers$isNull(value) +{ + return null===value +}; +$h.ScriptHelpers.isNullOrUndefined=function $h_ScriptHelpers$isNullOrUndefined(value) +{ + return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value) +}; +$h.ScriptHelpers.isUndefined=function $h_ScriptHelpers$isUndefined(value) +{ + return value===undefined +}; +$h.ScriptHelpers.dictionaryContainsKey=function $h_ScriptHelpers$dictionaryContainsKey(obj, keyName) +{ + return (Object.isInstanceOfType(obj)) ? keyName in obj : false +}; +$h.ScriptHelpers.isNonEmptyString=function $h_ScriptHelpers$isNonEmptyString(value) +{ + if (!value) + { + return false + } + return String.isInstanceOfType(value) +}; +OSF.DDA.OutlookAppOm.registerClass('OSF.DDA.OutlookAppOm'); +OSF.DDA.Settings.registerClass('OSF.DDA.Settings'); +$h.ItemBase.registerClass('$h.ItemBase'); +$h.Item.registerClass('$h.Item', $h.ItemBase); +$h.Appointment.registerClass('$h.Appointment', $h.Item); +$h.ComposeItem.registerClass('$h.ComposeItem', $h.ItemBase); +$h.AppointmentCompose.registerClass('$h.AppointmentCompose', $h.ComposeItem); +$h.AttachmentDetails.registerClass('$h.AttachmentDetails'); +$h.ComposeBody.registerClass('$h.ComposeBody'); +$h.ComposeRecipient.registerClass('$h.ComposeRecipient'); +$h.ComposeLocation.registerClass('$h.ComposeLocation'); +$h.ComposeSubject.registerClass('$h.ComposeSubject'); +$h.ComposeTime.registerClass('$h.ComposeTime'); +$h.Contact.registerClass('$h.Contact'); +$h.CustomProperties.registerClass('$h.CustomProperties'); +$h.Diagnostics.registerClass('$h.Diagnostics'); +$h.EmailAddressDetails.registerClass('$h.EmailAddressDetails'); +$h.Entities.registerClass('$h.Entities'); +Office.cast.item.registerClass('Office.cast.item'); +$h.Message.registerClass('$h.Message', $h.Item); +$h.MeetingRequest.registerClass('$h.MeetingRequest', $h.Message); +$h.MeetingSuggestion.registerClass('$h.MeetingSuggestion'); +$h.MeetingSuggestionTimeDecoder.registerClass('$h.MeetingSuggestionTimeDecoder'); +$h._extractedDate.registerClass('$h._extractedDate'); +$h._preciseDate.registerClass('$h._preciseDate', $h._extractedDate); +$h._relativeDate.registerClass('$h._relativeDate', $h._extractedDate); +$h.MessageCompose.registerClass('$h.MessageCompose', $h.ComposeItem); +$h.OutlookErrorManager.registerClass('$h.OutlookErrorManager'); +$h.OutlookErrorManager.OutlookErrorCodes.registerClass('$h.OutlookErrorManager.OutlookErrorCodes'); +$h.OutlookErrorManager.OsfDdaErrorCodes.registerClass('$h.OutlookErrorManager.OsfDdaErrorCodes'); +$h.PhoneNumber.registerClass('$h.PhoneNumber'); +$h.TaskSuggestion.registerClass('$h.TaskSuggestion'); +$h.UserProfile.registerClass('$h.UserProfile'); +$h.CommonParameters.registerClass('$h.CommonParameters'); +$h.RequestBase.registerClass('$h.RequestBase'); +$h.ProxyRequestBase.registerClass('$h.ProxyRequestBase', $h.RequestBase); +$h.EwsRequest.registerClass('$h.EwsRequest', $h.ProxyRequestBase); +$h.InitialData.registerClass('$h.InitialData'); +$h._loadDictionaryRequest.registerClass('$h._loadDictionaryRequest', $h.RequestBase); +$h._saveDictionaryRequest.registerClass('$h._saveDictionaryRequest', $h.RequestBase); +$h.ScriptHelpers.registerClass('$h.ScriptHelpers'); +OSF.DDA.OutlookAppOm.asyncMethodTimeoutKeyName='__timeout__'; +OSF.DDA.OutlookAppOm._maxRecipients$p=100; +OSF.DDA.OutlookAppOm._maxSubjectLength$p=255; +OSF.DDA.OutlookAppOm._maxBodyLength$p=32768; +OSF.DDA.OutlookAppOm._maxLocationLength$p=255; +OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1000000; +OSF.DDA.OutlookAppOm._instance$p=null; +$h.AttachmentDetails._attachmentTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File, Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item]; +$h.ComposeBody.coercionTypeParameterName='coercionType'; +$h.ComposeItem.maxAttachmentNameLength=255; +$h.ComposeItem.maxUriLength=2048; +$h.ComposeItem.maxItemIdLength=200; +$h.ComposeItem.maxRemoveIdLength=200; +$h.ComposeRecipient.displayNameLengthLimit=255; +$h.ComposeRecipient.maxSmtpLength=571; +$h.ComposeRecipient.recipientsLimit=100; +$h.ComposeRecipient.addressParameterName='address'; +$h.ComposeRecipient.nameParameterName='name'; +$h.ComposeLocation.locationKey='location'; +$h.ComposeLocation.maximumLocationLength=255; +$h.ComposeSubject.maximumSubjectLength=255; +$h.ComposeTime.timeTypeName='TimeProperty'; +$h.ComposeTime.timeDataName='time'; +$h.Diagnostics.outlookAppName='Outlook'; +$h.Diagnostics.outlookWebAppName='OutlookWebApp'; +$h.EmailAddressDetails._emptyString$p=''; +$h.EmailAddressDetails._responseTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined]; +$h.EmailAddressDetails._recipientTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser]; +$h.Entities._allEntityKeys$p=['Addresses', 'EmailAddresses', 'Urls', 'PhoneNumbers', 'TaskSuggestions', 'MeetingSuggestions', 'Contacts']; +$h.MeetingSuggestionTimeDecoder._baseDate$p=new Date('0001-01-01T00:00:00Z'); +$h.OutlookErrorManager.errorNameKey='name'; +$h.OutlookErrorManager.errorMessageKey='message'; +$h.OutlookErrorManager._isInitialized$p=false; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9000; +$h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001; +$h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002; +$h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003; +$h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004; +$h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009; +$h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010; +$h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011; +$h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012; +$h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013; +$h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014; +$h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1000; +$h.CommonParameters.asyncContextKeyName='asyncContext'; +$h.ScriptHelpers.emptyString=''; +OSF.ClientMode={ + ReadWrite: 0, ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", Compressed: "compressed" +}; +OSF.DDA.RichClientSettingsManager={ + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving) + { + var keys=[]; + var values=[]; + if (onCalling) + { + onCalling() + } + window.external.GetContext().GetSettings().Read(keys, values); + if (onReceiving) + { + onReceiving() + } + var serializedSettings={}; + for (var index=0; index < keys.length; index++) + { + serializedSettings[keys[index]]=values[index] + } + return serializedSettings + }, write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving) + { + var keys=[]; + var values=[]; + for (var key in serializedSettings) + { + keys.push(key); + values.push(serializedSettings[key]) + } + if (onCalling) + { + onCalling() + } + window.external.GetContext().GetSettings().Write(keys, values); + if (onReceiving) + { + onReceiving() + } + } +}; +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function(actionId) +{ + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) + { + return function(args) + { + var status, + response; + try + { + response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess + } + catch(ex) + { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ + name: Strings.OfficeOM.L_InternalError, message: ex + } + } + if (args.onComplete) + { + args.onComplete(status, response) + } + } + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) + { + return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving) + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) + { + return OSF.DDA.RichClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving) + } + switch (actionId) + { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break + } + return delegateMethods +}; +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) +{ + OSF.OUtil.defineEnumerableProperties(this, { + size: {value: fileSize}, sliceCount: {value: Math.ceil(fileSize / sliceSize)} + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [am.GetDocumentCopyChunkAsync, am.ReleaseDocumentCopyAsync], privateState) +}; +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() +{ + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [am.AddDataPartAsync, am.GetDataPartByIdAsync, am.GetDataPartsByNameSpaceAsync]) +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) +{ + OSF.OUtil.defineEnumerableProperties(this, { + builtIn: {value: builtIn}, id: {value: id}, namespaceManager: {value: new OSF.DDA.CustomXmlPrefixMappings(id)} + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [am.DeleteDataPartAsync, am.GetPartNodesAsync, am.GetPartXmlAsync]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) + { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([et.DataNodeDeleted, et.DataNodeInserted, et.DataNodeReplaced]); + customXmlPartEventDispatches[id]=dispatch + } + OSF.DDA.DispIdHost.addEventSupport(this, dispatch) +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) +{ + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [am.AddDataPartNamespaceAsync, am.GetDataPartNamespaceAsync, am.GetDataPartPrefixAsync], partId) +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) +{ + OSF.OUtil.defineEnumerableProperties(this, { + baseName: {value: baseName}, namespaceUri: {value: ns}, nodeType: {value: nodeType} + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [am.GetRelativeNodesAsync, am.GetNodeValueAsync, am.GetNodeXmlAsync, am.SetNodeValueAsync, am.SetNodeXmlAsync], handle) +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) +{ + OSF.OUtil.defineEnumerableProperties(this, { + type: {value: Microsoft.Office.WebExtension.EventType.DataNodeInserted}, newNode: {value: newNode}, inUndoRedo: {value: inUndoRedo} + }) +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) +{ + OSF.OUtil.defineEnumerableProperties(this, { + type: {value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced}, oldNode: {value: oldNode}, newNode: {value: newNode}, inUndoRedo: {value: inUndoRedo} + }) +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) +{ + OSF.OUtil.defineEnumerableProperties(this, { + type: {value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted}, oldNode: {value: oldNode}, oldNextSibling: {value: oldNextSibling}, inUndoRedo: {value: inUndoRedo} + }) +} + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.01.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.01.js new file mode 100644 index 000000000..385edb3e9 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.01.js @@ -0,0 +1,17 @@ +/* Outlook specific API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/*! + Copyright (c) Microsoft Corporation. All rights reserved. +*/ +/*! + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ +Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item"};Microsoft.Office.WebExtension.MailboxEnums.BodyType={Text:"text",Html:"html"};Microsoft.Office.WebExtension.CoercionType={Text:"text",Html:"html"};Type.registerNamespace("OSF.DDA");OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d_$2O_0=Function.createDelegate(this,this.$2O_0);this.$$d_$2g_0=Function.createDelegate(this,this.$2g_0);this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);this.$$d_$32_0=Function.createDelegate(this,this.$32_0);this.$$d_$30_0=Function.createDelegate(this,this.$30_0);this.$$d_$3S_0=Function.createDelegate(this,this.$3S_0);this.$$d_$3A_0=Function.createDelegate(this,this.$3A_0);this.$$d_$37_0=Function.createDelegate(this,this.$37_0);OSF.DDA.OutlookAppOm.$2=this;this.$X_0=n;this.$1X_0=i;var r=this;var u=function(){i&&r.$B_0(1,"GetInitialData",null,r.$$d_$37_0)};this.$1Y_0()?u():this.$3Z_0(u)};OSF.DDA.OutlookAppOm.$J=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};OSF.DDA.OutlookAppOm.$A=function(n,t,i,r){if(ni)throw Error.argumentOutOfRange(r);};OSF.DDA.OutlookAppOm.$M=function(n,t,i){if(Object.getType(n)!==t)throw Error.argumentType(i);};OSF.DDA.OutlookAppOm.$1W=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm.$M(n,String,r);var u=n;OSF.DDA.OutlookAppOm.$A(u.length,t,i,r)}};OSF.DDA.OutlookAppOm.$2T=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:case 14:case 18:case 26:break;case 4:var r=JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm.$o(t.requiredAttendees),OSF.DDA.OutlookAppOm.$o(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm.$o(t.resources),t.subject,t.body];break;case 11:case 10:i=[t.htmlBody];break;case 23:case 13:i=[t.data,t.coercionType||null];break;case 17:i=[t.subject];break;case 15:i=[t.recipientField];break;case 22:case 21:i=[t.recipientField,OSF.DDA.OutlookAppOm.$2R(t.recipientArray)];break;case 19:i=[t.itemId,t.name];break;case 16:i=[t.uri,t.name];break;case 20:i=[t.attachmentIndex];break;case 25:i=[t.TimeProperty,t.time];break;case 24:i=[t.TimeProperty];break;case 27:i=[t.location];break;default:break}return i};OSF.DDA.OutlookAppOm.$o=function(n){return n?n.join(";"):null};OSF.DDA.OutlookAppOm.$2R=function(n){if(!n)return null;for(var i=new Array(n.length),t=0;tOSF.DDA.OutlookAppOm.$27)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);this.$4_0(3,"makeEwsRequestAsync");var u=$h.CommonParameters.parse(r,!0,!0);var i=new $h.EwsRequest(u.$3_0);var f=this;i.onreadystatechange=function(){4===i.get_$2C_1()&&u.get_callback()(i.$R_0)};i.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$B_0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$B_0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$B_0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this.$5_0&&this.$5_0.get_$1Q_0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this.$1q_0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this.$r_0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this.$2f_0(n);if(this.$5_0&&this.$5_0.get_$1Q_0()){var i=this.$1q_0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},getUserIdentityTokenAsync:function(){for(var t=[],n=0;n1&&i[1]){f.error=!0;f.errorCode=i[1]}else f.error=!1;r(t,f)}else if(Number.isInstanceOfType(u)){var e={};e.error=!0;e.errorCode=u;r(t,e)}else throw Error.notImplemented("Return data type from host must be Dictionary or int");}})}else r&&r(-2,null)},$2f_0:function(n){var t=new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds?n.milliseconds:0);if(isNaN(t.getTime()))throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);return t},$r_0:function(n){var t={};t.month=n.getMonth();t.date=n.getDate();t.year=n.getFullYear();t.hours=n.getHours();t.minutes=n.getMinutes();t.seconds=n.getSeconds();t.milliseconds=n.getMilliseconds();return t},$2g_0:function(n){var i=OSF.DDA.OutlookAppOm.$2K(n.requiredAttendees,"requiredAttendees");var r=OSF.DDA.OutlookAppOm.$2K(n.optionalAttendees,"optionalAttendees");OSF.DDA.OutlookAppOm.$1W(n.location,0,OSF.DDA.OutlookAppOm.$28,"location");OSF.DDA.OutlookAppOm.$1W(n.body,0,OSF.DDA.OutlookAppOm.$W,"body");OSF.DDA.OutlookAppOm.$1W(n.subject,0,OSF.DDA.OutlookAppOm.$2A,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){OSF.DDA.OutlookAppOm.$M(n.start,Date,"start");var f=n.start;n.start=f.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){OSF.DDA.OutlookAppOm.$M(n.end,Date,"end");var u=n.end;if(u=0&&n.getTime()-f<0)return parseInt(i.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},$1Y_0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},$3Z_0:function(n){for(var o=null,h="",c=document.getElementsByTagName("script"),s=c.length-1;s>=0;s--){var i=null;var l=c[s].attributes;if(l){var a=l.getNamedItem("src");a&&(i=a.value);if(i){var v=!1;i=i.toLowerCase();var u=i.indexOf("office_strings.js");if(u<0){u=i.indexOf("office_strings.debug.js");v=!0}if(u>0&&uf+1&&(h=r.substring(0,f+1));break}}}}if(o){var y=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var p=this;var w=function(){if(!p.$1Y_0()){var n=h+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=p.$1h_0(n);t.onload=e;t.onreadystatechange=e;y.appendChild(t)}};t=this.$1h_0(o);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);y.appendChild(t)}},$1h_0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};OSF.DDA.Settings=function(n){this.$1D_0=n};OSF.DDA.Settings.$2S=function(n){if(!n)return{};if(OSF.DDA.OutlookAppOm.$2.get_$c_0()===8){var t=n.SettingsKey;if(t)return OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={$1D_0:null,$1K_0:null,get_$N_0:function(){if(!this.$1K_0){this.$1K_0=OSF.DDA.Settings.$2S(this.$1D_0);this.$1D_0=null}return this.$1K_0},get:function(n){return this.get_$N_0()[n]},set:function(n,t){this.get_$N_0()[n]=t},remove:function(n){delete this.get_$N_0()[n]},saveAsync:function(){for(var i=[],n=0;n255)throw Error.argumentOutOfRange("recipients",n.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text);if(t&&t.length>571)throw Error.argumentOutOfRange("recipients",t.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text);};$h.ComposeRecipient.$2o=function(n){for(var i=n,r=[],t=0;t0)this.$0_0=t[0];else throw Error.argument("data");}else this.$0_0=n};$h.CustomProperties.prototype={$0_0:null,get:function(n){var i=this.$0_0[n];if(typeof i=="string"){var t=i;if(t.length>6&&t.startsWith("Date(")&&t.endsWith(")")){var f=t.substring(5,t.length-1);var r=parseInt(f);if(!isNaN(r)){var u=new Date(r);u&&(i=u)}}}return i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")");this.$0_0[n]=t},remove:function(n){delete this.$0_0[n]},saveAsync:function(){for(var t=[],n=0;nr)throw Error.argument();var i=$h.CommonParameters.parse(t,!1,!0);var u=new $h.SaveDictionaryRequest(i.get_callback(),i.$3_0);u.$1J_0(4,"SaveCustomProperties",{customProperties:this.$0_0})}};$h.Diagnostics=function(n,t){this.$$d_$3H_0=Function.createDelegate(this,this.$3H_0);this.$$d_$35_0=Function.createDelegate(this,this.$35_0);this.$$d_$34_0=Function.createDelegate(this,this.$34_0);this.$0_0=n;this.$Q_0=t;$h.InitialData.$1(this,"hostName",this.$$d_$34_0);$h.InitialData.$1(this,"hostVersion",this.$$d_$35_0);64===this.$Q_0&&$h.InitialData.$1(this,"OWAView",this.$$d_$3H_0)};$h.Diagnostics.prototype={$0_0:null,$Q_0:0,$34_0:function(){if(8===this.$Q_0)return"Outlook";else if(64===this.$Q_0)return"OutlookWebApp";return null},$35_0:function(){return this.$0_0.get_$3T_0()},$3H_0:function(){return this.$0_0.get_$3c_0()}};$h.EmailAddressDetails=function(n){this.$$d_$1z_0=Function.createDelegate(this,this.$1z_0);this.$$d_$1r_0=Function.createDelegate(this,this.$1r_0);this.$$d_$x_0=Function.createDelegate(this,this.$x_0);this.$$d_$y_0=Function.createDelegate(this,this.$y_0);this.$0_0=n;$h.InitialData.$1(this,"emailAddress",this.$$d_$y_0);$h.InitialData.$1(this,"displayName",this.$$d_$x_0);$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData.$1(this,"appointmentResponse",this.$$d_$1r_0);$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData.$1(this,"recipientType",this.$$d_$1z_0)};$h.EmailAddressDetails.$1d=function(n){var t={};var i=n.Name;var r=n.UserId;t.name=i||$h.EmailAddressDetails.$t;t.address=r||$h.EmailAddressDetails.$t;return new $h.EmailAddressDetails(t)};$h.EmailAddressDetails.prototype={$0_0:null,toJSON:function(){var n={};n.emailAddress=this.$y_0();n.displayName=this.$x_0();$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"appointmentResponse")&&(n.appointmentResponse=this.$1r_0());$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"recipientType")&&(n.recipientType=this.$1z_0());return n},$y_0:function(){return this.$0_0.address},$x_0:function(){return this.$0_0.name},$1r_0:function(){var n=this.$0_0.appointmentResponse;return n<$h.EmailAddressDetails.$1I.length?$h.EmailAddressDetails.$1I[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},$1z_0:function(){var n=this.$0_0.recipientType;return n<$h.EmailAddressDetails.$1E.length?$h.EmailAddressDetails.$1E[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}};$h.Entities=function(n,t,i,r){this.$$d_$2W_0=Function.createDelegate(this,this.$2W_0);this.$$d_$1t_0=Function.createDelegate(this,this.$1t_0);this.$$d_$13_0=Function.createDelegate(this,this.$13_0);this.$$d_$17_0=Function.createDelegate(this,this.$17_0);this.$$d_$z_0=Function.createDelegate(this,this.$z_0);this.$$d_$1w_0=Function.createDelegate(this,this.$1w_0);this.$$d_$21_0=Function.createDelegate(this,this.$21_0);this.$$d_$w_0=Function.createDelegate(this,this.$w_0);this.$0_0=n||{};this.$1p_0=t||{};this.$O_0=i;$h.InitialData.$1(this,"addresses",this.$$d_$w_0);$h.InitialData.$1(this,"taskSuggestions",this.$$d_$21_0);$h.InitialData.$1(this,"meetingSuggestions",this.$$d_$1w_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$z_0);$h.InitialData.$1(this,"urls",this.$$d_$17_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$13_0);$h.InitialData.$1(this,"contacts",this.$$d_$1t_0);this.$D_0=r};$h.Entities.$3r=function(n,t,i,r,u,f){var o=null;var e=t[i];if(!e)return new Array(0);u&&(e=$h.Entities.$3s(Object,e,$h.Entities.$2h,f));o=new Array(e.length);for(var c=0,h=e,l=h.length,s=0;s=0;u--){for(var e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t};$h.Entities.prototype={$O_0:null,$0_0:null,$1p_0:null,$E_0:null,$D_0:0,$1N_0:null,$1A_0:null,$L_0:null,$n_0:null,$a_0:null,$s_0:null,$1V_0:null,$2v_0:function(n){if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)return this.$1w_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)return this.$21_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)return this.$w_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)return this.$13_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)return this.$z_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)return this.$17_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)return this.$1t_0();return null},$11_0:function(n){this.$E_0||(this.$E_0={});if(!$h.ScriptHelpers.dictionaryContainsKey(this.$E_0,n)){for(var r=!1,i=0;i<$h.Entities.$b.length;i++){var u=$h.Entities.$b[i];var t=this.$1p_0[u];if(t&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this.$E_0[n]=$h.Entities.$F(t,n);break;case"Addresses":this.$E_0[n]=$h.Entities.$F(t,n,!0);break;case"PhoneNumbers":this.$E_0[n]=$h.Entities.$3r($h.PhoneNumber,t,n,$h.Entities.$1f,!1,null);break;case"TaskSuggestions":this.$E_0[n]=$h.Entities.$3r($h.TaskSuggestion,t,n,$h.Entities.$1i,!0,"TaskString");break;case"MeetingSuggestions":this.$E_0[n]=$h.Entities.$3r($h.MeetingSuggestion,t,n,this.$$d_$2W_0,!0,"MeetingString");break;case"Contacts":this.$E_0[n]=$h.Entities.$3r($h.Contact,t,n,$h.Entities.$1b,!0,"ContactString");break}r=!0;break}}r||(this.$E_0[n]=null)}return this.$E_0[n]},$2W_0:function(n){return new $h.MeetingSuggestion(n,this.$O_0)},$w_0:function(){this.$a_0||(this.$a_0=$h.Entities.$F(this.$0_0,"Addresses",!0));return this.$a_0},$z_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$s_0||(this.$s_0=$h.Entities.$F(this.$0_0,"EmailAddresses",!1));return this.$s_0},$17_0:function(){this.$1V_0||(this.$1V_0=$h.Entities.$F(this.$0_0,"Urls",!1));return this.$1V_0},$13_0:function(){this.$L_0||(this.$L_0=$h.Entities.$3r($h.PhoneNumber,this.$0_0,"PhoneNumbers",$h.Entities.$1f));return this.$L_0},$21_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$1N_0||(this.$1N_0=$h.Entities.$3r($h.TaskSuggestion,this.$0_0,"TaskSuggestions",$h.Entities.$1i,!0,"TaskString"));return this.$1N_0},$1w_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$1A_0||(this.$1A_0=$h.Entities.$3r($h.MeetingSuggestion,this.$0_0,"MeetingSuggestions",this.$$d_$2W_0,!0,"MeetingString"));return this.$1A_0},$1t_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$n_0||(this.$n_0=$h.Entities.$3r($h.Contact,this.$0_0,"Contacts",$h.Entities.$1b,!0,"ContactString"));return this.$n_0}};Office.cast.item=function(){};Office.cast.item.toItemRead=function(n){if($h.Item.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toItemCompose=function(n){if($h.ComposeItem.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessage=function(n){return Office.cast.item.toMessageRead(n)};Office.cast.item.toMessageRead=function(n){if($h.Message.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessageCompose=function(n){if($h.MessageCompose.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMeetingRequest=function(n){if($h.MeetingRequest.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointment=function(n){return Office.cast.item.toAppointmentRead(n)};Office.cast.item.toAppointmentRead=function(n){if($h.Appointment.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointmentCompose=function(n){if($h.AppointmentCompose.isInstanceOfType(n))return n;throw Error.argumentType();};$h.Item=function(n){this.$$d_$2p_1=Function.createDelegate(this,this.$2p_1);this.$$d_$3B_1=Function.createDelegate(this,this.$3B_1);this.$$d_$3C_1=Function.createDelegate(this,this.$3C_1);this.$$d_$2z_1=Function.createDelegate(this,this.$2z_1);this.$$d_$2y_1=Function.createDelegate(this,this.$2y_1);$h.Item.initializeBase(this,[n]);$h.InitialData.$1(this,"dateTimeCreated",this.$$d_$2y_1);$h.InitialData.$1(this,"dateTimeModified",this.$$d_$2z_1);$h.InitialData.$1(this,"itemId",this.$$d_$3C_1);$h.InitialData.$1(this,"itemClass",this.$$d_$3B_1);$h.InitialData.$1(this,"attachments",this.$$d_$2p_1)};$h.Item.prototype={$3C_1:function(){return this.$0_0.get_$3Y_0()},$3B_1:function(){return this.$0_0.get_$3X_0()},$2y_1:function(){return this.$0_0.get_$2Y_0()},$2z_1:function(){return this.$0_0.get_$2Z_0()},$2p_1:function(){return this.$0_0.get_$2M_0()}};$h.ItemBase=function(n){this.$$d_$2V_0=Function.createDelegate(this,this.$2V_0);this.$$d_getItemType=Function.createDelegate(this,this.getItemType);this.$0_0=n;$h.InitialData.$1(this,"itemType",this.$$d_getItemType)};$h.ItemBase.prototype={$0_0:null,get_data:function(){return this.$0_0},loadCustomPropertiesAsync:function(){for(var t=[],n=0;n0)return new Date(n.getFullYear()+t.$C_1,0,1);break;default:break}return n};$h.MeetingSuggestionTimeDecoder.$2j=function(n,t,i){if(t>-5&&t<5){var u;var f;u=(i+6)%7+1;f=7*t+(u-n.getDay());n.setDate(n.getDate()+f);return n}else{var r=(i-n.getDay())%7;r<0&&(r+=7);n.setDate(n.getDate()+r);return n}};$h.MeetingSuggestionTimeDecoder.$2k=function(n,t){var u;var i;var r;u=n;if(t.$I_1<=0||t.$I_1>12||t.$C_1<=0||t.$C_1>5)return n;var e=(12+t.$I_1-u.getMonth()-1)%12;i=new Date(u.getFullYear(),u.getMonth()+e,1);if(t.$K_1===1)if(t.$C_1===1&&i.getDay()!==6&&i.getDay()!==0)return i;else{r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()+(8-i.getDay())%7);i.getDay()!==6&&i.getDay()!==0&&i.getDay()!==1&&r.setDate(r.getDate()-7);r.setDate(r.getDate()+7*(t.$C_1-1));return r.getMonth()+1!==t.$I_1?n:r}else{r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder.$2b(i.getMonth(),i.getFullYear()));var f=1-r.getDay();f>0&&(f=f-7);r.setDate(r.getDate()+f);r.setDate(r.getDate()+7*(1-t.$C_1));return r.getMonth()+1!==t.$I_1?i.getDay()!==6&&i.getDay()!==0?i:n:r}};$h.MeetingSuggestionTimeDecoder.$2c=function(n,t,i){var u=32767;t.val=null;i.val=0;if(!n)return!1;i.val=$h.MeetingSuggestionTimeDecoder.$3Q(n);var f=n.getTime()-i.val;var r=(f-$h.MeetingSuggestionTimeDecoder.$1Z.getTime())/864e5;if(r<0)return!1;else if(r>=262144)return!1;else{var e=r>>15;r=r&u;switch(e){case 0:return $h.MeetingSuggestionTimeDecoder.$2d(r,t);case 1:return $h.MeetingSuggestionTimeDecoder.$2e(r,t);default:return!1}}};$h.MeetingSuggestionTimeDecoder.$2d=function(n,t){var o=7;var u=15;var s=31;var h=127;var f=null;var r=0;var e=0;t.val=null;var i=n>>12&o;if((i&4)==4){f=n>>5&h;if((i&2)==2){if((i&1)==1)return!1;r=n>>1&u}}else{(i&2)==2&&(r=n>>8&u);(i&1)==1&&(e=n>>3&s)}t.val=new $h.PreciseDate(e,r,f);return!0};$h.MeetingSuggestionTimeDecoder.$2e=function(n,t){var i=15;var r=63;var u=7;var f=3;var e=n&i;n>>=4;var o=$h.MeetingSuggestionTimeDecoder.$2m(n&r,6);n>>=6;var s=n&u;n>>=3;var h=n&f;try{t.val=new $h.RelativeDate(h,o,s,e);return!0}catch(c){t.val=null;return!1}};$h.MeetingSuggestionTimeDecoder.$2m=function(n,t){var i=1<2||!Function.isInstanceOfType(n[0]))return!1;r=n[0];i>1&&(u=n[1]);t.val=new $h.CommonParameters(null,r,u);return!0};$h.CommonParameters.prototype={$P_0:null,$G_0:null,$3_0:null,get_options:function(){return this.$P_0},get_callback:function(){return this.$G_0},get_asyncContext:function(){return this.$3_0}};$h.EwsRequest=function(n){this.readyState=1;$h.EwsRequest.initializeBase(this,[n])};$h.EwsRequest.prototype={status:0,statusText:null,onreadystatechange:null,responseText:null,get_$2E_1:function(){return this.status},set_$2E_1:function(n){this.status=n;return n},get_$2F_1:function(){return this.statusText},set_$2F_1:function(n){this.statusText=n;return n},get_$2C_1:function(){return this.readyState},set_$2C_1:function(n){this.readyState=n;return n},get_$1H_1:function(){return this.responseText},set_$1H_1:function(n){this.responseText=n;return n},send:function(n){this.$2Q_1();$h.ScriptHelpers.isNullOrUndefined(n)&&this.$1O_1();this.$1J_0(5,"EwsRequest",{body:n})},$2P_1:function(){$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)||this.onreadystatechange()},$3d_1:function(n){}};$h.InitialData=function(n){this.$0_0=n;this.$D_0=this.$2N_0()};$h.InitialData.$1=function(n,t,i){var r={get:i,configurable:!1};Object.defineProperty(n,t,r)};$h.InitialData.prototype={$1T_0:null,$l_0:null,$e_0:null,$1G_0:null,$v_0:null,$0_0:null,$D_0:0,get_$3Y_0:function(){return this.$0_0.id},get_$3X_0:function(){return this.$0_0.itemClass},get_$2Y_0:function(){return new Date(this.$0_0.dateTimeCreated)},get_$2Z_0:function(){return new Date(this.$0_0.dateTimeModified)},get_$2a_0:function(){return new Date(this.$0_0.dateTimeSent)},get_$2G_0:function(){this.$6_0();return this.$0_0.subject},get_$2B_0:function(){this.$6_0();return this.$0_0.normalizedSubject},get_$3W_0:function(){return this.$0_0.internetMessageId},get_$1a_0:function(){return this.$0_0.conversationId},get_$3j_0:function(){this.$6_0();var n=this.$0_0.sender;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$2l_0:function(){this.$6_0();var n=this.$0_0.from;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$1S_0:function(){this.$6_0();null===this.$1T_0&&(this.$1T_0=this.$p_0("to"));return this.$1T_0},get_$k_0:function(){this.$6_0();null===this.$l_0&&(this.$l_0=this.$p_0("cc"));return this.$l_0},get_$2M_0:function(){this.$6_0();null===this.$e_0&&(this.$e_0=this.$2U_0());return this.$e_0},get_$2i_0:function(){return this.$0_0.ewsUrl},get_$2D_0:function(){return new Date(this.$0_0.start)},get_$1o_0:function(){return new Date(this.$0_0.end)},get_$26_0:function(){return this.$0_0.location},get_$3g_0:function(){this.$6_0();null===this.$1G_0&&(this.$1G_0=this.$p_0("resources"));return this.$1G_0},get_$3a_0:function(){this.$6_0();var n=this.$0_0.organizer;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$3o_0:function(){return this.$0_0.userDisplayName},get_$3p_0:function(){return this.$0_0.userEmailAddress},get_$3q_0:function(){return this.$0_0.userTimeZone},get_$1Q_0:function(){return this.$0_0.timeZoneOffsets},get_$3T_0:function(){return this.$0_0.hostVersion},get_$3c_0:function(){return this.$0_0.owaView},get_$3b_0:function(){return this.$0_0.overrideWindowOpen},$T_0:function(){this.$v_0||(this.$v_0=new $h.Entities(this.$0_0.entities,this.$0_0.filteredEntities,this.get_$2a_0(),this.$D_0));return this.$v_0},$1v_0:function(n){var t=this.$T_0();return t.$2v_0(n)},$11_0:function(n){var t=this.$T_0();return t.$11_0(n)},$14_0:function(){return this.$0_0.regExMatches?this.$0_0.regExMatches:null},$20_0:function(n){var t=this.$14_0();return!t||!t[n]?null:t[n]},$6_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0)},$p_0:function(n){var i=this.$0_0[n];if($h.ScriptHelpers.isNullOrUndefined(i))return[];for(var r=[],t=0;t maxValue) + throw Error.argumentOutOfRange(argumentName); +}; +OSF.DDA.OutlookAppOm._getHtmlBody$p=function(data) +{ + var htmlBody=""; + if("htmlBody" in data) + { + OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p(data["htmlBody"]); + htmlBody=data["htmlBody"] + } + return htmlBody +}; +OSF.DDA.OutlookAppOm._getAttachments$p=function(data) +{ + var attachments=[]; + if("attachments" in data) + { + attachments=data["attachments"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p(attachments) + } + return attachments +}; +OSF.DDA.OutlookAppOm._getOptionsAndCallback$p=function(data) +{ + var args=[]; + if("options" in data) + args[0]=data["options"]; + if("callback" in data) + args[args.length]=data["callback"]; + return args +}; +OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p=function(attachments) +{ + var attachmentsData=new Array(0); + if(Array.isInstanceOfType(attachments)) + for(var i=0; i < attachments.length; i++) + if(Object.isInstanceOfType(attachments[i])) + { + var attachment=attachments[i]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p(attachment); + attachmentsData[i]=OSF.DDA.OutlookAppOm._createAttachmentData$p(attachment) + } + else + throw Error.argument("attachments"); + return attachmentsData +}; +OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p=function(htmlBody) +{ + if(!String.isInstanceOfType(htmlBody)) + throw Error.argument("htmlBody"); + if($h.ScriptHelpers.isNullOrUndefined(htmlBody)) + throw Error.argument("htmlBody"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody") +}; +OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p=function(attachments) +{ + if(!Array.isInstanceOfType(attachments)) + throw Error.argument("attachments"); +}; +OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p=function(attachment) +{ + if(!Object.isInstanceOfType(attachment)) + throw Error.argument("attachments"); + if(!("type" in attachment) || !("name" in attachment)) + throw Error.argument("attachments"); + if(!("url" in attachment || "itemId" in attachment)) + throw Error.argument("attachments"); +}; +OSF.DDA.OutlookAppOm._createAttachmentData$p=function(attachment) +{ + var attachmentData=null; + if(attachment["type"]==="file") + { + var url=attachment["url"]; + var name=attachment["name"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p(url,name); + attachmentData=OSF.DDA.OutlookAppOm._createFileAttachmentData$p(url,name) + } + else if(attachment["type"]==="item") + { + var itemId=attachment["itemId"]; + var name=attachment["name"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p(itemId,name); + attachmentData=OSF.DDA.OutlookAppOm._createItemAttachmentData$p(itemId,name) + } + else + throw Error.argument("attachments"); + return attachmentData +}; +OSF.DDA.OutlookAppOm._createFileAttachmentData$p=function(url, name) +{ + return["file",name,url] +}; +OSF.DDA.OutlookAppOm._createItemAttachmentData$p=function(itemId, name) +{ + return["item",name,itemId] +}; +OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p=function(url, name) +{ + if(!String.isInstanceOfType(url) || !String.isInstanceOfType(name)) + throw Error.argument("attachments"); + if(url.length > 2048) + throw Error.argumentOutOfRange("attachments",url.length,_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text); + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name) +}; +OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p=function(itemId, name) +{ + if(!String.isInstanceOfType(itemId) || !String.isInstanceOfType(name)) + throw Error.argument("attachments"); + if(itemId.length > 200) + throw Error.argumentOutOfRange("attachments",itemId.length,_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text); + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name) +}; +OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p=function(name) +{ + if(name.length > 255) + throw Error.argumentOutOfRange("attachments",name.length,_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text); +}; +OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function(value, expectedType, argumentName) +{ + if(Object.getType(value) !==expectedType) + throw Error.argumentType(argumentName); +}; +OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function(value, minLength, maxLength, name) +{ + if($h.ScriptHelpers.isNullOrUndefined(value)) + return; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value,String,name); + var stringValue=value; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(stringValue.length,minLength,maxLength,name) +}; +OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function(dispid, data) +{ + var executeParameters=null; + switch(dispid) + { + case 1: + case 2: + case 12: + case 3: + case 14: + case 18: + case 26: + break; + case 4: + var jsonProperty=JSON.stringify(data["customProperties"]); + executeParameters=[jsonProperty]; + break; + case 5: + executeParameters=[data["body"]]; + break; + case 8: + case 9: + executeParameters=[data["itemId"]]; + break; + case 7: + executeParameters=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["requiredAttendees"]),OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["optionalAttendees"]),data["start"],data["end"],data["location"],OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["resources"]),data["subject"],data["body"]]; + break; + case 11: + case 10: + executeParameters=[data["htmlBody"]]; + break; + case 31: + case 30: + executeParameters=[data["htmlBody"],data["attachments"]]; + break; + case 23: + case 13: + case 29: + executeParameters=[data["data"],data["coercionType"]]; + break; + case 28: + executeParameters=[data["coercionType"]]; + break; + case 17: + executeParameters=[data["subject"]]; + break; + case 15: + executeParameters=[data["recipientField"]]; + break; + case 22: + case 21: + executeParameters=[data["recipientField"],OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(data["recipientArray"])]; + break; + case 19: + executeParameters=[data["itemId"],data["name"]]; + break; + case 16: + executeParameters=[data["uri"],data["name"]]; + break; + case 20: + executeParameters=[data["attachmentIndex"]]; + break; + case 25: + executeParameters=[data["TimeProperty"],data["time"]]; + break; + case 24: + executeParameters=[data["TimeProperty"]]; + break; + case 27: + executeParameters=[data["location"]]; + break; + default: + Sys.Debug.fail("Unexpected method dispid"); + break + } + return executeParameters +}; +OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(array) +{ + return array ? array.join(";") : null +}; +OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function(recipients) +{ + if(!recipients) + return null; + var results=new Array(recipients.length); + for(var i=0; i < recipients.length; i++) + results[i]=[recipients[i]["address"],recipients[i]["name"]]; + return results +}; +OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function(emailset, name) +{ + if($h.ScriptHelpers.isNullOrUndefined(emailset)) + return null; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset,Array,name); + var originalAttendees=emailset; + var updatedAttendees=null; + var normalizationNeeded=false; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(originalAttendees.length,0,OSF.DDA.OutlookAppOm._maxRecipients$p,String.format("{0}.length",name)); + for(var i=0; i < originalAttendees.length; i++) + if($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) + { + normalizationNeeded=true; + break + } + if(normalizationNeeded) + updatedAttendees=[]; + for(var i=0; i < originalAttendees.length; i++) + if(normalizationNeeded) + { + updatedAttendees[i]=$h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]) ? originalAttendees[i].emailAddress : originalAttendees[i]; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i],String,String.format("{0}[{1}]",name,i)) + } + else + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i],String,String.format("{0}[{1}]",name,i)); + return updatedAttendees +}; +OSF.DDA.OutlookAppOm.prototype={ + _initialData$p$0: null, + _item$p$0: null, + _userProfile$p$0: null, + _diagnostics$p$0: null, + _officeAppContext$p$0: null, + _appReadyCallback$p$0: null, + _clientEndPoint$p$0: null, + get_clientEndPoint: function() + { + if(!this._clientEndPoint$p$0) + this._clientEndPoint$p$0=OSF._OfficeAppFactory.getClientEndPoint(); + return this._clientEndPoint$p$0 + }, + set_clientEndPoint: function(value) + { + this._clientEndPoint$p$0=value; + return value + }, + get_initialData: function() + { + return this._initialData$p$0 + }, + get__appName$i$0: function() + { + return this._officeAppContext$p$0.get_appName() + }, + initialize: function(initialData) + { + var ItemTypeKey="itemType"; + this._initialData$p$0=new $h.InitialData(initialData); + if(1===initialData[ItemTypeKey]) + this._item$p$0=new $h.Message(this._initialData$p$0); + else if(3===initialData[ItemTypeKey]) + this._item$p$0=new $h.MeetingRequest(this._initialData$p$0); + else if(2===initialData[ItemTypeKey]) + this._item$p$0=new $h.Appointment(this._initialData$p$0); + else if(4===initialData[ItemTypeKey]) + this._item$p$0=new $h.MessageCompose(this._initialData$p$0); + else if(5===initialData[ItemTypeKey]) + this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0); + else + Sys.Debug.trace("Unexpected item type was received from the host."); + this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0); + this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0.get_appName()); + this._initializeMethods$p$0(); + $h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"ewsUrl",this.$$d__getEwsUrl$p$0); + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + if(this._initialData$p$0.get__overrideWindowOpen$i$0()) + window.open=this.$$d_windowOpenOverrideHandler + }, + windowOpenOverrideHandler: function(url, targetName, features, replace) + { + this._invokeHostMethod$i$0(0,"LaunchPalUrl",{launchUrl: url},null) + }, + makeEwsRequestAsync: function(data) + { + var args=[]; + for(var $$pai_5=1; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 1]=arguments[$$pai_5]; + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + if(data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) + throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text); + this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0); + var $$t_4=this; + ewsRequest.onreadystatechange=function() + { + if(4===ewsRequest.get__requestState$i$1()) + parameters._callback$p$0(ewsRequest._asyncResult$p$0) + }; + ewsRequest.send(data) + }, + recordDataPoint: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"RecordDataPoint",data,null) + }, + recordTrace: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"RecordTrace",data,null) + }, + trackCtq: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"TrackCtq",data,null) + }, + convertToLocalClientTime: function(timeValue) + { + var date=new Date(timeValue.getTime()); + var offset=date.getTimezoneOffset() * -1; + if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + date.setUTCMinutes(date.getUTCMinutes() - offset); + offset=this._findOffset$p$0(date); + date.setUTCMinutes(date.getUTCMinutes()+offset) + } + var retValue=this._dateToDictionary$i$0(date); + retValue["timezoneOffset"]=offset; + return retValue + }, + convertToUtcClientTime: function(input) + { + var retValue=this._dictionaryToDate$i$0(input); + if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + var offset=this._findOffset$p$0(retValue); + retValue.setUTCMinutes(retValue.getUTCMinutes() - offset); + offset=!input["timezoneOffset"] ? retValue.getTimezoneOffset() * -1 : input["timezoneOffset"]; + retValue.setUTCMinutes(retValue.getUTCMinutes()+offset) + } + return retValue + }, + getUserIdentityTokenAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",parameters._callback$p$0,parameters._asyncContext$p$0) + }, + getCallbackTokenAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",parameters._callback$p$0,parameters._asyncContext$p$0) + }, + displayMessageForm: function(itemId) + { + if($h.ScriptHelpers.isNullOrUndefined(itemId)) + throw Error.argumentNull("itemId"); + this._invokeHostMethod$i$0(8,"DisplayExistingMessageForm",{itemId: itemId},null) + }, + displayAppointmentForm: function(itemId) + { + if($h.ScriptHelpers.isNullOrUndefined(itemId)) + throw Error.argumentNull("itemId"); + this._invokeHostMethod$i$0(9,"DisplayExistingAppointmentForm",{itemId: itemId},null) + }, + createAsyncResult: function(value, errorCode, errorDescription, userContext) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if(0 !==errorCode) + { + errorArgs={}; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorCode; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorDescription + } + return new OSF.DDA.AsyncResult(initArgs,errorArgs) + }, + standardCreateAsyncResult: function(value, errorCode, detailedErrorCode, userContext) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if(0 !==errorCode) + { + errorArgs={}; + var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorProperties["name"]; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorProperties["message"]; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=detailedErrorCode + } + return new OSF.DDA.AsyncResult(initArgs,errorArgs) + }, + _throwOnMethodCallForInsufficientPermission$i$0: function(requiredPermissionLevel, methodName) + { + if(this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel) + throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text,methodName)); + }, + _displayReplyForm$i$0: function(obj) + { + this._displayReplyFormHelper$p$0(obj,false) + }, + _displayReplyAllForm$i$0: function(obj) + { + this._displayReplyFormHelper$p$0(obj,true) + }, + _displayReplyFormHelper$p$0: function(obj, isReplyAll) + { + if(String.isInstanceOfType(obj)) + this._doDisplayReplyForm$p$0(obj,isReplyAll); + else if(Object.isInstanceOfType(obj) && Object.getTypeName(obj)==="Object") + { + var data={}; + data=$.extend(true,data,obj); + this._doDisplayReplyFormWithAttachments$p$0(data,isReplyAll) + } + else + throw Error.argumentType(); + }, + _doDisplayReplyForm$p$0: function(htmlBody, isReplyAll) + { + if(!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody"); + this._invokeHostMethod$i$0(isReplyAll ? 11 : 10,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{htmlBody: htmlBody},null) + }, + _doDisplayReplyFormWithAttachments$p$0: function(data, isReplyAll) + { + var htmlBody=OSF.DDA.OutlookAppOm._getHtmlBody$p(data); + var attachments=OSF.DDA.OutlookAppOm._getAttachments$p(data); + var parameters=$h.CommonParameters.parse(OSF.DDA.OutlookAppOm._getOptionsAndCallback$p(data),false); + var $$t_6=this; + this._standardInvokeHostMethod$i$0(isReplyAll ? 31 : 30,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{ + htmlBody: htmlBody, + attachments: OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(attachments) + },function(rawInput) + { + return rawInput + },parameters._asyncContext$p$0,parameters._callback$p$0) + }, + _standardInvokeHostMethod$i$0: function(dispid, name, data, format, userContext, callback) + { + var $$t_C=this; + this._invokeHostMethod$i$0(dispid,name,data,function(resultCode, response) + { + if(callback) + { + var asyncResult=null; + if(Object.isInstanceOfType(response)) + { + var responseDictionary=response; + if("error" in responseDictionary || "data" in responseDictionary || "errorCode" in responseDictionary) + if(!responseDictionary["error"]) + { + var formattedData=format ? format(responseDictionary["data"]) : responseDictionary["data"]; + asyncResult=$$t_C.standardCreateAsyncResult(formattedData,0,0,userContext) + } + else + { + var errorCode=responseDictionary["errorCode"]; + asyncResult=$$t_C.standardCreateAsyncResult(null,1,errorCode,userContext) + } + } + if(!asyncResult && resultCode) + asyncResult=$$t_C.standardCreateAsyncResult(null,1,9002,userContext); + callback(asyncResult) + } + }) + }, + _invokeHostMethod$i$0: function(dispid, name, data, responseCallback) + { + if(64===this._officeAppContext$p$0.get_appName()) + this.get_clientEndPoint().invoke(name,responseCallback,data); + else if(dispid) + { + var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid,data); + var $$t_B=this; + window.external.execute(dispid,executeParameters,function(nativeData, resultCode) + { + if(responseCallback) + { + var responseData=nativeData.toArray(); + var rawData=JSON.parse(responseData[0]); + if(Object.isInstanceOfType(rawData)) + { + var deserializedData=rawData; + if(responseData.length > 1 && responseData[1]) + { + deserializedData["error"]=true; + deserializedData["errorCode"]=responseData[1] + } + else + deserializedData["error"]=false; + responseCallback(resultCode,deserializedData) + } + else if(Number.isInstanceOfType(rawData)) + { + var returnDict={}; + returnDict["error"]=true; + returnDict["errorCode"]=rawData; + responseCallback(resultCode,returnDict) + } + else + throw Error.notImplemented("Return data type from host must be Dictionary or int"); + } + }) + } + else if(responseCallback) + responseCallback(-2,null) + }, + _dictionaryToDate$i$0: function(input) + { + var retValue=new Date(input["year"],input["month"],input["date"],input["hours"],input["minutes"],input["seconds"],!input["milliseconds"] ? 0 : input["milliseconds"]); + if(isNaN(retValue.getTime())) + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + return retValue + }, + _dateToDictionary$i$0: function(input) + { + var retValue={}; + retValue["month"]=input.getMonth(); + retValue["date"]=input.getDate(); + retValue["year"]=input.getFullYear(); + retValue["hours"]=input.getHours(); + retValue["minutes"]=input.getMinutes(); + retValue["seconds"]=input.getSeconds(); + retValue["milliseconds"]=input.getMilliseconds(); + return retValue + }, + _displayNewAppointmentFormApi$p$0: function(parameters) + { + var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["requiredAttendees"],"requiredAttendees"); + var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["optionalAttendees"],"optionalAttendees"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["location"],0,OSF.DDA.OutlookAppOm._maxLocationLength$p,"location"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["body"],0,OSF.DDA.OutlookAppOm.maxBodyLength,"body"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["subject"],0,OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject"); + if(!$h.ScriptHelpers.isNullOrUndefined(parameters["start"])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["start"],Date,"start"); + var startDateTime=parameters["start"]; + parameters["start"]=startDateTime.getTime(); + if(!$h.ScriptHelpers.isNullOrUndefined(parameters["end"])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["end"],Date,"end"); + var endDateTime=parameters["end"]; + if(endDateTime < startDateTime) + throw Error.argumentOutOfRange("end",endDateTime,_u.ExtensibilityStrings.l_InvalidEventDates_Text); + parameters["end"]=endDateTime.getTime() + } + } + var updatedParameters=null; + if(normalizedRequiredAttendees || normalizedOptionalAttendees) + { + updatedParameters={}; + var $$dict_7=parameters; + for(var $$key_8 in $$dict_7) + { + var entry={ + key: $$key_8, + value: $$dict_7[$$key_8] + }; + updatedParameters[entry.key]=entry.value + } + if(normalizedRequiredAttendees) + updatedParameters["requiredAttendees"]=normalizedRequiredAttendees; + if(normalizedOptionalAttendees) + updatedParameters["optionalAttendees"]=normalizedOptionalAttendees + } + this._invokeHostMethod$i$0(7,"DisplayNewAppointmentForm",updatedParameters || parameters,null) + }, + _initializeMethods$p$0: function() + { + var currentInstance=this; + if($h.Item.isInstanceOfType(this._item$p$0)) + currentInstance.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0 + }, + _getInitialDataResponseHandler$p$0: function(resultCode, data) + { + if(resultCode) + return; + this.initialize(data); + this.displayName="mailbox"; + window.setTimeout(this.$$d__callAppReadyCallback$p$0,0) + }, + _callAppReadyCallback$p$0: function() + { + this._appReadyCallback$p$0() + }, + _invokeGetTokenMethodAsync$p$0: function(outlookDispid, methodName, callback, userContext) + { + if($h.ScriptHelpers.isNullOrUndefined(callback)) + throw Error.argumentNull("callback"); + var $$t_8=this; + this._invokeHostMethod$i$0(outlookDispid,methodName,null,function(resultCode, response) + { + var asyncResult; + if(resultCode) + asyncResult=$$t_8.createAsyncResult(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode),userContext); + else + { + var responseDictionary=response; + if(responseDictionary["wasSuccessful"]) + asyncResult=$$t_8.createAsyncResult(responseDictionary["token"],0,null,userContext); + else + asyncResult=$$t_8.createAsyncResult(null,1,responseDictionary["errorMessage"],userContext) + } + callback(asyncResult) + }) + }, + _getItem$p$0: function() + { + return this._item$p$0 + }, + _getUserProfile$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._userProfile$p$0 + }, + _getDiagnostics$p$0: function() + { + return this._diagnostics$p$0 + }, + _getEwsUrl$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._initialData$p$0.get__ewsUrl$i$0() + }, + _findOffset$p$0: function(value) + { + var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0(); + for(var r=0; r < ranges.length; r++) + { + var range=ranges[r]; + var start=parseInt(range["start"]); + var end=parseInt(range["end"]); + if(value.getTime() - start >=0 && value.getTime() - end < 0) + return parseInt(range["offset"]) + } + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + }, + _areStringsLoaded$p$0: function() + { + var stringsLoaded=false; + try + { + stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text) + } + catch($$e_1){} + return stringsLoaded + }, + _loadLocalizedScript$p$0: function(stringLoadedCallback) + { + var url=null; + var baseUrl=""; + var scripts=document.getElementsByTagName("script"); + for(var i=scripts.length - 1; i >=0; i--) + { + var filename=null; + var attributes=scripts[i].attributes; + if(attributes) + { + var attribute=attributes.getNamedItem("src"); + if(attribute) + filename=attribute.value; + if(filename) + { + var debug=false; + filename=filename.toLowerCase(); + var officeIndex=filename.indexOf("office_strings.js"); + if(officeIndex < 0) + { + officeIndex=filename.indexOf("office_strings.debug.js"); + debug=true + } + if(officeIndex > 0 && officeIndex < filename.length) + { + url=filename.replace(debug ? "office_strings.debug.js" : "office_strings.js","outlook_strings.js"); + var languageUrl=filename.substring(0,officeIndex); + var lastIndexOfSlash=languageUrl.lastIndexOf("/",languageUrl.length - 2); + if(lastIndexOfSlash===-1) + lastIndexOfSlash=languageUrl.lastIndexOf("\\",languageUrl.length - 2); + if(lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) + baseUrl=languageUrl.substring(0,lastIndexOfSlash+1); + break + } + } + } + } + if(url) + { + var head=document.getElementsByTagName("head")[0]; + var scriptElement=null; + var $$t_H=this; + var scriptElementCallback=function() + { + if(stringLoadedCallback && (!scriptElement.readyState || scriptElement.readyState && (scriptElement.readyState==="loaded" || scriptElement.readyState==="complete"))) + { + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + stringLoadedCallback() + } + }; + var $$t_I=this; + var failureCallback=function() + { + if(!$$t_I._areStringsLoaded$p$0()) + { + var fallbackUrl=baseUrl+"en-us/"+"outlook_strings.js"; + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + head.appendChild(scriptElement) + } + }; + scriptElement=this._createScriptElement$p$0(url); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + window.setTimeout(failureCallback,2e3); + head.appendChild(scriptElement) + } + }, + _createScriptElement$p$0: function(url) + { + var scriptElement=document.createElement("script"); + scriptElement.type="text/javascript"; + scriptElement.src=url; + return scriptElement + } +}; +OSF.DDA.Settings=function(data) +{ + this._rawData$p$0=data +}; +OSF.DDA.Settings._convertFromRawSettings$p=function(rawSettings) +{ + if(!rawSettings) + return{}; + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) + { + var outlookSettings=rawSettings["SettingsKey"]; + if(outlookSettings) + return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings) + } + return rawSettings +}; +OSF.DDA.Settings.prototype={ + _rawData$p$0: null, + _settingsData$p$0: null, + get__data$p$0: function() + { + if(!this._settingsData$p$0) + { + this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0); + this._rawData$p$0=null + } + return this._settingsData$p$0 + }, + get: function(name) + { + return this.get__data$p$0()[name] + }, + set: function(name, value) + { + this.get__data$p$0()[name]=value + }, + remove: function(name) + { + delete this.get__data$p$0()[name] + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + var commonParameters=$h.CommonParameters.parse(args,false); + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + this._saveSettingsForOwa$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0); + else + this._saveSettingsForOutlook$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0) + }, + _saveSettingsForOutlook$p$0: function(callback, userContext) + { + var storedException=null; + try + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var jsonSettings=JSON.stringify(serializedSettings); + var settingsObjectToSave={SettingsKey: jsonSettings}; + OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave) + } + catch(ex) + { + storedException=ex + } + if(callback) + { + var asyncResult; + if(storedException) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,storedException.message,userContext); + else + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,null,userContext); + callback(asyncResult) + } + }, + _saveSettingsForOwa$p$0: function(callback, userContext) + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var $$t_7=this; + OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(resultCode, response) + { + if(callback) + { + var asyncResult; + if(resultCode) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode),userContext); + else + { + var responseDictionary=response; + if(!responseDictionary["error"]) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,null,userContext); + else + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,responseDictionary["errorMessage"],userContext) + } + callback(asyncResult) + } + },[serializedSettings]) + } +}; +Type.registerNamespace("$h"); +Type.registerNamespace("Office.cast"); +$h.Appointment=function(dataDictionary) +{ + this.$$d__getOrganizer$p$2=Function.createDelegate(this,this._getOrganizer$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2); + this.$$d__getResources$p$2=Function.createDelegate(this,this._getResources$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2); + this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2); + $h.Appointment.initializeBase(this,[dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$2) +}; +$h.Appointment.prototype={ + getEntities: function() + { + return this._data$p$0._getEntities$i$0() + }, + getEntitiesByType: function(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, + getRegExMatches: function() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches"); + return this._data$p$0._getRegExMatches$i$0() + }, + getFilteredEntitiesByName: function(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, + getRegExMatchesByName: function(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName"); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, + displayReplyForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj) + }, + displayReplyAllForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj) + }, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, + _getStart$p$2: function() + { + return this._data$p$0.get__start$i$0() + }, + _getEnd$p$2: function() + { + return this._data$p$0.get__end$i$0() + }, + _getLocation$p$2: function() + { + return this._data$p$0.get__location$i$0() + }, + _getOptionalAttendees$p$2: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getRequiredAttendees$p$2: function() + { + return this._data$p$0.get__to$i$0() + }, + _getResources$p$2: function() + { + return this._data$p$0.get__resources$i$0() + }, + _getSubject$p$2: function() + { + return this._data$p$0.get__subject$i$0() + }, + _getNormalizedSubject$p$2: function() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, + _getOrganizer$p$2: function() + { + return this._data$p$0.get__organizer$i$0() + } +}; +$h.AppointmentCompose=function(data) +{ + this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2); + $h.AppointmentCompose.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2) +}; +$h.AppointmentCompose.prototype={ + _requiredAttendees$p$2: null, + _optionalAttendees$p$2: null, + _start$p$2: null, + _end$p$2: null, + _location$p$2: null, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, + _getRequiredAttendees$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._requiredAttendees$p$2) + this._requiredAttendees$p$2=new $h.ComposeRecipient(0,"requiredAttendees"); + return this._requiredAttendees$p$2 + }, + _getOptionalAttendees$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._optionalAttendees$p$2) + this._optionalAttendees$p$2=new $h.ComposeRecipient(1,"optionalAttendees"); + return this._optionalAttendees$p$2 + }, + _getStart$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._start$p$2) + this._start$p$2=new $h.ComposeTime(1); + return this._start$p$2 + }, + _getEnd$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._end$p$2) + this._end$p$2=new $h.ComposeTime(2); + return this._end$p$2 + }, + _getLocation$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._location$p$2) + this._location$p$2=new $h.ComposeLocation; + return this._location$p$2 + } +}; +$h.AttachmentConstants=function(){}; +$h.AttachmentDetails=function(data) +{ + this.$$d__getIsInline$p$0=Function.createDelegate(this,this._getIsInline$p$0); + this.$$d__getAttachmentType$p$0=Function.createDelegate(this,this._getAttachmentType$p$0); + this.$$d__getSize$p$0=Function.createDelegate(this,this._getSize$p$0); + this.$$d__getContentType$p$0=Function.createDelegate(this,this._getContentType$p$0); + this.$$d__getName$p$0=Function.createDelegate(this,this._getName$p$0); + this.$$d__getId$p$0=Function.createDelegate(this,this._getId$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"id",this.$$d__getId$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"name",this.$$d__getName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contentType",this.$$d__getContentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"size",this.$$d__getSize$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"attachmentType",this.$$d__getAttachmentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"isInline",this.$$d__getIsInline$p$0) +}; +$h.AttachmentDetails.prototype={ + _data$p$0: null, + _getId$p$0: function() + { + return this._data$p$0["id"] + }, + _getName$p$0: function() + { + return this._data$p$0["name"] + }, + _getContentType$p$0: function() + { + return this._data$p$0["contentType"] + }, + _getSize$p$0: function() + { + return this._data$p$0["size"] + }, + _getAttachmentType$p$0: function() + { + var response=this._data$p$0["attachmentType"]; + return response < $h.AttachmentDetails._attachmentTypeMap$p.length ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File + }, + _getIsInline$p$0: function() + { + return this._data$p$0["isInline"] + } +}; +$h.ComposeBody=function(){}; +$h.ComposeBody._createParameterDictionaryToHost$i=function(data, parameters) +{ + var dataToHost={data: data}; + if(parameters._options$p$0 && !$h.ScriptHelpers.isNull(parameters._options$p$0["coercionType"])) + { + var hostCoercionType; + var $$t_4, + $$t_5; + if(!($$t_5=$h.ComposeBody._tryMapToHostCoercionType$i(parameters._options$p$0["coercionType"],$$t_4={val: hostCoercionType}),hostCoercionType=$$t_4.val,$$t_5)) + { + if(parameters._callback$p$0) + parameters._callback$p$0(OSF.DDA.OutlookAppOm._instance$p.standardCreateAsyncResult(null,1,1e3,parameters._asyncContext$p$0)); + return null + } + dataToHost["coercionType"]=hostCoercionType + } + else + dataToHost["coercionType"]=0; + return dataToHost +}; +$h.ComposeBody._tryMapToHostCoercionType$i=function(coercionType, hostCoercionType) +{ + hostCoercionType.val=undefined; + if(coercionType===Microsoft.Office.WebExtension.CoercionType.Html) + hostCoercionType.val=3; + else if(coercionType===Microsoft.Office.WebExtension.CoercionType.Text) + hostCoercionType.val=0; + else + return false; + return true +}; +$h.ComposeBody.prototype={ + getTypeAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14,"GetBodyTypeAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setSelectedDataAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13,"BodySetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + prependAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23,"BodyPrependAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + } +}; +$h.ComposeItem=function(data) +{ + this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1); + $h.ComposeItem.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1) +}; +$h.ComposeItem.prototype={ + _subject$p$1: null, + _body$p$1: null, + addFileAttachmentAsync: function(uri, attachmentName) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(uri)) + throw Error.argument("uri"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + throw Error.argument("attachmentName"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(uri.length,0,2048,"uri"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName"); + var commonParameters=$h.CommonParameters.parse(args,false); + var parameters={ + uri: uri, + name: attachmentName, + __timeout__: 6e5 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16,"AddFileAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + addItemAttachmentAsync: function(itemId, attachmentName) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(itemId)) + throw Error.argument("itemId"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + throw Error.argument("attachmentName"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(itemId.length,0,200,"itemId"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName"); + var commonParameters=$h.CommonParameters.parse(args,false); + var parameters={ + itemId: itemId, + name: attachmentName, + __timeout__: 6e5 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19,"AddItemAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + removeAttachmentAsync: function(attachmentId) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentId)) + throw Error.argument("attachmentId"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentId.length,0,200,"attachmentId"); + var commonParameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20,"RemoveAttachmentAsync",{attachmentIndex: attachmentId},null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + getSelectedDataAsync: function(coercionType) + { + var args=[]; + for(var $$pai_7=1; $$pai_7 < arguments.length;++$$pai_7) + args[$$pai_7 - 1]=arguments[$$pai_7]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync"); + var commonParameters=$h.CommonParameters.parse(args,true); + var hostCoercionType; + var $$t_5, + $$t_6; + if(coercionType !==Microsoft.Office.WebExtension.CoercionType.Html && coercionType !==Microsoft.Office.WebExtension.CoercionType.Text || !($$t_6=$h.ComposeBody._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5.val,$$t_6)) + throw Error.argument("coercionType"); + var dataToHost={coercionType: hostCoercionType}; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(28,"GetSelectedDataAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + setSelectedDataAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(29,"SetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + _getBody$p$1: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._body$p$1) + this._body$p$1=new $h.ComposeBody; + return this._body$p$1 + }, + _getSubject$p$1: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._subject$p$1) + this._subject$p$1=new $h.ComposeSubject; + return this._subject$p$1 + } +}; +$h.ComposeRecipient=function(type, propertyName) +{ + this._type$p$0=type; + this._propertyName$p$0=propertyName +}; +$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(displayName, emailAddress) +{ + if(!displayName && !emailAddress) + throw Error.argument("recipients"); + if(displayName && displayName.length > 255) + throw Error.argumentOutOfRange("recipients",displayName.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text); + if(emailAddress && emailAddress.length > 571) + throw Error.argumentOutOfRange("recipients",emailAddress.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text); +}; +$h.ComposeRecipient._getAsyncFormatter$p=function(rawInput) +{ + var input=rawInput; + var output=[]; + for(var i=0; i < input.length; i++) + { + var email=new $h.EmailAddressDetails(input[i]); + output[i]=email + } + return output +}; +$h.ComposeRecipient._createEmailDictionaryForHost$p=function(address, name) +{ + return{ + address: address, + name: name + } +}; +$h.ComposeRecipient.prototype={ + _propertyName$p$0: null, + _type$p$0: 0, + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._propertyName$p$0+".getAsync"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15,"GetRecipientsAsync",{recipientField: this._type$p$0},$h.ComposeRecipient._getAsyncFormatter$p,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(recipients) + { + var args=[]; + for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2 - 1]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync"); + this.setAddHelper(recipients,args,true) + }, + addAsync: function(recipients) + { + var args=[]; + for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2 - 1]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync"); + this.setAddHelper(recipients,args,false) + }, + setAddHelper: function(recipients, args, isSet) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(recipients.length,0,100,"recipients"); + var parameters=$h.CommonParameters.parse(args,false); + var recipientData=[]; + if(Array.isInstanceOfType(recipients)) + for(var i=0; i < recipients.length; i++) + if(String.isInstanceOfType(recipients[i])) + { + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i],recipients[i]); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i],recipients[i]) + } + else if($h.EmailAddressDetails.isInstanceOfType(recipients[i])) + { + var address=recipients[i]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address.displayName,address.emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address.emailAddress,address.displayName) + } + else if(Object.isInstanceOfType(recipients[i])) + { + var input=recipients[i]; + var emailAddress=input["emailAddress"]; + var displayName=input["displayName"]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName,emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress,displayName) + } + else + throw Error.argument("recipients"); + else + throw Error.argument("recipients"); + var $$t_B=this; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(isSet ? 21 : 22,isSet ? "SetRecipientsAsync" : "AddRecipientsAsync",{ + recipientField: this._type$p$0, + recipientArray: recipientData + },function(rawInput) + { + return rawInput + },parameters._asyncContext$p$0,parameters._callback$p$0) + } +}; +$h.ComposeRecipient.RecipientField=function(){}; +$h.ComposeRecipient.RecipientField.prototype={ + to: 0, + cc: 1, + bcc: 2, + requiredAttendees: 0, + optionalAttendees: 1 +}; +$h.ComposeRecipient.RecipientField.registerEnum("$h.ComposeRecipient.RecipientField",false); +$h.ComposeLocation=function(){}; +$h.ComposeLocation.prototype={ + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26,"GetLocationAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(location) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(location.length,0,255,"location"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27,"SetLocationAsync",{location: location},null,parameters._asyncContext$p$0,parameters._callback$p$0) + } +}; +$h.ComposeSubject=function(){}; +$h.ComposeSubject.prototype={ + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18,"GetSubjectAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(data) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync"); + if(!String.isInstanceOfType(data)) + throw Error.argument("data"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,255,"data"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17,"SetSubjectAsync",{subject: data},null,parameters._asyncContext$p$0,parameters._callback$p$0) + } +}; +$h.ComposeTime=function(type) +{ + this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0); + this._timeType$p$0=type +}; +$h.ComposeTime.prototype={ + _timeType$p$0: 0, + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24,"GetTimeAsync",{TimeProperty: this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(dateTime) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync"); + if(!Date.isInstanceOfType(dateTime)) + throw Error.argumentType("dateTime",Object.getType(dateTime),Date); + if(isNaN(dateTime.getTime())) + throw Error.argument("dateTime"); + if(dateTime.getTime() < -864e13 || dateTime.getTime() > 864e13) + throw Error.argumentOutOfRange("dateTime"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25,"SetTimeAsync",{ + TimeProperty: this._timeType$p$0, + time: dateTime.getTime() + },null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + _ticksToDateFormatter$p$0: function(rawInput) + { + var ticks=rawInput; + return new Date(ticks) + }, + _getPropertyName$p$0: function() + { + return this._timeType$p$0===1 ? "start" : "end" + } +}; +$h.ComposeTime.TimeType=function(){}; +$h.ComposeTime.TimeType.prototype={ + start: 1, + end: 2 +}; +$h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",false); +$h.Contact=function(data) +{ + this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0); + this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0); + this.$$d__getPersonName$p$0=Function.createDelegate(this,this._getPersonName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"personName",this.$$d__getPersonName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"businessName",this.$$d__getBusinessName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contactString",this.$$d__getContactString$p$0) +}; +$h.Contact.prototype={ + _data$p$0: null, + _phoneNumbers$p$0: null, + _getPersonName$p$0: function() + { + return this._data$p$0["PersonName"] + }, + _getBusinessName$p$0: function() + { + return this._data$p$0["BusinessName"] + }, + _getAddresses$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses") + }, + _getEmailAddresses$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses") + }, + _getUrls$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls") + }, + _getPhoneNumbers$p$0: function() + { + if(!this._phoneNumbers$p$0) + { + var $$t_1=this; + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",function(data) + { + return new $h.PhoneNumber(data) + }) + } + return this._phoneNumbers$p$0 + }, + _getContactString$p$0: function() + { + return this._data$p$0["ContactString"] + } +}; +$h.CustomProperties=function(data) +{ + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + if(Array.isInstanceOfType(data)) + { + var customPropertiesArray=data; + if(customPropertiesArray.length > 0) + this._data$p$0=customPropertiesArray[0]; + else + throw Error.argument("data"); + } + else + this._data$p$0=data +}; +$h.CustomProperties.prototype={ + _data$p$0: null, + get: function(name) + { + var value=this._data$p$0[name]; + if(typeof value==="string") + { + var valueString=value; + if(valueString.length > 6 && valueString.startsWith("Date(") && valueString.endsWith(")")) + { + var ticksString=valueString.substring(5,valueString.length - 1); + var ticks=parseInt(ticksString); + if(!isNaN(ticks)) + { + var dateTimeValue=new Date(ticks); + if(dateTimeValue) + value=dateTimeValue + } + } + } + return value + }, + set: function(name, value) + { + if(OSF.OUtil.isDate(value)) + value="Date("+value.getTime()+")"; + this._data$p$0[name]=value + }, + remove: function(name) + { + delete this._data$p$0[name] + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4]=arguments[$$pai_4]; + var MaxCustomPropertiesLength=2500; + if(JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) + throw Error.argument(); + var parameters=$h.CommonParameters.parse(args,false,true); + var saveCustomProperties=new $h._saveDictionaryRequest(parameters._callback$p$0,parameters._asyncContext$p$0); + saveCustomProperties._sendRequest$i$0(4,"SaveCustomProperties",{customProperties: this._data$p$0}) + } +}; +$h.Diagnostics=function(data, appName) +{ + this.$$d__getOwaView$p$0=Function.createDelegate(this,this._getOwaView$p$0); + this.$$d__getHostVersion$p$0=Function.createDelegate(this,this._getHostVersion$p$0); + this.$$d__getHostName$p$0=Function.createDelegate(this,this._getHostName$p$0); + this._data$p$0=data; + this._appName$p$0=appName; + $h.InitialData._defineReadOnlyProperty$i(this,"hostName",this.$$d__getHostName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"hostVersion",this.$$d__getHostVersion$p$0); + if(64===this._appName$p$0) + $h.InitialData._defineReadOnlyProperty$i(this,"OWAView",this.$$d__getOwaView$p$0) +}; +$h.Diagnostics.prototype={ + _data$p$0: null, + _appName$p$0: 0, + _getHostName$p$0: function() + { + if(8===this._appName$p$0) + return"Outlook"; + else if(64===this._appName$p$0) + return"OutlookWebApp"; + return null + }, + _getHostVersion$p$0: function() + { + return this._data$p$0.get__hostVersion$i$0() + }, + _getOwaView$p$0: function() + { + return this._data$p$0.get__owaView$i$0() + } +}; +$h.EmailAddressDetails=function(data) +{ + this.$$d__getRecipientType$p$0=Function.createDelegate(this,this._getRecipientType$p$0); + this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this,this._getAppointmentResponse$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0); + if($h.ScriptHelpers.dictionaryContainsKey(data,"appointmentResponse")) + $h.InitialData._defineReadOnlyProperty$i(this,"appointmentResponse",this.$$d__getAppointmentResponse$p$0); + if($h.ScriptHelpers.dictionaryContainsKey(data,"recipientType")) + $h.InitialData._defineReadOnlyProperty$i(this,"recipientType",this.$$d__getRecipientType$p$0) +}; +$h.EmailAddressDetails._createFromEmailUserDictionary$i=function(data) +{ + var emailAddressDetailsDictionary={}; + var displayName=data["Name"]; + var emailAddress=data["UserId"]; + emailAddressDetailsDictionary["name"]=displayName || $h.EmailAddressDetails._emptyString$p; + emailAddressDetailsDictionary["address"]=emailAddress || $h.EmailAddressDetails._emptyString$p; + return new $h.EmailAddressDetails(emailAddressDetailsDictionary) +}; +$h.EmailAddressDetails.prototype={ + _data$p$0: null, + toJSON: function() + { + var result={}; + result["emailAddress"]=this._getEmailAddress$p$0(); + result["displayName"]=this._getDisplayName$p$0(); + if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"appointmentResponse")) + result["appointmentResponse"]=this._getAppointmentResponse$p$0(); + if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"recipientType")) + result["recipientType"]=this._getRecipientType$p$0(); + return result + }, + _getEmailAddress$p$0: function() + { + return this._data$p$0["address"] + }, + _getDisplayName$p$0: function() + { + return this._data$p$0["name"] + }, + _getAppointmentResponse$p$0: function() + { + var response=this._data$p$0["appointmentResponse"]; + return response < $h.EmailAddressDetails._responseTypeMap$p.length ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None + }, + _getRecipientType$p$0: function() + { + var response=this._data$p$0["recipientType"]; + return response < $h.EmailAddressDetails._recipientTypeMap$p.length ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other + } +}; +$h.Entities=function(data, filteredEntitiesData, timeSent, permissionLevel) +{ + this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this,this._createMeetingSuggestion$p$0); + this.$$d__getContacts$p$0=Function.createDelegate(this,this._getContacts$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0); + this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this,this._getMeetingSuggestions$p$0); + this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this,this._getTaskSuggestions$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0); + this._data$p$0=data || {}; + this._filteredData$p$0=filteredEntitiesData || {}; + this._dateTimeSent$p$0=timeSent; + $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"taskSuggestions",this.$$d__getTaskSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"meetingSuggestions",this.$$d__getMeetingSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contacts",this.$$d__getContacts$p$0); + this._permissionLevel$p$0=permissionLevel +}; +$h.Entities._getExtractedObjects$i=function(T, data, name, creator, removeDuplicates, stringPropertyName) +{ + var results=null; + var extractedObjects=data[name]; + if(!extractedObjects) + return new Array(0); + if(removeDuplicates) + extractedObjects=$h.Entities._removeDuplicate$p(Object,extractedObjects,$h.Entities._entityDictionaryEquals$p,stringPropertyName); + results=new Array(extractedObjects.length); + var count=0; + for(var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) + { + var extractedObject=$$arr_9[$$idx_B]; + results[count++]=creator(extractedObject) + } + return results +}; +$h.Entities._getExtractedStringProperty$i=function(data, name, removeDuplicate) +{ + var extractedProperties=data[name]; + if(!extractedProperties) + return new Array(0); + if(removeDuplicate) + extractedProperties=$h.Entities._removeDuplicate$p(String,extractedProperties,$h.Entities._stringEquals$p,null); + return extractedProperties +}; +$h.Entities._createContact$p=function(data) +{ + return new $h.Contact(data) +}; +$h.Entities._createTaskSuggestion$p=function(data) +{ + return new $h.TaskSuggestion(data) +}; +$h.Entities._createPhoneNumber$p=function(data) +{ + return new $h.PhoneNumber(data) +}; +$h.Entities._entityDictionaryEquals$p=function(dictionary1, dictionary2, entityPropertyIdentifier) +{ + if(dictionary1===dictionary2) + return true; + if(!dictionary1 || !dictionary2) + return false; + if(dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) + return true; + return false +}; +$h.Entities._stringEquals$p=function(string1, string2, entityProperty) +{ + return string1===string2 +}; +$h.Entities._removeDuplicate$p=function(T, array, entityEquals, entityPropertyIdentifier) +{ + for(var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) + { + var removeMatch=false; + for(var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) + if(entityEquals(array[matchIndex1],array[matchIndex2],entityPropertyIdentifier)) + { + removeMatch=true; + break + } + if(removeMatch) + Array.removeAt(array,matchIndex1) + } + return array +}; +$h.Entities.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _filteredData$p$0: null, + _filteredEntitiesCache$p$0: null, + _permissionLevel$p$0: 0, + _taskSuggestions$p$0: null, + _meetingSuggestions$p$0: null, + _phoneNumbers$p$0: null, + _contacts$p$0: null, + _addresses$p$0: null, + _emailAddresses$p$0: null, + _urls$p$0: null, + _getByType$i$0: function(entityType) + { + if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) + return this._getMeetingSuggestions$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) + return this._getTaskSuggestions$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) + return this._getAddresses$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) + return this._getPhoneNumbers$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) + return this._getEmailAddresses$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) + return this._getUrls$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) + return this._getContacts$p$0(); + return null + }, + _getFilteredEntitiesByName$i$0: function(name) + { + if(!this._filteredEntitiesCache$p$0) + this._filteredEntitiesCache$p$0={}; + if(!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0,name)) + { + var found=false; + for(var i=0; i < $h.Entities._allEntityKeys$p.length; i++) + { + var entityTypeKey=$h.Entities._allEntityKeys$p[i]; + var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey]; + if(!perEntityTypeDictionary) + continue; + if($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary,name)) + { + switch(entityTypeKey) + { + case"EmailAddresses": + case"Urls": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name); + break; + case"Addresses": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name,true); + break; + case"PhoneNumbers": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber,perEntityTypeDictionary,name,$h.Entities._createPhoneNumber$p,false,null); + break; + case"TaskSuggestions": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,perEntityTypeDictionary,name,$h.Entities._createTaskSuggestion$p,true,"TaskString"); + break; + case"MeetingSuggestions": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,perEntityTypeDictionary,name,this.$$d__createMeetingSuggestion$p$0,true,"MeetingString"); + break; + case"Contacts": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact,perEntityTypeDictionary,name,$h.Entities._createContact$p,true,"ContactString"); + break + } + found=true; + break + } + } + if(!found) + this._filteredEntitiesCache$p$0[name]=null + } + return this._filteredEntitiesCache$p$0[name] + }, + _createMeetingSuggestion$p$0: function(data) + { + return new $h.MeetingSuggestion(data,this._dateTimeSent$p$0) + }, + _getAddresses$p$0: function() + { + if(!this._addresses$p$0) + this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses",true); + return this._addresses$p$0 + }, + _getEmailAddresses$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._emailAddresses$p$0) + this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses",false); + return this._emailAddresses$p$0 + }, + _getUrls$p$0: function() + { + if(!this._urls$p$0) + this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls",false); + return this._urls$p$0 + }, + _getPhoneNumbers$p$0: function() + { + if(!this._phoneNumbers$p$0) + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",$h.Entities._createPhoneNumber$p); + return this._phoneNumbers$p$0 + }, + _getTaskSuggestions$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._taskSuggestions$p$0) + this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,this._data$p$0,"TaskSuggestions",$h.Entities._createTaskSuggestion$p,true,"TaskString"); + return this._taskSuggestions$p$0 + }, + _getMeetingSuggestions$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._meetingSuggestions$p$0) + this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,this._data$p$0,"MeetingSuggestions",this.$$d__createMeetingSuggestion$p$0,true,"MeetingString"); + return this._meetingSuggestions$p$0 + }, + _getContacts$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._contacts$p$0) + this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact,this._data$p$0,"Contacts",$h.Entities._createContact$p,true,"ContactString"); + return this._contacts$p$0 + } +}; +$h.ReplyConstants=function(){}; +$h.AsyncConstants=function(){}; +Office.cast.item=function(){}; +Office.cast.item.toItemRead=function(item) +{ + if($h.Item.isInstanceOfType(item)) + return item; + throw Error.argumentType(); +}; +Office.cast.item.toItemCompose=function(item) +{ + if($h.ComposeItem.isInstanceOfType(item)) + return item; + throw Error.argumentType(); +}; +Office.cast.item.toMessage=function(item) +{ + return Office.cast.item.toMessageRead(item) +}; +Office.cast.item.toMessageRead=function(item) +{ + if($h.Message.isInstanceOfType(item)) + return item; + throw Error.argumentType(); +}; +Office.cast.item.toMessageCompose=function(item) +{ + if($h.MessageCompose.isInstanceOfType(item)) + return item; + throw Error.argumentType(); +}; +Office.cast.item.toMeetingRequest=function(item) +{ + if($h.MeetingRequest.isInstanceOfType(item)) + return item; + throw Error.argumentType(); +}; +Office.cast.item.toAppointment=function(item) +{ + return Office.cast.item.toAppointmentRead(item) +}; +Office.cast.item.toAppointmentRead=function(item) +{ + if($h.Appointment.isInstanceOfType(item)) + return item; + throw Error.argumentType(); +}; +Office.cast.item.toAppointmentCompose=function(item) +{ + if($h.AppointmentCompose.isInstanceOfType(item)) + return item; + throw Error.argumentType(); +}; +$h.Item=function(data) +{ + this.$$d__getAttachments$p$1=Function.createDelegate(this,this._getAttachments$p$1); + this.$$d__getItemClass$p$1=Function.createDelegate(this,this._getItemClass$p$1); + this.$$d__getItemId$p$1=Function.createDelegate(this,this._getItemId$p$1); + this.$$d__getDateTimeModified$p$1=Function.createDelegate(this,this._getDateTimeModified$p$1); + this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this,this._getDateTimeCreated$p$1); + $h.Item.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeCreated",this.$$d__getDateTimeCreated$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeModified",this.$$d__getDateTimeModified$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"itemId",this.$$d__getItemId$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"itemClass",this.$$d__getItemClass$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"attachments",this.$$d__getAttachments$p$1) +}; +$h.Item.prototype={ + _getItemId$p$1: function() + { + return this._data$p$0.get__itemId$i$0() + }, + _getItemClass$p$1: function() + { + return this._data$p$0.get__itemClass$i$0() + }, + _getDateTimeCreated$p$1: function() + { + return this._data$p$0.get__dateTimeCreated$i$0() + }, + _getDateTimeModified$p$1: function() + { + return this._data$p$0.get__dateTimeModified$i$0() + }, + _getAttachments$p$1: function() + { + return this._data$p$0.get__attachments$i$0() + } +}; +$h.ItemBase=function(data) +{ + this.$$d__createCustomProperties$i$0=Function.createDelegate(this,this._createCustomProperties$i$0); + this.$$d_getItemType=Function.createDelegate(this,this.getItemType); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"itemType",this.$$d_getItemType) +}; +$h.ItemBase.prototype={ + _data$p$0: null, + get_data: function() + { + return this._data$p$0 + }, + loadCustomPropertiesAsync: function() + { + var args=[]; + for(var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3]=arguments[$$pai_3]; + var parameters=$h.CommonParameters.parse(args,true,true); + var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0,"customProperties",parameters._callback$p$0,parameters._asyncContext$p$0); + loadCustomProperties._sendRequest$i$0(3,"LoadCustomProperties",{}) + }, + _createCustomProperties$i$0: function(data) + { + return new $h.CustomProperties(data) + } +}; +$h.MeetingRequest=function(data) +{ + this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this,this._getRequiredAttendees$p$3); + this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this,this._getOptionalAttendees$p$3); + this.$$d__getLocation$p$3=Function.createDelegate(this,this._getLocation$p$3); + this.$$d__getEnd$p$3=Function.createDelegate(this,this._getEnd$p$3); + this.$$d__getStart$p$3=Function.createDelegate(this,this._getStart$p$3); + $h.MeetingRequest.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$3) +}; +$h.MeetingRequest.prototype={ + _getStart$p$3: function() + { + return this._data$p$0.get__start$i$0() + }, + _getEnd$p$3: function() + { + return this._data$p$0.get__end$i$0() + }, + _getLocation$p$3: function() + { + return this._data$p$0.get__location$i$0() + }, + _getOptionalAttendees$p$3: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getRequiredAttendees$p$3: function() + { + return this._data$p$0.get__to$i$0() + } +}; +$h.MeetingSuggestion=function(data, dateTimeSent) +{ + this.$$d__getEndTime$p$0=Function.createDelegate(this,this._getEndTime$p$0); + this.$$d__getStartTime$p$0=Function.createDelegate(this,this._getStartTime$p$0); + this.$$d__getSubject$p$0=Function.createDelegate(this,this._getSubject$p$0); + this.$$d__getLocation$p$0=Function.createDelegate(this,this._getLocation$p$0); + this.$$d__getAttendees$p$0=Function.createDelegate(this,this._getAttendees$p$0); + this.$$d__getMeetingString$p$0=Function.createDelegate(this,this._getMeetingString$p$0); + this._data$p$0=data; + this._dateTimeSent$p$0=dateTimeSent; + $h.InitialData._defineReadOnlyProperty$i(this,"meetingString",this.$$d__getMeetingString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"attendees",this.$$d__getAttendees$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStartTime$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEndTime$p$0) +}; +$h.MeetingSuggestion.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _attendees$p$0: null, + _getMeetingString$p$0: function() + { + return this._data$p$0["MeetingString"] + }, + _getLocation$p$0: function() + { + return this._data$p$0["Location"] + }, + _getSubject$p$0: function() + { + return this._data$p$0["Subject"] + }, + _getStartTime$p$0: function() + { + var time=this._createDateTimeFromParameter$p$0("StartTime"); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0); + if(resolvedTime.getTime() !==time.getTime()) + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + return time + }, + _getEndTime$p$0: function() + { + var time=this._createDateTimeFromParameter$p$0("EndTime"); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0); + if(resolvedTime.getTime() !==time.getTime()) + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + return time + }, + _createDateTimeFromParameter$p$0: function(keyName) + { + var dateTimeString=this._data$p$0[keyName]; + if(!dateTimeString) + return null; + return new Date(dateTimeString) + }, + _getAttendees$p$0: function() + { + if(!this._attendees$p$0) + { + var $$t_1=this; + this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Attendees",function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._attendees$p$0 + } +}; +$h.MeetingSuggestionTimeDecoder=function(){}; +$h.MeetingSuggestionTimeDecoder.resolve=function(inTime, sentTime) +{ + if(!sentTime) + return inTime; + try + { + var tod; + var outDate; + var extractedDate; + var sentDate=new Date(sentTime.getFullYear(),sentTime.getMonth(),sentTime.getDate(),0,0,0,0); + var $$t_7, + $$t_8, + $$t_9; + if(!($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime,$$t_7={val: extractedDate},$$t_8={val: tod}),extractedDate=$$t_7.val,tod=$$t_8.val,$$t_9)) + return inTime; + else + { + if($h._preciseDate.isInstanceOfType(extractedDate)) + outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate,extractedDate); + else if($h._relativeDate.isInstanceOfType(extractedDate)) + outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate,extractedDate); + else + outDate=sentDate; + if(isNaN(outDate.getTime())) + return sentTime; + outDate.setMilliseconds(outDate.getMilliseconds()+tod); + return outDate + } + } + catch($$e_6) + { + return sentTime + } +}; +$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function(value) +{ + return null===value || value===undefined +}; +$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function(sentDate, precise) +{ + var year=precise._year$i$1; + var month=!precise._month$i$1 ? sentDate.getMonth() : precise._month$i$1 - 1; + var day=precise._day$i$1; + if(!day) + return sentDate; + var candidate; + if($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + candidate=new Date(sentDate.getFullYear(),month,day); + if(candidate.getTime() < sentDate.getTime()) + candidate=new Date(sentDate.getFullYear()+1,month,day) + } + else + candidate=new Date(year < 50 ? 2e3+year : 1900+year,month,day); + if(candidate.getMonth() !==month) + return sentDate; + return candidate +}; +$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function(sentDate, relative) +{ + var date; + switch(relative._unit$i$1) + { + case 0: + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate()); + date.setDate(date.getDate()+relative._offset$i$1); + return date; + case 5: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate,relative._offset$i$1,relative._tag$i$1); + case 2: + var days=1; + switch(relative._modifier$i$1) + { + case 1: + break; + case 2: + days=16; + break; + default: + if(!relative._offset$i$1) + days=sentDate.getDate(); + break + } + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),days); + date.setMonth(date.getMonth()+relative._offset$i$1); + if(date.getTime() < sentDate.getTime()) + date.setDate(date.getDate()+sentDate.getDate() - 1); + return date; + case 1: + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate()); + date.setDate(sentDate.getDate()+7 * relative._offset$i$1); + if(relative._modifier$i$1===1 || !relative._modifier$i$1) + { + date.setDate(date.getDate()+1 - date.getDay()); + if(date.getTime() < sentDate.getTime()) + return sentDate; + return date + } + else if(relative._modifier$i$1===2) + { + date.setDate(date.getDate()+5 - date.getDay()); + return date + } + break; + case 4: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate,relative); + case 3: + if(relative._offset$i$1 > 0) + return new Date(sentDate.getFullYear()+relative._offset$i$1,0,1); + break; + default: + break + } + return sentDate +}; +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function(sentDate, offset, tag) +{ + if(offset > -5 && offset < 5) + { + var dayOfWeek; + var days; + dayOfWeek=(tag+6) % 7+1; + days=7 * offset+(dayOfWeek - sentDate.getDay()); + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } + else + { + var days=(tag - sentDate.getDay()) % 7; + if(days < 0) + days+=7; + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } +}; +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function(sentDate, relative) +{ + var date; + var firstDay; + var newDate; + date=sentDate; + if(relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) + return sentDate; + var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12; + firstDay=new Date(date.getFullYear(),date.getMonth()+monthOffset,1); + if(relative._modifier$i$1===1) + if(relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay()) + return firstDay; + else + { + newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),firstDay.getDate()); + newDate.setDate(newDate.getDate()+(7+(1 - firstDay.getDay())) % 7); + if(firstDay.getDay() !==6 && firstDay.getDay() && firstDay.getDay() !==1) + newDate.setDate(newDate.getDate() - 7); + newDate.setDate(newDate.getDate()+7 * (relative._offset$i$1 - 1)); + if(newDate.getMonth()+1 !==relative._tag$i$1) + return sentDate; + return newDate + } + else + { + newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),$h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(),firstDay.getFullYear())); + var offset=1 - newDate.getDay(); + if(offset > 0) + offset=offset - 7; + newDate.setDate(newDate.getDate()+offset); + newDate.setDate(newDate.getDate()+7 * (1 - relative._offset$i$1)); + if(newDate.getMonth()+1 !==relative._tag$i$1) + if(firstDay.getDay() !==6 && firstDay.getDay()) + return firstDay; + else + return sentDate; + else + return newDate + } +}; +$h.MeetingSuggestionTimeDecoder._decode$p=function(inDate, date, time) +{ + var DateValueMask=32767; + date.val=null; + time.val=0; + if(!inDate) + return false; + time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate); + var inDateAtMidnight=inDate.getTime() - time.val; + var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 864e5; + if(value < 0) + return false; + else if(value >=262144) + return false; + else + { + var type=value >> 15; + value=value & DateValueMask; + switch(type) + { + case 0: + return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value,date); + case 1: + return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value,date); + default: + return false + } + } +}; +$h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function(value, date) +{ + var c_SubTypeMask=7; + var c_MonthMask=15; + var c_DayMask=31; + var c_YearMask=127; + var year=null; + var month=0; + var day=0; + date.val=null; + var subType=value >> 12 & c_SubTypeMask; + if((subType & 4)===4) + { + year=value >> 5 & c_YearMask; + if((subType & 2)===2) + { + if((subType & 1)===1) + return false; + month=value >> 1 & c_MonthMask + } + } + else + { + if((subType & 2)===2) + month=value >> 8 & c_MonthMask; + if((subType & 1)===1) + day=value >> 3 & c_DayMask + } + date.val=new $h._preciseDate(day,month,year); + return true +}; +$h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function(value, date) +{ + var TagMask=15; + var OffsetMask=63; + var UnitMask=7; + var ModifierMask=3; + var tag=value & TagMask; + value >>=4; + var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask,6); + value >>=6; + var unit=value & UnitMask; + value >>=3; + var modifier=value & ModifierMask; + try + { + date.val=new $h._relativeDate(modifier,offset,unit,tag); + return true + } + catch($$e_A) + { + date.val=null; + return false + } +}; +$h.MeetingSuggestionTimeDecoder._fromComplement$p=function(value, n) +{ + var signed=1 << n - 1; + var mask=(1 << n) - 1; + if((value & signed)===signed) + return-((value ^ mask)+1); + else + return value +}; +$h.MeetingSuggestionTimeDecoder._daysInMonth$p=function(month, year) +{ + return 32 - new Date(year,month,32).getDate() +}; +$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function(inputTime) +{ + var timeOfDay=0; + timeOfDay+=inputTime.getUTCHours() * 3600; + timeOfDay+=inputTime.getUTCMinutes() * 60; + timeOfDay+=inputTime.getUTCSeconds(); + timeOfDay *=1e3; + timeOfDay+=inputTime.getUTCMilliseconds(); + return timeOfDay +}; +$h._extractedDate=function(){}; +$h._preciseDate=function(day, month, year) +{ + $h._preciseDate.initializeBase(this); + if(day < 0 || day > 31) + throw Error.argumentOutOfRange("day"); + if(month < 0 || month > 12) + throw Error.argumentOutOfRange("month"); + this._day$i$1=day; + this._month$i$1=month; + if(!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + if(!month && day) + throw Error.argument("Invalid arguments"); + if(year < 0 || year > 2099) + throw Error.argumentOutOfRange("year"); + this._year$i$1=year % 100 + } + else if(!this._month$i$1 && !this._day$i$1) + throw Error.argument("Invalid datetime"); +}; +$h._preciseDate.prototype={ + _day$i$1: 0, + _month$i$1: 0, + _year$i$1: null +}; +$h._relativeDate=function(modifier, offset, unit, tag) +{ + $h._relativeDate.initializeBase(this); + if(offset < -32 || offset > 31) + throw Error.argumentOutOfRange("offset"); + if(tag < 0 || tag > 15) + throw Error.argumentOutOfRange("tag"); + if(!unit && offset < 0) + throw Error.argument("unit & offset do not form a valid date"); + this._modifier$i$1=modifier; + this._offset$i$1=offset; + this._unit$i$1=unit; + this._tag$i$1=tag +}; +$h._relativeDate.prototype={ + _modifier$i$1: 0, + _offset$i$1: 0, + _unit$i$1: 0, + _tag$i$1: 0 +}; +$h.Message=function(dataDictionary) +{ + this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2); + this.$$d__getInternetMessageId$p$2=Function.createDelegate(this,this._getInternetMessageId$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2); + this.$$d__getFrom$p$2=Function.createDelegate(this,this._getFrom$p$2); + this.$$d__getSender$p$2=Function.createDelegate(this,this._getSender$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2); + $h.Message.initializeBase(this,[dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"sender",this.$$d__getSender$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"from",this.$$d__getFrom$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"internetMessageId",this.$$d__getInternetMessageId$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2) +}; +$h.Message.prototype={ + getEntities: function() + { + return this._data$p$0._getEntities$i$0() + }, + getEntitiesByType: function(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, + getFilteredEntitiesByName: function(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, + getRegExMatches: function() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches"); + return this._data$p$0._getRegExMatches$i$0() + }, + getRegExMatchesByName: function(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName"); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, + displayReplyForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj) + }, + displayReplyAllForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj) + }, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, + _getSubject$p$2: function() + { + return this._data$p$0.get__subject$i$0() + }, + _getNormalizedSubject$p$2: function() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, + _getSender$p$2: function() + { + return this._data$p$0.get__sender$i$0() + }, + _getFrom$p$2: function() + { + return this._data$p$0.get__from$i$0() + }, + _getTo$p$2: function() + { + return this._data$p$0.get__to$i$0() + }, + _getCc$p$2: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getInternetMessageId$p$2: function() + { + return this._data$p$0.get__internetMessageId$i$0() + }, + _getConversationId$p$2: function() + { + return this._data$p$0.get__conversationId$i$0() + } +}; +$h.MessageCompose=function(data) +{ + this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2); + this.$$d__getBcc$p$2=Function.createDelegate(this,this._getBcc$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2); + $h.MessageCompose.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"bcc",this.$$d__getBcc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2) +}; +$h.MessageCompose.prototype={ + _to$p$2: null, + _cc$p$2: null, + _bcc$p$2: null, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, + _getTo$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._to$p$2) + this._to$p$2=new $h.ComposeRecipient(0,"to"); + return this._to$p$2 + }, + _getCc$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._cc$p$2) + this._cc$p$2=new $h.ComposeRecipient(1,"cc"); + return this._cc$p$2 + }, + _getBcc$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._bcc$p$2) + this._bcc$p$2=new $h.ComposeRecipient(2,"bcc"); + return this._bcc$p$2 + }, + _getConversationId$p$2: function() + { + return this._data$p$0.get__conversationId$i$0() + } +}; +$h.OutlookErrorManager=function(){}; +$h.OutlookErrorManager.getErrorArgs=function(errorCode) +{ + if(!$h.OutlookErrorManager._isInitialized$p) + $h.OutlookErrorManager._initialize$p(); + return OSF.DDA.ErrorCodeManager.getErrorArgs(errorCode) +}; +$h.OutlookErrorManager._initialize$p=function() +{ + $h.OutlookErrorManager._addErrorMessage$p(9e3,"AttachmentSizeExceeded",_u.ExtensibilityStrings.l_AttachmentExceededSize_Text); + $h.OutlookErrorManager._addErrorMessage$p(9001,"NumberOfAttachmentsExceeded",_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text); + $h.OutlookErrorManager._addErrorMessage$p(9002,"InternalFormatError",_u.ExtensibilityStrings.l_InternalFormatError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9003,"InvalidAttachmentId",_u.ExtensibilityStrings.l_InvalidAttachmentId_Text); + $h.OutlookErrorManager._addErrorMessage$p(9004,"InvalidAttachmentPath",_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text); + $h.OutlookErrorManager._addErrorMessage$p(9005,"CannotAddAttachmentBeforeUpgrade",_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text); + $h.OutlookErrorManager._addErrorMessage$p(9006,"AttachmentDeletedBeforeUploadCompletes",_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text); + $h.OutlookErrorManager._addErrorMessage$p(9007,"AttachmentUploadGeneralFailure",_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9008,"AttachmentToDeleteDoesNotExist",_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text); + $h.OutlookErrorManager._addErrorMessage$p(9009,"AttachmentDeleteGeneralFailure",_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9010,"InvalidEndTime",_u.ExtensibilityStrings.l_InvalidEndTime_Text); + $h.OutlookErrorManager._addErrorMessage$p(9011,"HtmlSanitizationFailure",_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9012,"NumberOfRecipientsExceeded",String.format(_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text,100)); + $h.OutlookErrorManager._addErrorMessage$p(9013,"NoValidRecipientsProvided",_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text); + $h.OutlookErrorManager._addErrorMessage$p(9014,"CursorPositionChanged",_u.ExtensibilityStrings.l_CursorPositionChanged_Text); + $h.OutlookErrorManager._addErrorMessage$p(9016,"InvalidSelection",_u.ExtensibilityStrings.l_InvalidSelection_Text); + $h.OutlookErrorManager._isInitialized$p=true +}; +$h.OutlookErrorManager._addErrorMessage$p=function(errorCode, errorName, errorMessage) +{ + OSF.DDA.ErrorCodeManager.addErrorMessage(errorCode,{ + name: errorName, + message: errorMessage + }) +}; +$h.OutlookErrorManager.OutlookErrorCodes=function(){}; +$h.OutlookErrorManager.OsfDdaErrorCodes=function(){}; +$h.PhoneNumber=function(data) +{ + this.$$d__getPhoneType$p$0=Function.createDelegate(this,this._getPhoneType$p$0); + this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this,this._getOriginalPhoneString$p$0); + this.$$d__getPhoneString$p$0=Function.createDelegate(this,this._getPhoneString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"phoneString",this.$$d__getPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"originalPhoneString",this.$$d__getOriginalPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getPhoneType$p$0) +}; +$h.PhoneNumber.prototype={ + _data$p$0: null, + _getPhoneString$p$0: function() + { + return this._data$p$0["PhoneString"] + }, + _getOriginalPhoneString$p$0: function() + { + return this._data$p$0["OriginalPhoneString"] + }, + _getPhoneType$p$0: function() + { + return this._data$p$0["Type"] + } +}; +$h.TaskSuggestion=function(data) +{ + this.$$d__getAssignees$p$0=Function.createDelegate(this,this._getAssignees$p$0); + this.$$d__getTaskString$p$0=Function.createDelegate(this,this._getTaskString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"taskString",this.$$d__getTaskString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"assignees",this.$$d__getAssignees$p$0) +}; +$h.TaskSuggestion.prototype={ + _data$p$0: null, + _assignees$p$0: null, + _getTaskString$p$0: function() + { + return this._data$p$0["TaskString"] + }, + _getAssignees$p$0: function() + { + if(!this._assignees$p$0) + { + var $$t_1=this; + this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Assignees",function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._assignees$p$0 + } +}; +$h.UserProfile=function(data) +{ + this.$$d__getTimeZone$p$0=Function.createDelegate(this,this._getTimeZone$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"timeZone",this.$$d__getTimeZone$p$0) +}; +$h.UserProfile.prototype={ + _data$p$0: null, + _getDisplayName$p$0: function() + { + return this._data$p$0.get__userDisplayName$i$0() + }, + _getEmailAddress$p$0: function() + { + return this._data$p$0.get__userEmailAddress$i$0() + }, + _getTimeZone$p$0: function() + { + return this._data$p$0.get__userTimeZone$i$0() + } +}; +$h.RequestState=function(){}; +$h.RequestState.prototype={ + unsent: 0, + opened: 1, + headersReceived: 2, + loading: 3, + done: 4 +}; +$h.RequestState.registerEnum("$h.RequestState",false); +$h.CommonParameters=function(options, callback, asyncContext) +{ + this._options$p$0=options; + this._callback$p$0=callback; + this._asyncContext$p$0=asyncContext +}; +$h.CommonParameters.parse=function(args, isCallbackRequired, tryLegacy) +{ + var legacyParameters; + var $$t_8, + $$t_9; + if(tryLegacy && ($$t_9=$h.CommonParameters._tryParseLegacy$p(args,$$t_8={val: legacyParameters}),legacyParameters=$$t_8.val,$$t_9)) + return legacyParameters; + var argsLength=args.length; + var options=null; + var callback=null; + var asyncContext=null; + if(argsLength===1) + if(Function.isInstanceOfType(args[0])) + callback=args[0]; + else if(Object.isInstanceOfType(args[0])) + options=args[0]; + else + throw Error.argumentType(); + else if(argsLength===2) + { + if(!Object.isInstanceOfType(args[0])) + throw Error.argument("options"); + if(!Function.isInstanceOfType(args[1])) + throw Error.argument("callback"); + options=args[0]; + callback=args[1] + } + else if(argsLength) + throw Error.parameterCount(_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text); + if(isCallbackRequired && !callback) + throw Error.argumentNull("callback"); + if(options && !$h.ScriptHelpers.isNullOrUndefined(options["asyncContext"])) + asyncContext=options["asyncContext"]; + return new $h.CommonParameters(options,callback,asyncContext) +}; +$h.CommonParameters._tryParseLegacy$p=function(args, commonParameters) +{ + commonParameters.val=null; + var argsLength=args.length; + var callback=null; + var userContext=null; + if(!argsLength || argsLength > 2) + return false; + if(!Function.isInstanceOfType(args[0])) + return false; + callback=args[0]; + if(argsLength > 1) + userContext=args[1]; + commonParameters.val=new $h.CommonParameters(null,callback,userContext); + return true +}; +$h.CommonParameters.prototype={ + _options$p$0: null, + _callback$p$0: null, + _asyncContext$p$0: null, + get_options: function() + { + return this._options$p$0 + }, + get_callback: function() + { + return this._callback$p$0 + }, + get_asyncContext: function() + { + return this._asyncContext$p$0 + } +}; +$h.EwsRequest=function(userContext) +{ + $h.EwsRequest.initializeBase(this,[userContext]) +}; +$h.EwsRequest.prototype={ + readyState: 1, + status: 0, + statusText: null, + onreadystatechange: null, + responseText: null, + get__statusCode$i$1: function() + { + return this.status + }, + set__statusCode$i$1: function(value) + { + this.status=value; + return value + }, + get__statusDescription$i$1: function() + { + return this.statusText + }, + set__statusDescription$i$1: function(value) + { + this.statusText=value; + return value + }, + get__requestState$i$1: function() + { + return this.readyState + }, + set__requestState$i$1: function(value) + { + this.readyState=value; + return value + }, + get_hasOnReadyStateChangeCallback: function() + { + return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange) + }, + get__response$i$1: function() + { + return this.responseText + }, + set__response$i$1: function(value) + { + this.responseText=value; + return value + }, + send: function(data) + { + this._checkSendConditions$i$1(); + if($h.ScriptHelpers.isNullOrUndefined(data)) + this._throwInvalidStateException$i$1(); + this._sendRequest$i$0(5,"EwsRequest",{body: data}) + }, + _callOnReadyStateChangeCallback$i$1: function() + { + if(!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) + this.onreadystatechange() + }, + _parseExtraResponseData$i$1: function(response){}, + executeExtraFailedResponseSteps: function(){} +}; +$h.InitialData=function(data) +{ + this._data$p$0=data; + this._permissionLevel$p$0=this._calculatePermissionLevel$p$0() +}; +$h.InitialData._defineReadOnlyProperty$i=function(o, methodName, getter) +{ + var propertyDescriptor={ + get: getter, + configurable: false + }; + Object.defineProperty(o,methodName,propertyDescriptor) +}; +$h.InitialData.prototype={ + _toRecipients$p$0: null, + _ccRecipients$p$0: null, + _attachments$p$0: null, + _resources$p$0: null, + _entities$p$0: null, + _data$p$0: null, + _permissionLevel$p$0: 0, + get__itemId$i$0: function() + { + return this._data$p$0["id"] + }, + get__itemClass$i$0: function() + { + return this._data$p$0["itemClass"] + }, + get__dateTimeCreated$i$0: function() + { + return new Date(this._data$p$0["dateTimeCreated"]) + }, + get__dateTimeModified$i$0: function() + { + return new Date(this._data$p$0["dateTimeModified"]) + }, + get__dateTimeSent$i$0: function() + { + return new Date(this._data$p$0["dateTimeSent"]) + }, + get__subject$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0["subject"] + }, + get__normalizedSubject$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0["normalizedSubject"] + }, + get__internetMessageId$i$0: function() + { + return this._data$p$0["internetMessageId"] + }, + get__conversationId$i$0: function() + { + return this._data$p$0["conversationId"] + }, + get__sender$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var sender=this._data$p$0["sender"]; + return $h.ScriptHelpers.isNullOrUndefined(sender) ? null : new $h.EmailAddressDetails(sender) + }, + get__from$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var from=this._data$p$0["from"]; + return $h.ScriptHelpers.isNullOrUndefined(from) ? null : new $h.EmailAddressDetails(from) + }, + get__to$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._toRecipients$p$0) + this._toRecipients$p$0=this._createEmailAddressDetails$p$0("to"); + return this._toRecipients$p$0 + }, + get__cc$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._ccRecipients$p$0) + this._ccRecipients$p$0=this._createEmailAddressDetails$p$0("cc"); + return this._ccRecipients$p$0 + }, + get__attachments$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._attachments$p$0) + this._attachments$p$0=this._createAttachmentDetails$p$0(); + return this._attachments$p$0 + }, + get__ewsUrl$i$0: function() + { + return this._data$p$0["ewsUrl"] + }, + get__start$i$0: function() + { + return new Date(this._data$p$0["start"]) + }, + get__end$i$0: function() + { + return new Date(this._data$p$0["end"]) + }, + get__location$i$0: function() + { + return this._data$p$0["location"] + }, + get__resources$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._resources$p$0) + this._resources$p$0=this._createEmailAddressDetails$p$0("resources"); + return this._resources$p$0 + }, + get__organizer$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var organizer=this._data$p$0["organizer"]; + return $h.ScriptHelpers.isNullOrUndefined(organizer) ? null : new $h.EmailAddressDetails(organizer) + }, + get__userDisplayName$i$0: function() + { + return this._data$p$0["userDisplayName"] + }, + get__userEmailAddress$i$0: function() + { + return this._data$p$0["userEmailAddress"] + }, + get__userTimeZone$i$0: function() + { + return this._data$p$0["userTimeZone"] + }, + get__timeZoneOffsets$i$0: function() + { + return this._data$p$0["timeZoneOffsets"] + }, + get__hostVersion$i$0: function() + { + return this._data$p$0["hostVersion"] + }, + get__owaView$i$0: function() + { + return this._data$p$0["owaView"] + }, + get__overrideWindowOpen$i$0: function() + { + return this._data$p$0["overrideWindowOpen"] + }, + _getEntities$i$0: function() + { + if(!this._entities$p$0) + this._entities$p$0=new $h.Entities(this._data$p$0["entities"],this._data$p$0["filteredEntities"],this.get__dateTimeSent$i$0(),this._permissionLevel$p$0); + return this._entities$p$0 + }, + _getEntitiesByType$i$0: function(entityType) + { + var entites=this._getEntities$i$0(); + return entites._getByType$i$0(entityType) + }, + _getFilteredEntitiesByName$i$0: function(name) + { + var entities=this._getEntities$i$0(); + return entities._getFilteredEntitiesByName$i$0(name) + }, + _getRegExMatches$i$0: function() + { + if(!this._data$p$0["regExMatches"]) + return null; + return this._data$p$0["regExMatches"] + }, + _getRegExMatchesByName$i$0: function(regexName) + { + var regexMatches=this._getRegExMatches$i$0(); + if(!regexMatches || !regexMatches[regexName]) + return null; + return regexMatches[regexName] + }, + _throwOnRestrictedPermissionLevel$i$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0) + }, + _createEmailAddressDetails$p$0: function(key) + { + var to=this._data$p$0[key]; + if($h.ScriptHelpers.isNullOrUndefined(to)) + return[]; + var recipients=[]; + for(var i=0; i < to.length; i++) + if(!$h.ScriptHelpers.isNullOrUndefined(to[i])) + recipients[i]=new $h.EmailAddressDetails(to[i]); + return recipients + }, + _createAttachmentDetails$p$0: function() + { + var attachments=this._data$p$0["attachments"]; + if($h.ScriptHelpers.isNullOrUndefined(attachments)) + return[]; + var attachmentDetails=[]; + for(var i=0; i < attachments.length; i++) + if(!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) + attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]); + return attachmentDetails + }, + _calculatePermissionLevel$p$0: function() + { + var HostReadItem=1; + var HostReadWriteMailbox=2; + var HostReadWriteItem=3; + var permissionLevelFromHost=this._data$p$0["permissionLevel"]; + if($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0)) + return 0; + switch(permissionLevelFromHost) + { + case HostReadItem: + return 1; + case HostReadWriteItem: + return 2; + case HostReadWriteMailbox: + return 3; + default: + return 0 + } + } +}; +$h._loadDictionaryRequest=function(createResultObject, dictionaryName, callback, userContext) +{ + $h._loadDictionaryRequest.initializeBase(this,[userContext]); + this._createResultObject$p$1=createResultObject; + this._dictionaryName$p$1=dictionaryName; + this._callback$p$1=callback +}; +$h._loadDictionaryRequest.prototype={ + _dictionaryName$p$1: null, + _createResultObject$p$1: null, + _callback$p$1: null, + handleResponse: function(response) + { + if(response["wasSuccessful"]) + { + var value=response[this._dictionaryName$p$1]; + var responseData=JSON.parse(value); + this.createAsyncResult(this._createResultObject$p$1(responseData),0,null) + } + else + this.createAsyncResult(null,1,response["errorMessage"]); + this._callback$p$1(this._asyncResult$p$0) + } +}; +$h.ProxyRequestBase=function(userContext) +{ + $h.ProxyRequestBase.initializeBase(this,[userContext]) +}; +$h.ProxyRequestBase.prototype={ + handleResponse: function(response) + { + if(!response["wasProxySuccessful"]) + { + this.set__statusCode$i$1(500); + this.set__statusDescription$i$1("Error"); + var errorMessage=response["errorMessage"]; + this.set__response$i$1(errorMessage); + this.createAsyncResult(null,1,errorMessage) + } + else + { + this.set__statusCode$i$1(response["statusCode"]); + this.set__statusDescription$i$1(response["statusDescription"]); + this.set__response$i$1(response["body"]); + this.createAsyncResult(this.get__response$i$1(),0,null) + } + this._parseExtraResponseData$i$1(response); + this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() + }, + _throwInvalidStateException$i$1: function() + { + throw Error.create("DOMException",{ + code: 11, + message: "INVALID_STATE_ERR" + }); + }, + _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function() + { + var $$t_0=this; + this._changeReadyState$i$1(2,function() + { + $$t_0._changeReadyState$i$1(3,function() + { + $$t_0._changeReadyState$i$1(4,null) + }) + }) + }, + _changeReadyState$i$1: function(state, nextStep) + { + this.set__requestState$i$1(state); + var $$t_2=this; + window.setTimeout(function() + { + try + { + $$t_2._callOnReadyStateChangeCallback$i$1() + } + finally + { + if(!$h.ScriptHelpers.isNullOrUndefined(nextStep)) + nextStep() + } + },0) + }, + _checkSendConditions$i$1: function() + { + if(this.get__requestState$i$1() !==1) + this._throwInvalidStateException$i$1(); + if(this._isSent$p$0) + this._throwInvalidStateException$i$1() + } +}; +$h.RequestBase=function(userContext) +{ + this._userContext$p$0=userContext +}; +$h.RequestBase.prototype={ + _isSent$p$0: false, + _asyncResult$p$0: null, + _userContext$p$0: null, + _sendRequest$i$0: function(dispid, methodName, dataToSend) + { + this._isSent$p$0=true; + var $$t_5=this; + OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid,methodName,dataToSend,function(resultCode, response) + { + if(resultCode) + $$t_5.createAsyncResult(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode)); + else + $$t_5.handleResponse(response) + }) + }, + createAsyncResult: function(value, errorCode, errorDescription) + { + this._asyncResult$p$0=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(value,errorCode,errorDescription,this._userContext$p$0) + } +}; +$h._saveDictionaryRequest=function(callback, userContext) +{ + $h._saveDictionaryRequest.initializeBase(this,[userContext]); + if(!$h.ScriptHelpers.isNullOrUndefined(callback)) + this._callback$p$1=callback +}; +$h._saveDictionaryRequest.prototype={ + _callback$p$1: null, + handleResponse: function(response) + { + if(response["wasSuccessful"]) + this.createAsyncResult(null,0,null); + else + this.createAsyncResult(null,1,response["errorMessage"]); + if(!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) + this._callback$p$1(this._asyncResult$p$0) + } +}; +$h.ScriptHelpers=function(){}; +$h.ScriptHelpers.isNull=function(value) +{ + return null===value +}; +$h.ScriptHelpers.isNullOrUndefined=function(value) +{ + return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value) +}; +$h.ScriptHelpers.isUndefined=function(value) +{ + return value===undefined +}; +$h.ScriptHelpers.dictionaryContainsKey=function(obj, keyName) +{ + return Object.isInstanceOfType(obj) ? keyName in obj : false +}; +$h.ScriptHelpers.isNonEmptyString=function(value) +{ + if(!value) + return false; + return String.isInstanceOfType(value) +}; +OSF.DDA.OutlookAppOm.registerClass("OSF.DDA.OutlookAppOm"); +OSF.DDA.Settings.registerClass("OSF.DDA.Settings"); +$h.ItemBase.registerClass("$h.ItemBase"); +$h.Item.registerClass("$h.Item",$h.ItemBase); +$h.Appointment.registerClass("$h.Appointment",$h.Item); +$h.ComposeItem.registerClass("$h.ComposeItem",$h.ItemBase); +$h.AppointmentCompose.registerClass("$h.AppointmentCompose",$h.ComposeItem); +$h.AttachmentConstants.registerClass("$h.AttachmentConstants"); +$h.AttachmentDetails.registerClass("$h.AttachmentDetails"); +$h.ComposeBody.registerClass("$h.ComposeBody"); +$h.ComposeRecipient.registerClass("$h.ComposeRecipient"); +$h.ComposeLocation.registerClass("$h.ComposeLocation"); +$h.ComposeSubject.registerClass("$h.ComposeSubject"); +$h.ComposeTime.registerClass("$h.ComposeTime"); +$h.Contact.registerClass("$h.Contact"); +$h.CustomProperties.registerClass("$h.CustomProperties"); +$h.Diagnostics.registerClass("$h.Diagnostics"); +$h.EmailAddressDetails.registerClass("$h.EmailAddressDetails"); +$h.Entities.registerClass("$h.Entities"); +$h.ReplyConstants.registerClass("$h.ReplyConstants"); +$h.AsyncConstants.registerClass("$h.AsyncConstants"); +Office.cast.item.registerClass("Office.cast.item"); +$h.Message.registerClass("$h.Message",$h.Item); +$h.MeetingRequest.registerClass("$h.MeetingRequest",$h.Message); +$h.MeetingSuggestion.registerClass("$h.MeetingSuggestion"); +$h.MeetingSuggestionTimeDecoder.registerClass("$h.MeetingSuggestionTimeDecoder"); +$h._extractedDate.registerClass("$h._extractedDate"); +$h._preciseDate.registerClass("$h._preciseDate",$h._extractedDate); +$h._relativeDate.registerClass("$h._relativeDate",$h._extractedDate); +$h.MessageCompose.registerClass("$h.MessageCompose",$h.ComposeItem); +$h.OutlookErrorManager.registerClass("$h.OutlookErrorManager"); +$h.OutlookErrorManager.OutlookErrorCodes.registerClass("$h.OutlookErrorManager.OutlookErrorCodes"); +$h.OutlookErrorManager.OsfDdaErrorCodes.registerClass("$h.OutlookErrorManager.OsfDdaErrorCodes"); +$h.PhoneNumber.registerClass("$h.PhoneNumber"); +$h.TaskSuggestion.registerClass("$h.TaskSuggestion"); +$h.UserProfile.registerClass("$h.UserProfile"); +$h.CommonParameters.registerClass("$h.CommonParameters"); +$h.RequestBase.registerClass("$h.RequestBase"); +$h.ProxyRequestBase.registerClass("$h.ProxyRequestBase",$h.RequestBase); +$h.EwsRequest.registerClass("$h.EwsRequest",$h.ProxyRequestBase); +$h.InitialData.registerClass("$h.InitialData"); +$h._loadDictionaryRequest.registerClass("$h._loadDictionaryRequest",$h.RequestBase); +$h._saveDictionaryRequest.registerClass("$h._saveDictionaryRequest",$h.RequestBase); +$h.ScriptHelpers.registerClass("$h.ScriptHelpers"); +OSF.DDA.OutlookAppOm.asyncMethodTimeoutKeyName="__timeout__"; +OSF.DDA.OutlookAppOm._maxRecipients$p=100; +OSF.DDA.OutlookAppOm._maxSubjectLength$p=255; +OSF.DDA.OutlookAppOm.maxBodyLength=32768; +OSF.DDA.OutlookAppOm._maxLocationLength$p=255; +OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1e6; +OSF.DDA.OutlookAppOm._instance$p=null; +$h.AttachmentConstants.maxAttachmentNameLength=255; +$h.AttachmentConstants.maxUrlLength=2048; +$h.AttachmentConstants.maxItemIdLength=200; +$h.AttachmentConstants.maxRemoveIdLength=200; +$h.AttachmentConstants.attachmentParameterName="attachments"; +$h.AttachmentConstants.attachmentTypeParameterName="type"; +$h.AttachmentConstants.attachmentUrlParameterName="url"; +$h.AttachmentConstants.attachmentItemIdParameterName="itemId"; +$h.AttachmentConstants.attachmentNameParameterName="name"; +$h.AttachmentConstants.attachmentTypeFileName="file"; +$h.AttachmentConstants.attachmentTypeItemName="item"; +$h.AttachmentDetails._attachmentTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File,Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item]; +$h.ComposeBody.coercionTypeParameterName="coercionType"; +$h.ComposeRecipient.displayNameLengthLimit=255; +$h.ComposeRecipient.maxSmtpLength=571; +$h.ComposeRecipient.recipientsLimit=100; +$h.ComposeRecipient.addressParameterName="address"; +$h.ComposeRecipient.nameParameterName="name"; +$h.ComposeLocation.locationKey="location"; +$h.ComposeLocation.maximumLocationLength=255; +$h.ComposeSubject.maximumSubjectLength=255; +$h.ComposeTime.timeTypeName="TimeProperty"; +$h.ComposeTime.timeDataName="time"; +$h.Diagnostics.outlookAppName="Outlook"; +$h.Diagnostics.outlookWebAppName="OutlookWebApp"; +$h.EmailAddressDetails._emptyString$p=""; +$h.EmailAddressDetails._responseTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined]; +$h.EmailAddressDetails._recipientTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser]; +$h.Entities._allEntityKeys$p=["Addresses","EmailAddresses","Urls","PhoneNumbers","TaskSuggestions","MeetingSuggestions","Contacts"]; +$h.ReplyConstants.htmlBodyKeyName="htmlBody"; +$h.AsyncConstants.optionsKeyName="options"; +$h.AsyncConstants.callbackKeyName="callback"; +$h.AsyncConstants.asyncResultKeyName="asyncResult"; +$h.MeetingSuggestionTimeDecoder._baseDate$p=new Date("0001-01-01T00:00:00Z"); +$h.OutlookErrorManager.errorNameKey="name"; +$h.OutlookErrorManager.errorMessageKey="message"; +$h.OutlookErrorManager._isInitialized$p=false; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9e3; +$h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001; +$h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002; +$h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003; +$h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004; +$h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009; +$h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010; +$h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011; +$h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012; +$h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013; +$h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014; +$h.OutlookErrorManager.OutlookErrorCodes.invalidSelection=9016; +$h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1e3; +$h.CommonParameters.asyncContextKeyName="asyncContext"; +$h.ScriptHelpers.emptyString=""; +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed" +}; +OSF.DDA.RichClientSettingsManager={ + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving) + { + var keys=[]; + var values=[]; + if(onCalling) + onCalling(); + window.external.GetContext().GetSettings().Read(keys,values); + if(onReceiving) + onReceiving(); + var serializedSettings={}; + for(var index=0; index < keys.length; index++) + serializedSettings[keys[index]]=values[index]; + return serializedSettings + }, + write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving) + { + var keys=[]; + var values=[]; + for(var key in serializedSettings) + { + keys.push(key); + values.push(serializedSettings[key]) + } + if(onCalling) + onCalling(); + window.external.GetContext().GetSettings().Write(keys,values); + if(onReceiving) + onReceiving() + } +}; +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function(actionId) +{ + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) + { + return function(args) + { + var status, + response; + try + { + response=hostDelegateMethod(args.hostCallArgs,args.onCalling,args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess + } + catch(ex) + { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ + name: Strings.OfficeOM.L_InternalError, + message: ex + } + } + if(args.onComplete) + args.onComplete(status,response) + } + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) + { + return OSF.DDA.RichClientSettingsManager.read(onCalling,onReceiving) + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) + { + return OSF.DDA.RichClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings],hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale],onCalling,onReceiving) + } + switch(actionId) + { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break + } + return delegateMethods +}; +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + size: {value: fileSize}, + sliceCount: {value: Math.ceil(fileSize / sliceSize)} + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetDocumentCopyChunkAsync,am.ReleaseDocumentCopyAsync],privateState) +}; +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() +{ + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this,[am.AddDataPartAsync,am.GetDataPartByIdAsync,am.GetDataPartsByNameSpaceAsync]) +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + builtIn: {value: builtIn}, + id: {value: id}, + namespaceManager: {value: new OSF.DDA.CustomXmlPrefixMappings(id)} + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this,[am.DeleteDataPartAsync,am.GetPartNodesAsync,am.GetPartXmlAsync]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if(!dispatch) + { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([et.DataNodeDeleted,et.DataNodeInserted,et.DataNodeReplaced]); + customXmlPartEventDispatches[id]=dispatch + } + OSF.DDA.DispIdHost.addEventSupport(this,dispatch) +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) +{ + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this,[am.AddDataPartNamespaceAsync,am.GetDataPartNamespaceAsync,am.GetDataPartPrefixAsync],partId) +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + baseName: {value: baseName}, + namespaceUri: {value: ns}, + nodeType: {value: nodeType} + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetRelativeNodesAsync,am.GetNodeValueAsync,am.GetNodeXmlAsync,am.SetNodeValueAsync,am.SetNodeXmlAsync],handle) +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + type: {value: Microsoft.Office.WebExtension.EventType.DataNodeInserted}, + newNode: {value: newNode}, + inUndoRedo: {value: inUndoRedo} + }) +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + type: {value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced}, + oldNode: {value: oldNode}, + newNode: {value: newNode}, + inUndoRedo: {value: inUndoRedo} + }) +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + type: {value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted}, + oldNode: {value: oldNode}, + oldNextSibling: {value: oldNextSibling}, + inUndoRedo: {value: inUndoRedo} + }) +} + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.02.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.02.js new file mode 100644 index 000000000..feea92ad2 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.02.js @@ -0,0 +1,11 @@ +/* Outlook specific API library */ +/* Version: 15.0.4726.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item"};Microsoft.Office.WebExtension.MailboxEnums.BodyType={Text:"text",Html:"html"};Microsoft.Office.WebExtension.CoercionType={Text:"text",Html:"html"};Type.registerNamespace("OSF.DDA");OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d_$2i_0=Function.createDelegate(this,this.$2i_0);this.$$d_$34_0=Function.createDelegate(this,this.$34_0);this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);this.$$d_$3k_0=Function.createDelegate(this,this.$3k_0);this.$$d_$3i_0=Function.createDelegate(this,this.$3i_0);this.$$d_$4C_0=Function.createDelegate(this,this.$4C_0);this.$$d_$3t_0=Function.createDelegate(this,this.$3t_0);this.$$d_$3q_0=Function.createDelegate(this,this.$3q_0);OSF.DDA.OutlookAppOm.$2=this;this.$V_0=n;this.$14_0=i;var u=this;var r=function(){i&&u.$E_0(1,"GetInitialData",null,u.$$d_$3q_0)};this.$1p_0()?r():this.$4J_0(r)};OSF.DDA.OutlookAppOm.$N=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};OSF.DDA.OutlookAppOm.$A=function(n,t,i,r){if(ni)throw Error.argumentOutOfRange(r);};OSF.DDA.OutlookAppOm.$3o=function(n){var t="";if("htmlBody"in n){OSF.DDA.OutlookAppOm.$4a(n.htmlBody);t=n.htmlBody}return t};OSF.DDA.OutlookAppOm.$2B=function(n){var t=[];if("attachments"in n){t=n.attachments;OSF.DDA.OutlookAppOm.$4Y(t)}return t};OSF.DDA.OutlookAppOm.$3y=function(n){var t=[];"options"in n&&(t[0]=n.options);"callback"in n&&(t[t.length]=n.callback);return t};OSF.DDA.OutlookAppOm.$2q=function(n){var r=new Array(0);if(Array.isInstanceOfType(n))for(var t=0;t2048)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text);OSF.DDA.OutlookAppOm.$2d(t)};OSF.DDA.OutlookAppOm.$4X=function(n,t){if(!String.isInstanceOfType(n)||!String.isInstanceOfType(t))throw Error.argument("attachments");if(n.length>200)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text);OSF.DDA.OutlookAppOm.$2d(t)};OSF.DDA.OutlookAppOm.$2d=function(n){if(n.length>255)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text);};OSF.DDA.OutlookAppOm.$P=function(n,t,i){if(Object.getType(n)!==t)throw Error.argumentType(i);};OSF.DDA.OutlookAppOm.$1n=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm.$P(n,String,r);var u=n;OSF.DDA.OutlookAppOm.$A(u.length,t,i,r)}};OSF.DDA.OutlookAppOm.$2n=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:case 14:case 18:case 26:break;case 4:var r=JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm.$18(t.requiredAttendees),OSF.DDA.OutlookAppOm.$18(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm.$18(t.resources),t.subject,t.body];break;case 11:case 10:i=[t.htmlBody];break;case 31:case 30:i=[t.htmlBody,t.attachments];break;case 23:case 13:case 29:i=[t.data,t.coercionType];break;case 28:i=[t.coercionType];break;case 17:i=[t.subject];break;case 15:i=[t.recipientField];break;case 22:case 21:i=[t.recipientField,OSF.DDA.OutlookAppOm.$2l(t.recipientArray)];break;case 19:i=[t.itemId,t.name];break;case 16:i=[t.uri,t.name];break;case 20:i=[t.attachmentIndex];break;case 25:i=[t.TimeProperty,t.time];break;case 24:i=[t.TimeProperty];break;case 27:i=[t.location];break;default:break}return i};OSF.DDA.OutlookAppOm.$18=function(n){return n?n.join(";"):null};OSF.DDA.OutlookAppOm.$2l=function(n){if(!n)return null;for(var i=new Array(n.length),t=0;tOSF.DDA.OutlookAppOm.$2Q)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);this.$5_0(3,"makeEwsRequestAsync");var u=$h.CommonParameters.parse(r,!0,!0);var t=new $h.EwsRequest(u.$4_0);var f=this;t.onreadystatechange=function(){4===t.get_$1c_1()&&u.$3_0(t.$R_0)};t.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$E_0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$E_0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$E_0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this.$6_0&&this.$6_0.get_$1i_0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this.$22_0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this.$1D_0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this.$33_0(n);if(this.$6_0&&this.$6_0.get_$1i_0()){var i=this.$22_0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},getUserIdentityTokenAsync:function(){for(var i=[],n=0;n1&&f[1]){i.error=!0;i.errorCode=f[1]}else i.error=!1;r(t,i)}else if(Number.isInstanceOfType(u)){var e={};e.error=!0;e.errorCode=u;r(t,e)}else throw Error.notImplemented("Return data type from host must be Dictionary or int");}})}else r&&r(-2,null)},$33_0:function(n){var t=new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds?n.milliseconds:0);if(isNaN(t.getTime()))throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);return t},$1D_0:function(n){var t={};t.month=n.getMonth();t.date=n.getDate();t.year=n.getFullYear();t.hours=n.getHours();t.minutes=n.getMinutes();t.seconds=n.getSeconds();t.milliseconds=n.getMilliseconds();return t},$34_0:function(n){var u=OSF.DDA.OutlookAppOm.$2f(n.requiredAttendees,"requiredAttendees");var r=OSF.DDA.OutlookAppOm.$2f(n.optionalAttendees,"optionalAttendees");OSF.DDA.OutlookAppOm.$1n(n.location,0,OSF.DDA.OutlookAppOm.$2R,"location");OSF.DDA.OutlookAppOm.$1n(n.body,0,OSF.DDA.OutlookAppOm.maxBodyLength,"body");OSF.DDA.OutlookAppOm.$1n(n.subject,0,OSF.DDA.OutlookAppOm.$2T,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){OSF.DDA.OutlookAppOm.$P(n.start,Date,"start");var o=n.start;n.start=o.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){OSF.DDA.OutlookAppOm.$P(n.end,Date,"end");var i=n.end;if(i=0&&n.getTime()-u<0)return parseInt(t.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},$1p_0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},$4J_0:function(n){for(var s=null,l="",a=document.getElementsByTagName("script"),o=a.length-1;o>=0;o--){var i=null;var v=a[o].attributes;if(v){var p=v.getNamedItem("src");p&&(i=p.value);if(i){var y=!1;i=i.toLowerCase();var f=i.indexOf("office_strings.js");if(f<0){f=i.indexOf("office_strings.debug.js");y=!0}if(f>0&&fu+1&&(l=r.substring(0,u+1));break}}}}if(s){var h=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var c=this;var w=function(){if(!c.$1p_0()){var n=l+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=c.$1w_0(n);t.onload=e;t.onreadystatechange=e;h.appendChild(t)}};t=this.$1w_0(s);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);h.appendChild(t)}},$1w_0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};OSF.DDA.Settings=function(n){this.$r_0=n};OSF.DDA.Settings.$2m=function(n){if(!n)return{};if(OSF.DDA.OutlookAppOm.$2.get_$13_0()===8){var t=n.SettingsKey;if(t)return OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={$r_0:null,$u_0:null,get_$T_0:function(){if(!this.$u_0){this.$u_0=OSF.DDA.Settings.$2m(this.$r_0);this.$r_0=null}return this.$u_0},get:function(n){return this.get_$T_0()[n]},set:function(n,t){this.get_$T_0()[n]=t},remove:function(n){delete this.get_$T_0()[n]},saveAsync:function(){for(var i=[],t=0;t255)throw Error.argumentOutOfRange("recipients",n.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text);if(t&&t.length>571)throw Error.argumentOutOfRange("recipients",t.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text);};$h.ComposeRecipient.$3X=function(n){for(var r=n,i=[],t=0;t864e13)throw Error.argumentOutOfRange("dateTime");var i=$h.CommonParameters.parse(r,!1);OSF.DDA.OutlookAppOm.$2.$8_0(25,"SetTimeAsync",{TimeProperty:this.$X_0,time:n.getTime()},null,i.$4_0,i.$3_0)},$4b_0:function(n){var t=n;return new Date(t)},$2I_0:function(){return this.$X_0===1?"start":"end"}};$h.ComposeTime.TimeType=function(){};$h.ComposeTime.TimeType.prototype={start:1,end:2};$h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",!1);$h.Contact=function(n){this.$$d_$3e_0=Function.createDelegate(this,this.$3e_0);this.$$d_$1N_0=Function.createDelegate(this,this.$1N_0);this.$$d_$1Y_0=Function.createDelegate(this,this.$1Y_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$$d_$1U_0=Function.createDelegate(this,this.$1U_0);this.$$d_$3c_0=Function.createDelegate(this,this.$3c_0);this.$$d_$42_0=Function.createDelegate(this,this.$42_0);this.$0_0=n;$h.InitialData.$1(this,"personName",this.$$d_$42_0);$h.InitialData.$1(this,"businessName",this.$$d_$3c_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$1U_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$1Q_0);$h.InitialData.$1(this,"urls",this.$$d_$1Y_0);$h.InitialData.$1(this,"addresses",this.$$d_$1N_0);$h.InitialData.$1(this,"contactString",this.$$d_$3e_0)};$h.Contact.prototype={$0_0:null,$J_0:null,$42_0:function(){return this.$0_0.PersonName},$3c_0:function(){return this.$0_0.BusinessName},$1N_0:function(){return $h.Entities.$H(this.$0_0,"Addresses")},$1Q_0:function(){return $h.Entities.$H(this.$0_0,"EmailAddresses")},$1Y_0:function(){return $h.Entities.$H(this.$0_0,"Urls")},$1U_0:function(){if(!this.$J_0){var n=this;this.$J_0=$h.Entities.$F($h.PhoneNumber,this.$0_0,"PhoneNumbers",function(n){return new $h.PhoneNumber(n)})}return this.$J_0},$3e_0:function(){return this.$0_0.ContactString}};$h.CustomProperties=function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");if(Array.isInstanceOfType(n)){var t=n;if(t.length>0)this.$0_0=t[0];else throw Error.argument("data");}else this.$0_0=n};$h.CustomProperties.prototype={$0_0:null,get:function(n){var i=this.$0_0[n];if(typeof i=="string"){var t=i;if(t.length>6&&t.startsWith("Date(")&&t.endsWith(")")){var f=t.substring(5,t.length-1);var r=parseInt(f);if(!isNaN(r)){var u=new Date(r);u&&(i=u)}}}return i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")");this.$0_0[n]=t},remove:function(n){delete this.$0_0[n]},saveAsync:function(){for(var i=[],n=0;nu)throw Error.argument();var t=$h.CommonParameters.parse(i,!1,!0);var r=new $h.SaveDictionaryRequest(t.$3_0,t.$4_0);r.$1f_0(4,"SaveCustomProperties",{customProperties:this.$0_0})}};$h.Diagnostics=function(n,t){this.$$d_$41_0=Function.createDelegate(this,this.$41_0);this.$$d_$3n_0=Function.createDelegate(this,this.$3n_0);this.$$d_$3m_0=Function.createDelegate(this,this.$3m_0);this.$0_0=n;this.$Q_0=t;$h.InitialData.$1(this,"hostName",this.$$d_$3m_0);$h.InitialData.$1(this,"hostVersion",this.$$d_$3n_0);64===this.$Q_0&&$h.InitialData.$1(this,"OWAView",this.$$d_$41_0)};$h.Diagnostics.prototype={$0_0:null,$Q_0:0,$3m_0:function(){if(8===this.$Q_0)return"Outlook";else if(64===this.$Q_0)return"OutlookWebApp";return null},$3n_0:function(){return this.$0_0.get_$4D_0()},$41_0:function(){return this.$0_0.get_$4M_0()}};$h.EmailAddressDetails=function(n){this.$$d_$2J_0=Function.createDelegate(this,this.$2J_0);this.$$d_$2A_0=Function.createDelegate(this,this.$2A_0);this.$$d_$1O_0=Function.createDelegate(this,this.$1O_0);this.$$d_$1P_0=Function.createDelegate(this,this.$1P_0);this.$0_0=n;$h.InitialData.$1(this,"emailAddress",this.$$d_$1P_0);$h.InitialData.$1(this,"displayName",this.$$d_$1O_0);$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData.$1(this,"appointmentResponse",this.$$d_$2A_0);$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData.$1(this,"recipientType",this.$$d_$2J_0)};$h.EmailAddressDetails.$1u=function(n){var t={};var r=n.Name;var i=n.UserId;t.name=r||$h.EmailAddressDetails.$1H;t.address=i||$h.EmailAddressDetails.$1H;return new $h.EmailAddressDetails(t)};$h.EmailAddressDetails.prototype={$0_0:null,toJSON:function(){var n={};n.emailAddress=this.$1P_0();n.displayName=this.$1O_0();$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"appointmentResponse")&&(n.appointmentResponse=this.$2A_0());$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"recipientType")&&(n.recipientType=this.$2J_0());return n},$1P_0:function(){return this.$0_0.address},$1O_0:function(){return this.$0_0.name},$2A_0:function(){var n=this.$0_0.appointmentResponse;return n<$h.EmailAddressDetails.$1e.length?$h.EmailAddressDetails.$1e[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},$2J_0:function(){var n=this.$0_0.recipientType;return n<$h.EmailAddressDetails.$1b.length?$h.EmailAddressDetails.$1b[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}};$h.Entities=function(n,t,i,r){this.$$d_$2u_0=Function.createDelegate(this,this.$2u_0);this.$$d_$2D_0=Function.createDelegate(this,this.$2D_0);this.$$d_$1U_0=Function.createDelegate(this,this.$1U_0);this.$$d_$1Y_0=Function.createDelegate(this,this.$1Y_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$$d_$2G_0=Function.createDelegate(this,this.$2G_0);this.$$d_$2L_0=Function.createDelegate(this,this.$2L_0);this.$$d_$1N_0=Function.createDelegate(this,this.$1N_0);this.$0_0=n||{};this.$1I_0=t||{};this.$L_0=i;$h.InitialData.$1(this,"addresses",this.$$d_$1N_0);$h.InitialData.$1(this,"taskSuggestions",this.$$d_$2L_0);$h.InitialData.$1(this,"meetingSuggestions",this.$$d_$2G_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$1Q_0);$h.InitialData.$1(this,"urls",this.$$d_$1Y_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$1U_0);$h.InitialData.$1(this,"contacts",this.$$d_$2D_0);this.$C_0=r};$h.Entities.$F=function(n,t,i,r,u,f){var s=null;var e=t[i];if(!e)return new Array(0);u&&(e=$h.Entities.$2V(Object,e,$h.Entities.$37,f));s=new Array(e.length);for(var l=0,h=e,a=h.length,o=0;o=0;u--){for(var e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t};$h.Entities.prototype={$L_0:null,$0_0:null,$1I_0:null,$D_0:null,$C_0:0,$x_0:null,$o_0:null,$J_0:null,$g_0:null,$Y_0:null,$h_0:null,$11_0:null,$3d_0:function(n){if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)return this.$2G_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)return this.$2L_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)return this.$1N_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)return this.$1U_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)return this.$1Q_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)return this.$1Y_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)return this.$2D_0();return null},$1S_0:function(n){this.$D_0||(this.$D_0={});if(!$h.ScriptHelpers.dictionaryContainsKey(this.$D_0,n)){for(var r=!1,i=0;i<$h.Entities.$12.length;i++){var u=$h.Entities.$12[i];var t=this.$1I_0[u];if(t&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this.$D_0[n]=$h.Entities.$H(t,n);break;case"Addresses":this.$D_0[n]=$h.Entities.$H(t,n,!0);break;case"PhoneNumbers":this.$D_0[n]=$h.Entities.$F($h.PhoneNumber,t,n,$h.Entities.$1v,!1,null);break;case"TaskSuggestions":this.$D_0[n]=$h.Entities.$F($h.TaskSuggestion,t,n,$h.Entities.$1x,!0,"TaskString");break;case"MeetingSuggestions":this.$D_0[n]=$h.Entities.$F($h.MeetingSuggestion,t,n,this.$$d_$2u_0,!0,"MeetingString");break;case"Contacts":this.$D_0[n]=$h.Entities.$F($h.Contact,t,n,$h.Entities.$1s,!0,"ContactString");break}r=!0;break}}r||(this.$D_0[n]=null)}return this.$D_0[n]},$2u_0:function(n){return new $h.MeetingSuggestion(n,this.$L_0)},$1N_0:function(){this.$Y_0||(this.$Y_0=$h.Entities.$H(this.$0_0,"Addresses",!0));return this.$Y_0},$1Q_0:function(){OSF.DDA.OutlookAppOm.$N(this.$C_0);this.$h_0||(this.$h_0=$h.Entities.$H(this.$0_0,"EmailAddresses",!1));return this.$h_0},$1Y_0:function(){this.$11_0||(this.$11_0=$h.Entities.$H(this.$0_0,"Urls",!1));return this.$11_0},$1U_0:function(){this.$J_0||(this.$J_0=$h.Entities.$F($h.PhoneNumber,this.$0_0,"PhoneNumbers",$h.Entities.$1v));return this.$J_0},$2L_0:function(){OSF.DDA.OutlookAppOm.$N(this.$C_0);this.$x_0||(this.$x_0=$h.Entities.$F($h.TaskSuggestion,this.$0_0,"TaskSuggestions",$h.Entities.$1x,!0,"TaskString"));return this.$x_0},$2G_0:function(){OSF.DDA.OutlookAppOm.$N(this.$C_0);this.$o_0||(this.$o_0=$h.Entities.$F($h.MeetingSuggestion,this.$0_0,"MeetingSuggestions",this.$$d_$2u_0,!0,"MeetingString"));return this.$o_0},$2D_0:function(){OSF.DDA.OutlookAppOm.$N(this.$C_0);this.$g_0||(this.$g_0=$h.Entities.$F($h.Contact,this.$0_0,"Contacts",$h.Entities.$1s,!0,"ContactString"));return this.$g_0}};$h.ReplyConstants=function(){};$h.AsyncConstants=function(){};Office.cast.item=function(){};Office.cast.item.toItemRead=function(n){if($h.Item.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toItemCompose=function(n){if($h.ComposeItem.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessage=function(n){return Office.cast.item.toMessageRead(n)};Office.cast.item.toMessageRead=function(n){if($h.Message.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessageCompose=function(n){if($h.MessageCompose.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMeetingRequest=function(n){if($h.MeetingRequest.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointment=function(n){return Office.cast.item.toAppointmentRead(n)};Office.cast.item.toAppointmentRead=function(n){if($h.Appointment.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointmentCompose=function(n){if($h.AppointmentCompose.isInstanceOfType(n))return n;throw Error.argumentType();};$h.Item=function(n){this.$$d_$2B_1=Function.createDelegate(this,this.$2B_1);this.$$d_$3u_1=Function.createDelegate(this,this.$3u_1);this.$$d_$3v_1=Function.createDelegate(this,this.$3v_1);this.$$d_$3h_1=Function.createDelegate(this,this.$3h_1);this.$$d_$3g_1=Function.createDelegate(this,this.$3g_1);$h.Item.initializeBase(this,[n]);$h.InitialData.$1(this,"dateTimeCreated",this.$$d_$3g_1);$h.InitialData.$1(this,"dateTimeModified",this.$$d_$3h_1);$h.InitialData.$1(this,"itemId",this.$$d_$3v_1);$h.InitialData.$1(this,"itemClass",this.$$d_$3u_1);$h.InitialData.$1(this,"attachments",this.$$d_$2B_1)};$h.Item.prototype={$3v_1:function(){return this.$0_0.get_$4I_0()},$3u_1:function(){return this.$0_0.get_$4H_0()},$3g_1:function(){return this.$0_0.get_$2w_0()},$3h_1:function(){return this.$0_0.get_$2x_0()},$2B_1:function(){return this.$0_0.get_$2g_0()}};$h.ItemBase=function(n){this.$$d_$2r_0=Function.createDelegate(this,this.$2r_0);this.$$d_getItemType=Function.createDelegate(this,this.getItemType);this.$0_0=n;$h.InitialData.$1(this,"itemType",this.$$d_getItemType)};$h.ItemBase.prototype={$0_0:null,get_data:function(){return this.$0_0},loadCustomPropertiesAsync:function(){for(var i=[],n=0;n0)return new Date(n.getFullYear()+t.$B_1,0,1);break;default:break}return n};$h.MeetingSuggestionTimeDecoder.$39=function(n,t,i){if(t>-5&&t<5){var u;var f;u=(i+6)%7+1;f=7*t+(u-n.getDay());n.setDate(n.getDate()+f);return n}else{var r=(i-n.getDay())%7;r<0&&(r+=7);n.setDate(n.getDate()+r);return n}};$h.MeetingSuggestionTimeDecoder.$3A=function(n,t){var f;var i;var r;f=n;if(t.$K_1<=0||t.$K_1>12||t.$B_1<=0||t.$B_1>5)return n;var e=(12+t.$K_1-f.getMonth()-1)%12;i=new Date(f.getFullYear(),f.getMonth()+e,1);if(t.$M_1===1)if(t.$B_1===1&&i.getDay()!==6&&i.getDay())return i;else{r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()+(8-i.getDay())%7);i.getDay()!==6&&i.getDay()&&i.getDay()!==1&&r.setDate(r.getDate()-7);r.setDate(r.getDate()+7*(t.$B_1-1));return r.getMonth()+1!==t.$K_1?n:r}else{r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder.$2z(i.getMonth(),i.getFullYear()));var u=1-r.getDay();u>0&&(u=u-7);r.setDate(r.getDate()+u);r.setDate(r.getDate()+7*(1-t.$B_1));return r.getMonth()+1!==t.$K_1?i.getDay()!==6&&i.getDay()?i:n:r}};$h.MeetingSuggestionTimeDecoder.$30=function(n,t,i){var f=32767;t.val=null;i.val=0;if(!n)return!1;i.val=$h.MeetingSuggestionTimeDecoder.$4A(n);var e=n.getTime()-i.val;var r=(e-$h.MeetingSuggestionTimeDecoder.$1q.getTime())/864e5;if(r<0)return!1;else if(r>=262144)return!1;else{var u=r>>15;r=r&f;switch(u){case 0:return $h.MeetingSuggestionTimeDecoder.$31(r,t);case 1:return $h.MeetingSuggestionTimeDecoder.$32(r,t);default:return!1}}};$h.MeetingSuggestionTimeDecoder.$31=function(n,t){var h=7;var e=15;var o=31;var s=127;var u=null;var r=0;var f=0;t.val=null;var i=n>>12&h;if((i&4)==4){u=n>>5&s;if((i&2)==2){if((i&1)==1)return!1;r=n>>1&e}}else{(i&2)==2&&(r=n>>8&e);(i&1)==1&&(f=n>>3&o)}t.val=new $h.PreciseDate(f,r,u);return!0};$h.MeetingSuggestionTimeDecoder.$32=function(n,t){var o=15;var e=63;var h=7;var s=3;var r=n&o;n>>=4;var i=$h.MeetingSuggestionTimeDecoder.$3C(n&e,6);n>>=6;var f=n&h;n>>=3;var u=n&s;try{t.val=new $h.RelativeDate(u,i,f,r);return!0}catch(c){t.val=null;return!1}};$h.MeetingSuggestionTimeDecoder.$3C=function(n,t){var i=1<2||!Function.isInstanceOfType(n[0]))return!1;u=n[0];i>1&&(r=n[1]);t.val=new $h.CommonParameters(null,u,r);return!0};$h.CommonParameters.prototype={$O_0:null,$3_0:null,$4_0:null,get_options:function(){return this.$O_0},get_callback:function(){return this.$3_0},get_asyncContext:function(){return this.$4_0}};$h.EwsRequest=function(n){$h.EwsRequest.initializeBase(this,[n])};$h.EwsRequest.prototype={readyState:1,status:0,statusText:null,onreadystatechange:null,responseText:null,get_$2a_1:function(){return this.status},set_$2a_1:function(n){this.status=n;return n},get_$2b_1:function(){return this.statusText},set_$2b_1:function(n){this.statusText=n;return n},get_$1c_1:function(){return this.readyState},set_$1c_1:function(n){this.readyState=n;return n},get_hasOnReadyStateChangeCallback:function(){return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)},get_$1d_1:function(){return this.responseText},set_$1d_1:function(n){this.responseText=n;return n},send:function(n){this.$2k_1();$h.ScriptHelpers.isNullOrUndefined(n)&&this.$1g_1();this.$1f_0(5,"EwsRequest",{body:n})},$2j_1:function(){$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)||this.onreadystatechange()},$4N_1:function(n){},executeExtraFailedResponseSteps:function(){}};$h.InitialData=function(n){this.$0_0=n;this.$C_0=this.$2h_0()};$h.InitialData.$1=function(n,t,i){var r={get:i,configurable:!1};Object.defineProperty(n,t,r)};$h.InitialData.prototype={$z_0:null,$f_0:null,$a_0:null,$t_0:null,$j_0:null,$0_0:null,$C_0:0,get_$4I_0:function(){return this.$0_0.id},get_$4H_0:function(){return this.$0_0.itemClass},get_$2w_0:function(){return new Date(this.$0_0.dateTimeCreated)},get_$2x_0:function(){return new Date(this.$0_0.dateTimeModified)},get_$2y_0:function(){return new Date(this.$0_0.dateTimeSent)},get_$2c_0:function(){this.$7_0();return this.$0_0.subject},get_$2U_0:function(){this.$7_0();return this.$0_0.normalizedSubject},get_$4G_0:function(){return this.$0_0.internetMessageId},get_$1r_0:function(){return this.$0_0.conversationId},get_$4T_0:function(){this.$7_0();var n=this.$0_0.sender;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$3B_0:function(){this.$7_0();var n=this.$0_0.from;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$1j_0:function(){this.$7_0();null===this.$z_0&&(this.$z_0=this.$19_0("to"));return this.$z_0},get_$16_0:function(){this.$7_0();null===this.$f_0&&(this.$f_0=this.$19_0("cc"));return this.$f_0},get_$2g_0:function(){this.$7_0();null===this.$a_0&&(this.$a_0=this.$2p_0());return this.$a_0},get_$38_0:function(){return this.$0_0.ewsUrl},get_$2Z_0:function(){return new Date(this.$0_0.start)},get_$21_0:function(){return new Date(this.$0_0.end)},get_$2P_0:function(){return this.$0_0.location},get_$4Q_0:function(){this.$7_0();null===this.$t_0&&(this.$t_0=this.$19_0("resources"));return this.$t_0},get_$4K_0:function(){this.$7_0();var n=this.$0_0.organizer;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$4d_0:function(){return this.$0_0.userDisplayName},get_$4e_0:function(){return this.$0_0.userEmailAddress},get_$4f_0:function(){return this.$0_0.userTimeZone},get_$1i_0:function(){return this.$0_0.timeZoneOffsets},get_$4D_0:function(){return this.$0_0.hostVersion},get_$4M_0:function(){return this.$0_0.owaView},get_$4L_0:function(){return this.$0_0.overrideWindowOpen},$k_0:function(){this.$j_0||(this.$j_0=new $h.Entities(this.$0_0.entities,this.$0_0.filteredEntities,this.get_$2y_0(),this.$C_0));return this.$j_0},$2F_0:function(n){var t=this.$k_0();return t.$3d_0(n)},$1S_0:function(n){var t=this.$k_0();return t.$1S_0(n)},$1V_0:function(){return this.$0_0.regExMatches?this.$0_0.regExMatches:null},$2K_0:function(n){var t=this.$1V_0();return!t||!t[n]?null:t[n]},$7_0:function(){OSF.DDA.OutlookAppOm.$N(this.$C_0)},$19_0:function(n){var i=this.$0_0[n];if($h.ScriptHelpers.isNullOrUndefined(i))return[];for(var r=[],t=0;t maxValue) { + throw Error.argumentOutOfRange(argumentName); + } +} +OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function OSF_DDA_OutlookAppOm$_validateOptionalStringParameter$p(value, minLength, maxLength, name) { + if ($h.ScriptHelpers.isNullOrUndefined(value)) { + return; + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value, String, name); + var stringValue=value; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(stringValue.length, minLength, maxLength, name); +} +OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function OSF_DDA_OutlookAppOm$_convertToOutlookParameters$p(dispid, data) { + var executeParameters=null; + switch (dispid) { + case 1: + case 2: + case 12: + case 3: + break; + case 4: + var jsonProperty=JSON.stringify(data['customProperties']); + executeParameters=[ jsonProperty ]; + break; + case 5: + executeParameters=[ data['body'] ]; + break; + case 8: + case 9: + executeParameters=[ data['itemId'] ]; + break; + case 7: + executeParameters=[ OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['requiredAttendees']), OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['optionalAttendees']), data['start'], data['end'], data['location'], OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['resources']), data['subject'], data['body'] ]; + break; + case 11: + case 10: + executeParameters=[ data['htmlBody'] ]; + break; + default: + Sys.Debug.fail('Unexpected method dispid'); + break; + } + return executeParameters; +} +OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p=function OSF_DDA_OutlookAppOm$_convertRecipientArrayParameterForOutlook$p(array) { + return (array) ? array.join(';') : null; +} +OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function OSF_DDA_OutlookAppOm$_validateAndNormalizeRecipientEmails$p(emailset, name) { + if ($h.ScriptHelpers.isNullOrUndefined(emailset)) { + return null; + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset, Array, name); + var originalAttendees=emailset; + var updatedAttendees=null; + var normalizationNeeded=false; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(originalAttendees.length, 0, OSF.DDA.OutlookAppOm._maxRecipients$p, String.format('{0}.length', name)); + for (var i=0; i < originalAttendees.length; i++) { + if ($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) { + normalizationNeeded=true; + break; + } + } + if (normalizationNeeded) { + updatedAttendees=[]; + } + for (var i=0; i < originalAttendees.length; i++) { + if (normalizationNeeded) { + updatedAttendees[i]=($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) ? (originalAttendees[i]).emailAddress : originalAttendees[i]; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i], String, String.format('{0}[{1}]', name, i)); + } + else { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i], String, String.format('{0}[{1}]', name, i)); + } + } + return updatedAttendees; +} +OSF.DDA.OutlookAppOm.prototype={ + _initialData$p$0: null, + _item$p$0: null, + _userProfile$p$0: null, + _diagnostics$p$0: null, + _officeAppContext$p$0: null, + _appReadyCallback$p$0: null, + get__appName$i$0: function OSF_DDA_OutlookAppOm$get__appName$i$0() { + return this._officeAppContext$p$0.get_appName(); + }, + initialize: function OSF_DDA_OutlookAppOm$initialize(initialData) { + var ItemTypeKey='itemType'; + this._initialData$p$0=new $h.InitialData(initialData); + if (1===initialData[ItemTypeKey]) { + this._item$p$0=new $h.Message(this._initialData$p$0); + } + else if (3===initialData[ItemTypeKey]) { + this._item$p$0=new $h.MeetingRequest(this._initialData$p$0); + } + else if (2===initialData[ItemTypeKey]) { + this._item$p$0=new $h.Appointment(this._initialData$p$0); + } + else { + Sys.Debug.trace('Unexpected item type was received from the host.'); + } + this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0); + this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0, this._officeAppContext$p$0.get_appName()); + $h.InitialData._defineReadOnlyProperty$i(this, 'item', this.$$d__getItem$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'userProfile', this.$$d__getUserProfile$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'diagnostics', this.$$d__getDiagnostics$p$0); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) { + $h.InitialData._defineReadOnlyProperty$i(this, 'ewsUrl', this.$$d__getEwsUrl$p$0); + } + }, + makeEwsRequestAsync: function OSF_DDA_OutlookAppOm$makeEwsRequestAsync(data, callback, userContext) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + if (data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) { + throw Error.argument('data', _u.ExtensibilityStrings.l_EwsRequestOversized_Text); + } + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 2, 'makeEwsRequestAsync'); + var ewsRequest=new $h.EwsRequest(userContext); + var $$t_4=this; + ewsRequest.onreadystatechange=function() { + if (4===ewsRequest.get__requestState$i$1()) { + callback(ewsRequest._asyncResult$p$0); + } + }; + ewsRequest.send(data); + }, + recordDataPoint: function OSF_DDA_OutlookAppOm$recordDataPoint(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordDataPoint', data, null); + }, + recordTrace: function OSF_DDA_OutlookAppOm$recordTrace(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordTrace', data, null); + }, + trackCtq: function OSF_DDA_OutlookAppOm$trackCtq(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'TrackCtq', data, null); + }, + convertToLocalClientTime: function OSF_DDA_OutlookAppOm$convertToLocalClientTime(timeValue) { + var date=new Date(timeValue.getTime()); + var offset=date.getTimezoneOffset() * -1; + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) { + date.setUTCMinutes(date.getUTCMinutes() - offset); + offset=this._findOffset$p$0(date); + date.setUTCMinutes(date.getUTCMinutes()+offset); + } + var retValue=this._dateToDictionary$i$0(date); + retValue['timezoneOffset']=offset; + return retValue; + }, + convertToUtcClientTime: function OSF_DDA_OutlookAppOm$convertToUtcClientTime(input) { + var retValue=this._dictionaryToDate$i$0(input); + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) { + var offset=this._findOffset$p$0(retValue); + retValue.setUTCMinutes(retValue.getUTCMinutes() - offset); + offset=(!input['timezoneOffset']) ? retValue.getTimezoneOffset() * -1 : input['timezoneOffset']; + retValue.setUTCMinutes(retValue.getUTCMinutes()+offset); + } + return retValue; + }, + getUserIdentityTokenAsync: function OSF_DDA_OutlookAppOm$getUserIdentityTokenAsync(callback, userContext) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 1, 'getUserIdentityTokenAsync'); + this._invokeGetTokenMethodAsync$p$0(2, 'GetUserIdentityToken', callback, userContext); + }, + getCallbackTokenAsync: function OSF_DDA_OutlookAppOm$getCallbackTokenAsync(callback, userContext) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 1, 'getCallbackTokenAsync'); + if (64 !==this._officeAppContext$p$0.get_appName()) { + throw Error.notImplemented('The getCallbackTokenAsync is not supported by outlook for now.'); + } + this._invokeGetTokenMethodAsync$p$0(12, 'GetCallbackToken', callback, userContext); + }, + displayMessageForm: function OSF_DDA_OutlookAppOm$displayMessageForm(itemId) { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(8, 'DisplayExistingMessageForm', { itemId: itemId }, null); + }, + displayAppointmentForm: function OSF_DDA_OutlookAppOm$displayAppointmentForm(itemId) { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(9, 'DisplayExistingAppointmentForm', { itemId: itemId }, null); + }, + displayNewAppointmentForm: function OSF_DDA_OutlookAppOm$displayNewAppointmentForm(parameters) { + var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['requiredAttendees'], 'requiredAttendees'); + var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['optionalAttendees'], 'optionalAttendees'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['location'], 0, OSF.DDA.OutlookAppOm._maxLocationLength$p, 'location'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['body'], 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'body'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['subject'], 0, OSF.DDA.OutlookAppOm._maxSubjectLength$p, 'subject'); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['start'])) { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['start'], Date, 'start'); + var startDateTime=parameters['start']; + parameters['start']=startDateTime.getTime(); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['end'])) { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['end'], Date, 'end'); + var endDateTime=parameters['end']; + if (endDateTime < startDateTime) { + throw Error.argumentOutOfRange('end', endDateTime, _u.ExtensibilityStrings.l_InvalidEventDates_Text); + } + parameters['end']=endDateTime.getTime(); + } + } + var updatedParameters=null; + if (normalizedRequiredAttendees || normalizedOptionalAttendees) { + updatedParameters={}; + var $$dict_6=parameters; + for (var $$key_7 in $$dict_6) { + var entry={ key: $$key_7, value: $$dict_6[$$key_7] }; + updatedParameters[entry.key]=entry.value; + } + if (normalizedRequiredAttendees) { + updatedParameters['requiredAttendees']=normalizedRequiredAttendees; + } + if (normalizedOptionalAttendees) { + updatedParameters['optionalAttendees']=normalizedOptionalAttendees; + } + } + this._invokeHostMethod$i$0(7, 'DisplayNewAppointmentForm', updatedParameters || parameters, null); + }, + _displayReplyForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyForm$i$0(htmlBody) { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody'); + } + this._invokeHostMethod$i$0(10, 'DisplayReplyForm', { htmlBody: htmlBody }, null); + }, + _displayReplyAllForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyAllForm$i$0(htmlBody) { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody'); + } + this._invokeHostMethod$i$0(11, 'DisplayReplyAllForm', { htmlBody: htmlBody }, null); + }, + _invokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_invokeHostMethod$i$0(dispid, name, data, responseCallback) { + if (64===this._officeAppContext$p$0.get_appName()) { + OSF._OfficeAppFactory.getClientEndPoint().invoke(name, responseCallback, data); + } + else if (dispid) { + var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid, data); + var $$t_9=this; + window.external.Execute(dispid, executeParameters, function(nativeData, resultCode) { + if (responseCallback) { + var serializedData=nativeData.getItem(0); + var deserializedData=JSON.parse(serializedData); + responseCallback(resultCode, deserializedData); + } + }); + } + else if (responseCallback) { + responseCallback(-2, null); + } + }, + _dictionaryToDate$i$0: function OSF_DDA_OutlookAppOm$_dictionaryToDate$i$0(input) { + var retValue=new Date(input['year'], input['month'], input['date'], input['hours'], input['minutes'], input['seconds'], (!input['milliseconds']) ? 0 : input['milliseconds']); + if (isNaN(retValue.getTime())) { + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + } + return retValue; + }, + _dateToDictionary$i$0: function OSF_DDA_OutlookAppOm$_dateToDictionary$i$0(input) { + var retValue={}; + retValue['month']=input.getMonth(); + retValue['date']=input.getDate(); + retValue['year']=input.getFullYear(); + retValue['hours']=input.getHours(); + retValue['minutes']=input.getMinutes(); + retValue['seconds']=input.getSeconds(); + retValue['milliseconds']=input.getMilliseconds(); + return retValue; + }, + _getInitialDataResponseHandler$p$0: function OSF_DDA_OutlookAppOm$_getInitialDataResponseHandler$p$0(resultCode, data) { + if (resultCode) { + return; + } + this.initialize(data); + (this).displayName='mailbox'; + window.setTimeout(this.$$d__callAppReadyCallback$p$0, 0); + }, + _callAppReadyCallback$p$0: function OSF_DDA_OutlookAppOm$_callAppReadyCallback$p$0() { + this._appReadyCallback$p$0(); + }, + _invokeGetTokenMethodAsync$p$0: function OSF_DDA_OutlookAppOm$_invokeGetTokenMethodAsync$p$0(outlookDispid, methodName, callback, userContext) { + if ($h.ScriptHelpers.isNullOrUndefined(callback)) { + throw Error.argumentNull('callback'); + } + var $$t_8=this; + this._invokeHostMethod$i$0(outlookDispid, methodName, null, function(resultCode, response) { + var asyncResult; + if (resultCode) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext); + } + else { + var responseDictionary=response; + if (responseDictionary['wasSuccessful']) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(responseDictionary['token'], 0, null, userContext); + } + else { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, responseDictionary['errorMessage'], userContext); + } + } + callback(asyncResult); + }); + }, + _getItem$p$0: function OSF_DDA_OutlookAppOm$_getItem$p$0() { + return this._item$p$0; + }, + _getUserProfile$p$0: function OSF_DDA_OutlookAppOm$_getUserProfile$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0.get__permissionLevel$i$0()); + return this._userProfile$p$0; + }, + _getDiagnostics$p$0: function OSF_DDA_OutlookAppOm$_getDiagnostics$p$0() { + return this._diagnostics$p$0; + }, + _getEwsUrl$p$0: function OSF_DDA_OutlookAppOm$_getEwsUrl$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0.get__permissionLevel$i$0()); + return this._initialData$p$0.get__ewsUrl$i$0(); + }, + _findOffset$p$0: function OSF_DDA_OutlookAppOm$_findOffset$p$0(value) { + var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0(); + for (var r=0; r < ranges.length; r++) { + var range=ranges[r]; + var start=parseInt(range['start']); + var end=parseInt(range['end']); + if (value.getTime() - start >=0 && value.getTime() - end < 0) { + return parseInt(range['offset']); + } + } + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + }, + _areStringsLoaded$p$0: function OSF_DDA_OutlookAppOm$_areStringsLoaded$p$0() { + var stringsLoaded=false; + try { + stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text); + } + catch ($$e_1) { + } + return stringsLoaded; + }, + _loadLocalizedScript$p$0: function OSF_DDA_OutlookAppOm$_loadLocalizedScript$p$0(stringLoadedCallback) { + var url=null; + var baseUrl=''; + var scripts=document.getElementsByTagName('script'); + for (var i=scripts.length - 1; i >=0; i--) { + var filename=null; + var attributes=scripts[i].attributes; + if (attributes) { + var attribute=attributes.getNamedItem('src'); + if (attribute) { + filename=attribute.value; + } + if (filename) { + var debug=false; + filename=filename.toLowerCase(); + var officeIndex=filename.indexOf('office_strings.js'); + if (officeIndex < 0) { + officeIndex=filename.indexOf('office_strings.debug.js'); + debug=true; + } + if ((officeIndex > 0) && (officeIndex < filename.length)) { + url=filename.replace((debug) ? 'office_strings.debug.js' : 'office_strings.js', 'outlook_strings.js'); + var languageUrl=filename.substring(0, officeIndex); + var lastIndexOfSlash=languageUrl.lastIndexOf('/', languageUrl.length - 2); + if (lastIndexOfSlash===-1) { + lastIndexOfSlash=languageUrl.lastIndexOf('\\', languageUrl.length - 2); + } + if (lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) { + baseUrl=languageUrl.substring(0, lastIndexOfSlash+1); + } + break; + } + } + } + } + if (url) { + var head=document.getElementsByTagName('head')[0]; + var scriptElement=null; + var $$t_H=this; + var scriptElementCallback=function() { + if (stringLoadedCallback && (!scriptElement.readyState || (scriptElement.readyState && (scriptElement.readyState==='loaded' || scriptElement.readyState==='complete')))) { + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + stringLoadedCallback(); + } + }; + var $$t_I=this; + var failureCallback=function() { + if (!$$t_I._areStringsLoaded$p$0()) { + var fallbackUrl=baseUrl+'en-us/'+'outlook_strings.js'; + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + head.appendChild(scriptElement); + } + }; + scriptElement=this._createScriptElement$p$0(url); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + window.setTimeout(failureCallback, 2000); + head.appendChild(scriptElement); + } + }, + _createScriptElement$p$0: function OSF_DDA_OutlookAppOm$_createScriptElement$p$0(url) { + var scriptElement=document.createElement('script'); + scriptElement.type='text/javascript'; + scriptElement.src=url; + return scriptElement; + } +} +OSF.DDA.Settings=function OSF_DDA_Settings(data) { + this._rawData$p$0=data; +} +OSF.DDA.Settings._convertFromRawSettings$p=function OSF_DDA_Settings$_convertFromRawSettings$p(rawSettings) { + if (!rawSettings) { + return {}; + } + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) { + var outlookSettings=rawSettings['SettingsKey']; + if (outlookSettings) { + return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings); + } + } + return rawSettings; +} +OSF.DDA.Settings.prototype={ + _rawData$p$0: null, + _settingsData$p$0: null, + get__data$p$0: function OSF_DDA_Settings$get__data$p$0() { + if (!this._settingsData$p$0) { + this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0); + this._rawData$p$0=null; + } + return this._settingsData$p$0; + }, + get: function OSF_DDA_Settings$get(name) { + return this.get__data$p$0()[name]; + }, + set: function OSF_DDA_Settings$set(name, value) { + this.get__data$p$0()[name]=value; + }, + remove: function OSF_DDA_Settings$remove(name) { + delete this.get__data$p$0()[name]; + }, + saveAsync: function OSF_DDA_Settings$saveAsync() { + var args=[]; + for (var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) { + args[$$pai_4]=arguments[$$pai_4]; + } + var callback=null; + var userContext=null; + if (args && args.length > 0) { + var currentArgument=args.length - 1; + if (Function.isInstanceOfType(args[currentArgument])) { + callback=args[currentArgument]; + currentArgument--; + if (currentArgument >=0) { + userContext=(args[currentArgument])['asyncContext']; + } + } + } + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) { + this._saveSettingsForOwa$p$0(callback, userContext); + } + else { + this._saveSettingsForOutlook$p$0(callback, userContext); + } + }, + _saveSettingsForOutlook$p$0: function OSF_DDA_Settings$_saveSettingsForOutlook$p$0(callback, userContext) { + var storedException=null; + try { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var jsonSettings=JSON.stringify(serializedSettings); + var settingsObjectToSave={ SettingsKey: jsonSettings }; + OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave); + } + catch (ex) { + storedException=ex; + } + if (callback) { + var asyncResult; + if (storedException) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, storedException.message, userContext); + } + else { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 0, null, userContext); + } + callback(asyncResult); + } + }, + _saveSettingsForOwa$p$0: function OSF_DDA_Settings$_saveSettingsForOwa$p$0(callback, userContext) { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var $$t_7=this; + OSF._OfficeAppFactory.getClientEndPoint().invoke('saveSettingsAsync', function(resultCode, response) { + if (callback) { + var asyncResult; + if (resultCode) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext); + } + else { + var responseDictionary=response; + if (!(responseDictionary['error'])) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 0, null, userContext); + } + else { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, responseDictionary['errorMessage'], userContext); + } + } + callback(asyncResult); + } + }, [ serializedSettings ]); + } +} +Type.registerNamespace('$h'); +$h.Appointment=function $h_Appointment(dataDictionary) { + this.$$d__getOrganizer$p$1=Function.createDelegate(this, this._getOrganizer$p$1); + this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this, this._getNormalizedSubject$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1); + this.$$d__getResources$p$1=Function.createDelegate(this, this._getResources$p$1); + this.$$d__getRequiredAttendees$p$1=Function.createDelegate(this, this._getRequiredAttendees$p$1); + this.$$d__getOptionalAttendees$p$1=Function.createDelegate(this, this._getOptionalAttendees$p$1); + this.$$d__getLocation$p$1=Function.createDelegate(this, this._getLocation$p$1); + this.$$d__getEnd$p$1=Function.createDelegate(this, this._getEnd$p$1); + this.$$d__getStart$p$1=Function.createDelegate(this, this._getStart$p$1); + $h.Appointment.initializeBase(this, [ dataDictionary ]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'resources', this.$$d__getResources$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'organizer', this.$$d__getOrganizer$p$1); +} +$h.Appointment.prototype={ + getEntities: function $h_Appointment$getEntities() { + return this._data$p$0._getEntities$i$0(); + }, + getEntitiesByType: function $h_Appointment$getEntitiesByType(entityType) { + return this._data$p$0._getEntitiesByType$i$0(entityType); + }, + getRegExMatches: function $h_Appointment$getRegExMatches() { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0(); + }, + getFilteredEntitiesByName: function $h_Appointment$getFilteredEntitiesByName(name) { + return this._data$p$0._getFilteredEntitiesByName$i$0(name); + }, + getRegExMatchesByName: function $h_Appointment$getRegExMatchesByName(name) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name); + }, + displayReplyForm: function $h_Appointment$displayReplyForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody); + }, + displayReplyAllForm: function $h_Appointment$displayReplyAllForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody); + }, + getItemType: function $h_Appointment$getItemType() { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment; + }, + _getStart$p$1: function $h_Appointment$_getStart$p$1() { + return this._data$p$0.get__start$i$0(); + }, + _getEnd$p$1: function $h_Appointment$_getEnd$p$1() { + return this._data$p$0.get__end$i$0(); + }, + _getLocation$p$1: function $h_Appointment$_getLocation$p$1() { + return this._data$p$0.get__location$i$0(); + }, + _getOptionalAttendees$p$1: function $h_Appointment$_getOptionalAttendees$p$1() { + return this._data$p$0.get__cc$i$0(); + }, + _getRequiredAttendees$p$1: function $h_Appointment$_getRequiredAttendees$p$1() { + return this._data$p$0.get__to$i$0(); + }, + _getResources$p$1: function $h_Appointment$_getResources$p$1() { + return this._data$p$0.get__resources$i$0(); + }, + _getSubject$p$1: function $h_Appointment$_getSubject$p$1() { + return this._data$p$0.get__subject$i$0(); + }, + _getNormalizedSubject$p$1: function $h_Appointment$_getNormalizedSubject$p$1() { + return this._data$p$0.get__normalizedSubject$i$0(); + }, + _getOrganizer$p$1: function $h_Appointment$_getOrganizer$p$1() { + return this._data$p$0.get__organizer$i$0(); + } +} +$h.AttachmentDetails=function $h_AttachmentDetails(data) { + this.$$d__getIsInline$p$0=Function.createDelegate(this, this._getIsInline$p$0); + this.$$d__getAttachmentType$p$0=Function.createDelegate(this, this._getAttachmentType$p$0); + this.$$d__getSize$p$0=Function.createDelegate(this, this._getSize$p$0); + this.$$d__getContentType$p$0=Function.createDelegate(this, this._getContentType$p$0); + this.$$d__getName$p$0=Function.createDelegate(this, this._getName$p$0); + this.$$d__getId$p$0=Function.createDelegate(this, this._getId$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'id', this.$$d__getId$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'name', this.$$d__getName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contentType', this.$$d__getContentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'size', this.$$d__getSize$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attachmentType', this.$$d__getAttachmentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'isInline', this.$$d__getIsInline$p$0); +} +$h.AttachmentDetails.prototype={ + _data$p$0: null, + _getId$p$0: function $h_AttachmentDetails$_getId$p$0() { + return this._data$p$0['id']; + }, + _getName$p$0: function $h_AttachmentDetails$_getName$p$0() { + return this._data$p$0['name']; + }, + _getContentType$p$0: function $h_AttachmentDetails$_getContentType$p$0() { + return this._data$p$0['contentType']; + }, + _getSize$p$0: function $h_AttachmentDetails$_getSize$p$0() { + return this._data$p$0['size']; + }, + _getAttachmentType$p$0: function $h_AttachmentDetails$_getAttachmentType$p$0() { + var response=this._data$p$0['attachmentType']; + return (response < $h.AttachmentDetails._attachmentTypeMap$p.length) ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File; + }, + _getIsInline$p$0: function $h_AttachmentDetails$_getIsInline$p$0() { + return this._data$p$0['isInline']; + } +} +$h.Contact=function $h_Contact(data) { + this.$$d__getContactString$p$0=Function.createDelegate(this, this._getContactString$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getBusinessName$p$0=Function.createDelegate(this, this._getBusinessName$p$0); + this.$$d__getPersonName$p$0=Function.createDelegate(this, this._getPersonName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'personName', this.$$d__getPersonName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'businessName', this.$$d__getBusinessName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contactString', this.$$d__getContactString$p$0); +} +$h.Contact.prototype={ + _data$p$0: null, + _phoneNumbers$p$0: null, + _getPersonName$p$0: function $h_Contact$_getPersonName$p$0() { + return this._data$p$0['PersonName']; + }, + _getBusinessName$p$0: function $h_Contact$_getBusinessName$p$0() { + return this._data$p$0['BusinessName']; + }, + _getAddresses$p$0: function $h_Contact$_getAddresses$p$0() { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses'); + }, + _getEmailAddresses$p$0: function $h_Contact$_getEmailAddresses$p$0() { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses'); + }, + _getUrls$p$0: function $h_Contact$_getUrls$p$0() { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls'); + }, + _getPhoneNumbers$p$0: function $h_Contact$_getPhoneNumbers$p$0() { + if (!this._phoneNumbers$p$0) { + var $$t_1=this; + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', function(data) { + return new $h.PhoneNumber(data); + }); + } + return this._phoneNumbers$p$0; + }, + _getContactString$p$0: function $h_Contact$_getContactString$p$0() { + return this._data$p$0['ContactString']; + } +} +$h.CustomProperties=function $h_CustomProperties(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._data$p$0=data; +} +$h.CustomProperties.prototype={ + _data$p$0: null, + get: function $h_CustomProperties$get(name) { + var value=this._data$p$0[name]; + if (typeof(value)==='string') { + var valueString=value; + if (valueString.length > 6 && valueString.startsWith('Date(') && valueString.endsWith(')')) { + var ticksString=valueString.substring(5, valueString.length - 1); + var ticks=parseInt(ticksString); + if (!isNaN(ticks)) { + var dateTimeValue=new Date(ticks); + if (dateTimeValue) { + value=dateTimeValue; + } + } + } + } + return value; + }, + set: function $h_CustomProperties$set(name, value) { + if (OSF.OUtil.isDate(value)) { + value='Date('+(value).getTime()+')'; + } + this._data$p$0[name]=value; + }, + remove: function $h_CustomProperties$remove(name) { + delete this._data$p$0[name]; + }, + saveAsync: function $h_CustomProperties$saveAsync(callback, userContext) { + var MaxCustomPropertiesLength=2500; + if (JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) { + throw Error.argument(); + } + var saveCustomProperties=new $h._saveDictionaryRequest(callback, userContext); + saveCustomProperties._sendRequest$i$0(4, 'SaveCustomProperties', { customProperties: this._data$p$0 }); + } +} +$h.Diagnostics=function $h_Diagnostics(data, appName) { + this.$$d__getOwaView$p$0=Function.createDelegate(this, this._getOwaView$p$0); + this.$$d__getHostVersion$p$0=Function.createDelegate(this, this._getHostVersion$p$0); + this.$$d__getHostName$p$0=Function.createDelegate(this, this._getHostName$p$0); + this._data$p$0=data; + this._appName$p$0=appName; + $h.InitialData._defineReadOnlyProperty$i(this, 'hostName', this.$$d__getHostName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'hostVersion', this.$$d__getHostVersion$p$0); + if (64===this._appName$p$0) { + $h.InitialData._defineReadOnlyProperty$i(this, 'OWAView', this.$$d__getOwaView$p$0); + } +} +$h.Diagnostics.prototype={ + _data$p$0: null, + _appName$p$0: 0, + _getHostName$p$0: function $h_Diagnostics$_getHostName$p$0() { + if (8===this._appName$p$0) { + return 'Outlook'; + } + else if (64===this._appName$p$0) { + return 'OutlookWebApp'; + } + return null; + }, + _getHostVersion$p$0: function $h_Diagnostics$_getHostVersion$p$0() { + return this._data$p$0.get__hostVersion$i$0(); + }, + _getOwaView$p$0: function $h_Diagnostics$_getOwaView$p$0() { + return this._data$p$0.get__owaView$i$0(); + } +} +$h.EmailAddressDetails=function $h_EmailAddressDetails(data) { + this.$$d__getRecipientType$p$0=Function.createDelegate(this, this._getRecipientType$p$0); + this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this, this._getAppointmentResponse$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'appointmentResponse')) { + $h.InitialData._defineReadOnlyProperty$i(this, 'appointmentResponse', this.$$d__getAppointmentResponse$p$0); + } + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'recipientType')) { + $h.InitialData._defineReadOnlyProperty$i(this, 'recipientType', this.$$d__getRecipientType$p$0); + } +} +$h.EmailAddressDetails._createFromEmailUserDictionary$i=function $h_EmailAddressDetails$_createFromEmailUserDictionary$i(data) { + var emailAddressDetailsDictionary={}; + var displayName=data['Name']; + var emailAddress=data['UserId']; + emailAddressDetailsDictionary['name']=displayName || $h.EmailAddressDetails._emptyString$p; + emailAddressDetailsDictionary['address']=emailAddress || $h.EmailAddressDetails._emptyString$p; + return new $h.EmailAddressDetails(emailAddressDetailsDictionary); +} +$h.EmailAddressDetails.prototype={ + _data$p$0: null, + _getEmailAddress$p$0: function $h_EmailAddressDetails$_getEmailAddress$p$0() { + return this._data$p$0['address']; + }, + _getDisplayName$p$0: function $h_EmailAddressDetails$_getDisplayName$p$0() { + return this._data$p$0['name']; + }, + _getAppointmentResponse$p$0: function $h_EmailAddressDetails$_getAppointmentResponse$p$0() { + var response=this._data$p$0['appointmentResponse']; + return (response < $h.EmailAddressDetails._responseTypeMap$p.length) ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None; + }, + _getRecipientType$p$0: function $h_EmailAddressDetails$_getRecipientType$p$0() { + var response=this._data$p$0['recipientType']; + return (response < $h.EmailAddressDetails._recipientTypeMap$p.length) ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other; + } +} +$h.Entities=function $h_Entities(data, filteredEntitiesData, timeSent, permissionLevel) { + this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this, this._createMeetingSuggestion$p$0); + this.$$d__getContacts$p$0=Function.createDelegate(this, this._getContacts$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this, this._getMeetingSuggestions$p$0); + this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this, this._getTaskSuggestions$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this._data$p$0=data || {}; + this._filteredData$p$0=filteredEntitiesData || {}; + this._dateTimeSent$p$0=timeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'taskSuggestions', this.$$d__getTaskSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingSuggestions', this.$$d__getMeetingSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contacts', this.$$d__getContacts$p$0); + this._permissionLevel$p$0=permissionLevel; +} +$h.Entities._getExtractedObjects$i=function $h_Entities$_getExtractedObjects$i(T, data, name, creator, removeDuplicates, stringPropertyName) { + var results=null; + var extractedObjects=data[name]; + if (!extractedObjects) { + return new Array(0); + } + if (removeDuplicates) { + extractedObjects=$h.Entities._removeDuplicate$p(Object, extractedObjects, $h.Entities._entityDictionaryEquals$p, stringPropertyName); + } + results=new Array(extractedObjects.length); + var count=0; + for (var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) { + var extractedObject=$$arr_9[$$idx_B]; + results[count++]=creator(extractedObject); + } + return results; +} +$h.Entities._getExtractedStringProperty$i=function $h_Entities$_getExtractedStringProperty$i(data, name, removeDuplicate) { + var extractedProperties=data[name]; + if (!extractedProperties) { + return new Array(0); + } + if (removeDuplicate) { + extractedProperties=$h.Entities._removeDuplicate$p(String, extractedProperties, $h.Entities._stringEquals$p, null); + } + return extractedProperties; +} +$h.Entities._createContact$p=function $h_Entities$_createContact$p(data) { + return new $h.Contact(data); +} +$h.Entities._createTaskSuggestion$p=function $h_Entities$_createTaskSuggestion$p(data) { + return new $h.TaskSuggestion(data); +} +$h.Entities._createPhoneNumber$p=function $h_Entities$_createPhoneNumber$p(data) { + return new $h.PhoneNumber(data); +} +$h.Entities._entityDictionaryEquals$p=function $h_Entities$_entityDictionaryEquals$p(dictionary1, dictionary2, entityPropertyIdentifier) { + if (dictionary1===dictionary2) { + return true; + } + if (!dictionary1 || !dictionary2) { + return false; + } + if (dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) { + return true; + } + return false; +} +$h.Entities._stringEquals$p=function $h_Entities$_stringEquals$p(string1, string2, entityProperty) { + return string1===string2; +} +$h.Entities._removeDuplicate$p=function $h_Entities$_removeDuplicate$p(T, array, entityEquals, entityPropertyIdentifier) { + for (var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) { + var removeMatch=false; + for (var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) { + if (entityEquals(array[matchIndex1], array[matchIndex2], entityPropertyIdentifier)) { + removeMatch=true; + break; + } + } + if (removeMatch) { + Array.removeAt(array, matchIndex1); + } + } + return array; +} +$h.Entities.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _filteredData$p$0: null, + _filteredEntitiesCache$p$0: null, + _permissionLevel$p$0: 0, + _taskSuggestions$p$0: null, + _meetingSuggestions$p$0: null, + _phoneNumbers$p$0: null, + _contacts$p$0: null, + _addresses$p$0: null, + _emailAddresses$p$0: null, + _urls$p$0: null, + _getByType$i$0: function $h_Entities$_getByType$i$0(entityType) { + if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) { + return this._getMeetingSuggestions$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) { + return this._getTaskSuggestions$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) { + return this._getAddresses$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) { + return this._getPhoneNumbers$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) { + return this._getEmailAddresses$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) { + return this._getUrls$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) { + return this._getContacts$p$0(); + } + return null; + }, + _getFilteredEntitiesByName$i$0: function $h_Entities$_getFilteredEntitiesByName$i$0(name) { + if (!this._filteredEntitiesCache$p$0) { + this._filteredEntitiesCache$p$0={}; + } + if (!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0, name)) { + var found=false; + for (var i=0; i < $h.Entities._allEntityKeys$p.length; i++) { + var entityTypeKey=$h.Entities._allEntityKeys$p[i]; + var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey]; + if (!perEntityTypeDictionary) { + continue; + } + if ($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary, name)) { + switch (entityTypeKey) { + case 'EmailAddresses': + case 'Urls': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name); + break; + case 'Addresses': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name, true); + break; + case 'PhoneNumbers': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber, perEntityTypeDictionary, name, $h.Entities._createPhoneNumber$p, false, null); + break; + case 'TaskSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, perEntityTypeDictionary, name, $h.Entities._createTaskSuggestion$p, true, 'TaskString'); + break; + case 'MeetingSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, perEntityTypeDictionary, name, this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString'); + break; + case 'Contacts': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact, perEntityTypeDictionary, name, $h.Entities._createContact$p, true, 'ContactString'); + break; + } + found=true; + break; + } + } + if (!found) { + this._filteredEntitiesCache$p$0[name]=null; + } + } + return this._filteredEntitiesCache$p$0[name]; + }, + _createMeetingSuggestion$p$0: function $h_Entities$_createMeetingSuggestion$p$0(data) { + return new $h.MeetingSuggestion(data, this._dateTimeSent$p$0); + }, + _getAddresses$p$0: function $h_Entities$_getAddresses$p$0() { + if (!this._addresses$p$0) { + this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses', true); + } + return this._addresses$p$0; + }, + _getEmailAddresses$p$0: function $h_Entities$_getEmailAddresses$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._emailAddresses$p$0) { + this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses', false); + } + return this._emailAddresses$p$0; + }, + _getUrls$p$0: function $h_Entities$_getUrls$p$0() { + if (!this._urls$p$0) { + this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls', false); + } + return this._urls$p$0; + }, + _getPhoneNumbers$p$0: function $h_Entities$_getPhoneNumbers$p$0() { + if (!this._phoneNumbers$p$0) { + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', $h.Entities._createPhoneNumber$p); + } + return this._phoneNumbers$p$0; + }, + _getTaskSuggestions$p$0: function $h_Entities$_getTaskSuggestions$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._taskSuggestions$p$0) { + this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, this._data$p$0, 'TaskSuggestions', $h.Entities._createTaskSuggestion$p, true, 'TaskString'); + } + return this._taskSuggestions$p$0; + }, + _getMeetingSuggestions$p$0: function $h_Entities$_getMeetingSuggestions$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._meetingSuggestions$p$0) { + this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, this._data$p$0, 'MeetingSuggestions', this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString'); + } + return this._meetingSuggestions$p$0; + }, + _getContacts$p$0: function $h_Entities$_getContacts$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._contacts$p$0) { + this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact, this._data$p$0, 'Contacts', $h.Entities._createContact$p, true, 'ContactString'); + } + return this._contacts$p$0; + } +} +$h.Item=function $h_Item(data) { + this.$$d__createCustomProperties$i$0=Function.createDelegate(this, this._createCustomProperties$i$0); + this.$$d__getAttachments$p$0=Function.createDelegate(this, this._getAttachments$p$0); + this.$$d__getItemClass$p$0=Function.createDelegate(this, this._getItemClass$p$0); + this.$$d__getItemId$p$0=Function.createDelegate(this, this._getItemId$p$0); + this.$$d__getDateTimeModified$p$0=Function.createDelegate(this, this._getDateTimeModified$p$0); + this.$$d__getDateTimeCreated$p$0=Function.createDelegate(this, this._getDateTimeCreated$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeCreated', this.$$d__getDateTimeCreated$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeModified', this.$$d__getDateTimeModified$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemId', this.$$d__getItemId$p$0); + var $$t_1=this; + $h.InitialData._defineReadOnlyProperty$i(this, 'itemType', function() { + return $$t_1.getItemType(); + }); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemClass', this.$$d__getItemClass$p$0); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) { + $h.InitialData._defineReadOnlyProperty$i(this, 'attachments', this.$$d__getAttachments$p$0); + } +} +$h.Item.prototype={ + _data$p$0: null, + loadCustomPropertiesAsync: function $h_Item$loadCustomPropertiesAsync(callback, userContext) { + if ($h.ScriptHelpers.isNullOrUndefined(callback)) { + throw Error.argumentNull('callback'); + } + var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0, 'customProperties', callback, userContext); + loadCustomProperties._sendRequest$i$0(3, 'LoadCustomProperties', {}); + }, + _createCustomProperties$i$0: function $h_Item$_createCustomProperties$i$0(data) { + return new $h.CustomProperties(data); + }, + _getItemId$p$0: function $h_Item$_getItemId$p$0() { + return this._data$p$0.get__itemId$i$0(); + }, + _getItemClass$p$0: function $h_Item$_getItemClass$p$0() { + return this._data$p$0.get__itemClass$i$0(); + }, + _getDateTimeCreated$p$0: function $h_Item$_getDateTimeCreated$p$0() { + return this._data$p$0.get__dateTimeCreated$i$0(); + }, + _getDateTimeModified$p$0: function $h_Item$_getDateTimeModified$p$0() { + return this._data$p$0.get__dateTimeModified$i$0(); + }, + _getAttachments$p$0: function $h_Item$_getAttachments$p$0() { + return this._data$p$0.get__attachments$i$0(); + } +} +$h.MeetingRequest=function $h_MeetingRequest(data) { + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2); + this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2); + $h.MeetingRequest.initializeBase(this, [ data ]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2); +} +$h.MeetingRequest.prototype={ + _getStart$p$2: function $h_MeetingRequest$_getStart$p$2() { + return this._data$p$0.get__start$i$0(); + }, + _getEnd$p$2: function $h_MeetingRequest$_getEnd$p$2() { + return this._data$p$0.get__end$i$0(); + }, + _getLocation$p$2: function $h_MeetingRequest$_getLocation$p$2() { + return this._data$p$0.get__location$i$0(); + }, + _getOptionalAttendees$p$2: function $h_MeetingRequest$_getOptionalAttendees$p$2() { + return this._data$p$0.get__cc$i$0(); + }, + _getRequiredAttendees$p$2: function $h_MeetingRequest$_getRequiredAttendees$p$2() { + return this._data$p$0.get__to$i$0(); + } +} +$h.MeetingSuggestion=function $h_MeetingSuggestion(data, dateTimeSent) { + this.$$d__getEndTime$p$0=Function.createDelegate(this, this._getEndTime$p$0); + this.$$d__getStartTime$p$0=Function.createDelegate(this, this._getStartTime$p$0); + this.$$d__getSubject$p$0=Function.createDelegate(this, this._getSubject$p$0); + this.$$d__getLocation$p$0=Function.createDelegate(this, this._getLocation$p$0); + this.$$d__getAttendees$p$0=Function.createDelegate(this, this._getAttendees$p$0); + this.$$d__getMeetingString$p$0=Function.createDelegate(this, this._getMeetingString$p$0); + this._data$p$0=data; + this._dateTimeSent$p$0=dateTimeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingString', this.$$d__getMeetingString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attendees', this.$$d__getAttendees$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStartTime$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEndTime$p$0); +} +$h.MeetingSuggestion.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _attendees$p$0: null, + _getMeetingString$p$0: function $h_MeetingSuggestion$_getMeetingString$p$0() { + return this._data$p$0['MeetingString']; + }, + _getLocation$p$0: function $h_MeetingSuggestion$_getLocation$p$0() { + return this._data$p$0['Location']; + }, + _getSubject$p$0: function $h_MeetingSuggestion$_getSubject$p$0() { + return this._data$p$0['Subject']; + }, + _getStartTime$p$0: function $h_MeetingSuggestion$_getStartTime$p$0() { + var time=this._createDateTimeFromParameter$p$0('StartTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + } + return time; + }, + _getEndTime$p$0: function $h_MeetingSuggestion$_getEndTime$p$0() { + var time=this._createDateTimeFromParameter$p$0('EndTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + } + return time; + }, + _createDateTimeFromParameter$p$0: function $h_MeetingSuggestion$_createDateTimeFromParameter$p$0(keyName) { + var dateTimeString=this._data$p$0[keyName]; + if (!dateTimeString) { + return null; + } + return new Date(dateTimeString); + }, + _getAttendees$p$0: function $h_MeetingSuggestion$_getAttendees$p$0() { + if (!this._attendees$p$0) { + var $$t_1=this; + this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Attendees', function(data) { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data); + }); + } + return this._attendees$p$0; + } +} +$h.MeetingSuggestionTimeDecoder=function $h_MeetingSuggestionTimeDecoder() { +} +$h.MeetingSuggestionTimeDecoder.resolve=function $h_MeetingSuggestionTimeDecoder$resolve(inTime, sentTime) { + if (!sentTime) { + return inTime; + } + try { + var tod; + var outDate; + var extractedDate; + var sentDate=new Date(sentTime.getFullYear(), sentTime.getMonth(), sentTime.getDate(), 0, 0, 0, 0); + var $$t_7, $$t_8, $$t_9; + if (!(($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime, ($$t_7={'val': extractedDate}), ($$t_8={'val': tod}))), extractedDate=$$t_7.val, tod=$$t_8.val, $$t_9)) { + return inTime; + } + else { + if ($h._preciseDate.isInstanceOfType(extractedDate)) { + outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate, extractedDate); + } + else { + if ($h._relativeDate.isInstanceOfType(extractedDate)) { + outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate, extractedDate); + } + else { + outDate=sentDate; + } + } + if (isNaN(outDate.getTime())) { + return sentTime; + } + outDate.setMilliseconds(outDate.getMilliseconds()+tod); + return outDate; + } + } + catch ($$e_6) { + return sentTime; + } +} +$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function $h_MeetingSuggestionTimeDecoder$_isNullOrUndefined$i(value) { + return null===value || value===undefined; +} +$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_resolvePreciseDate$p(sentDate, precise) { + var year=precise._year$i$1; + var month=(!precise._month$i$1) ? sentDate.getMonth() : precise._month$i$1 - 1; + var day=precise._day$i$1; + if (!day) { + return sentDate; + } + var candidate; + if ($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) { + candidate=new Date(sentDate.getFullYear(), month, day); + if (candidate.getTime() < sentDate.getTime()) { + candidate=new Date(sentDate.getFullYear()+1, month, day); + } + } + else { + candidate=new Date((year < 50) ? 2000+year : 1900+year, month, day); + } + if (candidate.getMonth() !==month) { + return sentDate; + } + return candidate; +} +$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_resolveRelativeDate$p(sentDate, relative) { + var date; + switch (relative._unit$i$1) { + case 0: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(date.getDate()+relative._offset$i$1); + return date; + case 5: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate, relative._offset$i$1, relative._tag$i$1); + case 2: + var days=1; + switch (relative._modifier$i$1) { + case 1: + break; + case 2: + days=16; + break; + default: + if (!relative._offset$i$1) { + days=sentDate.getDate(); + } + break; + } + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), days); + date.setMonth(date.getMonth()+relative._offset$i$1); + if (date.getTime() < sentDate.getTime()) { + date.setDate(date.getDate()+sentDate.getDate() - 1); + } + return date; + case 1: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(sentDate.getDate()+(7 * relative._offset$i$1)); + if (relative._modifier$i$1===1 || !relative._modifier$i$1) { + date.setDate(date.getDate()+1 - date.getDay()); + if (date.getTime() < sentDate.getTime()) { + return sentDate; + } + return date; + } + else if (relative._modifier$i$1===2) { + date.setDate(date.getDate()+5 - date.getDay()); + return date; + } + break; + case 4: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate, relative); + case 3: + if (relative._offset$i$1 > 0) { + return new Date(sentDate.getFullYear()+relative._offset$i$1, 0, 1); + } + break; + default: + break; + } + return sentDate; +} +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekDate$p(sentDate, offset, tag) { + if (offset > -5 && offset < 5) { + var dayOfWeek; + var days; + dayOfWeek=((tag+6) % 7)+1; + days=(7 * offset)+(dayOfWeek - sentDate.getDay()); + sentDate.setDate(sentDate.getDate()+days); + return sentDate; + } + else { + var days=(tag - sentDate.getDay()) % 7; + if (days < 0) { + days+=7; + } + sentDate.setDate(sentDate.getDate()+days); + return sentDate; + } +} +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekOfMonthDate$p(sentDate, relative) { + var date; + var firstDay; + var newDate; + date=sentDate; + if (relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) { + return sentDate; + } + var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12; + firstDay=new Date(date.getFullYear(), date.getMonth()+monthOffset, 1); + if (relative._modifier$i$1===1) { + if (relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay() !==0) { + return firstDay; + } + else { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), firstDay.getDate()); + newDate.setDate(newDate.getDate()+((7+(1 - firstDay.getDay())) % 7)); + if (firstDay.getDay() !==6 && firstDay.getDay() !==0 && firstDay.getDay() !==1) { + newDate.setDate(newDate.getDate() - 7); + } + newDate.setDate(newDate.getDate()+(7 * (relative._offset$i$1 - 1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) { + return sentDate; + } + return newDate; + } + } + else { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), $h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(), firstDay.getFullYear())); + var offset=1 - newDate.getDay(); + if (offset > 0) { + offset=offset - 7; + } + newDate.setDate(newDate.getDate()+offset); + newDate.setDate(newDate.getDate()+(7 * (1 - relative._offset$i$1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) { + if (firstDay.getDay() !==6 && firstDay.getDay() !==0) { + return firstDay; + } + else { + return sentDate; + } + } + else { + return newDate; + } + } +} +$h.MeetingSuggestionTimeDecoder._decode$p=function $h_MeetingSuggestionTimeDecoder$_decode$p(inDate, date, time) { + var DateValueMask=32767; + date.val=null; + time.val=0; + if (!inDate) { + return false; + } + time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate); + var inDateAtMidnight=inDate.getTime() - time.val; + var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 86400000; + if (value < 0) { + return false; + } + else if (value >=262144) { + return false; + } + else { + var type=value >> 15; + value=value & DateValueMask; + switch (type) { + case 0: + return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value, date); + case 1: + return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value, date); + default: + return false; + } + } +} +$h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_decodePreciseDate$p(value, date) { + var c_SubTypeMask=7; + var c_MonthMask=15; + var c_DayMask=31; + var c_YearMask=127; + var year=null; + var month=0; + var day=0; + date.val=null; + var subType=(value >> 12) & c_SubTypeMask; + if ((subType & 4)===4) { + year=(value >> 5) & c_YearMask; + if ((subType & 2)===2) { + if ((subType & 1)===1) { + return false; + } + month=(value >> 1) & c_MonthMask; + } + } + else { + if ((subType & 2)===2) { + month=(value >> 8) & c_MonthMask; + } + if ((subType & 1)===1) { + day=(value >> 3) & c_DayMask; + } + } + date.val=new $h._preciseDate(day, month, year); + return true; +} +$h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_decodeRelativeDate$p(value, date) { + var TagMask=15; + var OffsetMask=63; + var UnitMask=7; + var ModifierMask=3; + var tag=value & TagMask; + value >>=4; + var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask, 6); + value >>=6; + var unit=value & UnitMask; + value >>=3; + var modifier=value & ModifierMask; + try { + date.val=new $h._relativeDate(modifier, offset, unit, tag); + return true; + } + catch ($$e_A) { + date.val=null; + return false; + } +} +$h.MeetingSuggestionTimeDecoder._fromComplement$p=function $h_MeetingSuggestionTimeDecoder$_fromComplement$p(value, n) { + var signed=1 << (n - 1); + var mask=(1 << n) - 1; + if ((value & signed)===signed) { + return -((value ^ mask)+1); + } + else { + return value; + } +} +$h.MeetingSuggestionTimeDecoder._daysInMonth$p=function $h_MeetingSuggestionTimeDecoder$_daysInMonth$p(month, year) { + return 32 - new Date(year, month, 32).getDate(); +} +$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function $h_MeetingSuggestionTimeDecoder$_getTimeOfDayInMillisecondsUTC$p(inputTime) { + var timeOfDay=0; + timeOfDay+=inputTime.getUTCHours() * 3600; + timeOfDay+=inputTime.getUTCMinutes() * 60; + timeOfDay+=inputTime.getUTCSeconds(); + timeOfDay *=1000; + timeOfDay+=inputTime.getUTCMilliseconds(); + return timeOfDay; +} +$h._extractedDate=function $h__extractedDate() { +} +$h._preciseDate=function $h__preciseDate(day, month, year) { + $h._preciseDate.initializeBase(this); + if (day < 0 || day > 31) { + throw Error.argumentOutOfRange('day'); + } + if (month < 0 || month > 12) { + throw Error.argumentOutOfRange('month'); + } + this._day$i$1=day; + this._month$i$1=month; + if (!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) { + if (!month && day) { + throw Error.argument('Invalid arguments'); + } + if (year < 0 || year > 2099) { + throw Error.argumentOutOfRange('year'); + } + this._year$i$1=year % 100; + } + else if (!this._month$i$1 && !this._day$i$1) { + throw Error.argument('Invalid datetime'); + } +} +$h._preciseDate.prototype={ + _day$i$1: 0, + _month$i$1: 0, + _year$i$1: null +} +$h._relativeDate=function $h__relativeDate(modifier, offset, unit, tag) { + $h._relativeDate.initializeBase(this); + if (offset < -32 || offset > 31) { + throw Error.argumentOutOfRange('offset'); + } + if (tag < 0 || tag > 15) { + throw Error.argumentOutOfRange('tag'); + } + if (!unit && offset < 0) { + throw Error.argument('unit & offset do not form a valid date'); + } + this._modifier$i$1=modifier; + this._offset$i$1=offset; + this._unit$i$1=unit; + this._tag$i$1=tag; +} +$h._relativeDate.prototype={ + _modifier$i$1: 0, + _offset$i$1: 0, + _unit$i$1: 0, + _tag$i$1: 0 +} +$h.Message=function $h_Message(dataDictionary) { + this.$$d__getConversationId$p$1=Function.createDelegate(this, this._getConversationId$p$1); + this.$$d__getInternetMessageId$p$1=Function.createDelegate(this, this._getInternetMessageId$p$1); + this.$$d__getCc$p$1=Function.createDelegate(this, this._getCc$p$1); + this.$$d__getTo$p$1=Function.createDelegate(this, this._getTo$p$1); + this.$$d__getFrom$p$1=Function.createDelegate(this, this._getFrom$p$1); + this.$$d__getSender$p$1=Function.createDelegate(this, this._getSender$p$1); + this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this, this._getNormalizedSubject$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1); + $h.Message.initializeBase(this, [ dataDictionary ]); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'sender', this.$$d__getSender$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'from', this.$$d__getFrom$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'internetMessageId', this.$$d__getInternetMessageId$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$1); +} +$h.Message.prototype={ + getEntities: function $h_Message$getEntities() { + return this._data$p$0._getEntities$i$0(); + }, + getEntitiesByType: function $h_Message$getEntitiesByType(entityType) { + return this._data$p$0._getEntitiesByType$i$0(entityType); + }, + getFilteredEntitiesByName: function $h_Message$getFilteredEntitiesByName(name) { + return this._data$p$0._getFilteredEntitiesByName$i$0(name); + }, + getRegExMatches: function $h_Message$getRegExMatches() { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0(); + }, + getRegExMatchesByName: function $h_Message$getRegExMatchesByName(name) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name); + }, + displayReplyForm: function $h_Message$displayReplyForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody); + }, + displayReplyAllForm: function $h_Message$displayReplyAllForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody); + }, + getItemType: function $h_Message$getItemType() { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message; + }, + _getSubject$p$1: function $h_Message$_getSubject$p$1() { + return this._data$p$0.get__subject$i$0(); + }, + _getNormalizedSubject$p$1: function $h_Message$_getNormalizedSubject$p$1() { + return this._data$p$0.get__normalizedSubject$i$0(); + }, + _getSender$p$1: function $h_Message$_getSender$p$1() { + return this._data$p$0.get__sender$i$0(); + }, + _getFrom$p$1: function $h_Message$_getFrom$p$1() { + return this._data$p$0.get__from$i$0(); + }, + _getTo$p$1: function $h_Message$_getTo$p$1() { + return this._data$p$0.get__to$i$0(); + }, + _getCc$p$1: function $h_Message$_getCc$p$1() { + return this._data$p$0.get__cc$i$0(); + }, + _getInternetMessageId$p$1: function $h_Message$_getInternetMessageId$p$1() { + return this._data$p$0.get__internetMessageId$i$0(); + }, + _getConversationId$p$1: function $h_Message$_getConversationId$p$1() { + return this._data$p$0.get__conversationId$i$0(); + } +} +$h.PhoneNumber=function $h_PhoneNumber(data) { + this.$$d__getPhoneType$p$0=Function.createDelegate(this, this._getPhoneType$p$0); + this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this, this._getOriginalPhoneString$p$0); + this.$$d__getPhoneString$p$0=Function.createDelegate(this, this._getPhoneString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneString', this.$$d__getPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'originalPhoneString', this.$$d__getOriginalPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'type', this.$$d__getPhoneType$p$0); +} +$h.PhoneNumber.prototype={ + _data$p$0: null, + _getPhoneString$p$0: function $h_PhoneNumber$_getPhoneString$p$0() { + return this._data$p$0['PhoneString']; + }, + _getOriginalPhoneString$p$0: function $h_PhoneNumber$_getOriginalPhoneString$p$0() { + return this._data$p$0['OriginalPhoneString']; + }, + _getPhoneType$p$0: function $h_PhoneNumber$_getPhoneType$p$0() { + return this._data$p$0['Type']; + } +} +$h.TaskSuggestion=function $h_TaskSuggestion(data) { + this.$$d__getAssignees$p$0=Function.createDelegate(this, this._getAssignees$p$0); + this.$$d__getTaskString$p$0=Function.createDelegate(this, this._getTaskString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'taskString', this.$$d__getTaskString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'assignees', this.$$d__getAssignees$p$0); +} +$h.TaskSuggestion.prototype={ + _data$p$0: null, + _assignees$p$0: null, + _getTaskString$p$0: function $h_TaskSuggestion$_getTaskString$p$0() { + return this._data$p$0['TaskString']; + }, + _getAssignees$p$0: function $h_TaskSuggestion$_getAssignees$p$0() { + if (!this._assignees$p$0) { + var $$t_1=this; + this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Assignees', function(data) { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data); + }); + } + return this._assignees$p$0; + } +} +$h.UserProfile=function $h_UserProfile(data) { + this.$$d__getTimeZone$p$0=Function.createDelegate(this, this._getTimeZone$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'timeZone', this.$$d__getTimeZone$p$0); +} +$h.UserProfile.prototype={ + _data$p$0: null, + _getDisplayName$p$0: function $h_UserProfile$_getDisplayName$p$0() { + return this._data$p$0.get__userDisplayName$i$0(); + }, + _getEmailAddress$p$0: function $h_UserProfile$_getEmailAddress$p$0() { + return this._data$p$0.get__userEmailAddress$i$0(); + }, + _getTimeZone$p$0: function $h_UserProfile$_getTimeZone$p$0() { + return this._data$p$0.get__userTimeZone$i$0(); + } +} +$h.RequestState=function() {} +$h.RequestState.prototype={ + unsent: 0, + opened: 1, + headersReceived: 2, + loading: 3, + done: 4 +} +$h.RequestState.registerEnum('$h.RequestState', false); +$h.EwsRequest=function $h_EwsRequest(userContext) { + this.readyState=1; + $h.EwsRequest.initializeBase(this, [ userContext ]); +} +$h.EwsRequest.prototype={ + status: 0, + statusText: null, + onreadystatechange: null, + responseText: null, + get__statusCode$i$1: function $h_EwsRequest$get__statusCode$i$1() { + return this.status; + }, + set__statusCode$i$1: function $h_EwsRequest$set__statusCode$i$1(value) { + this.status=value; + return value; + }, + get__statusDescription$i$1: function $h_EwsRequest$get__statusDescription$i$1() { + return this.statusText; + }, + set__statusDescription$i$1: function $h_EwsRequest$set__statusDescription$i$1(value) { + this.statusText=value; + return value; + }, + get__requestState$i$1: function $h_EwsRequest$get__requestState$i$1() { + return this.readyState; + }, + set__requestState$i$1: function $h_EwsRequest$set__requestState$i$1(value) { + this.readyState=value; + return value; + }, + get__response$i$1: function $h_EwsRequest$get__response$i$1() { + return this.responseText; + }, + set__response$i$1: function $h_EwsRequest$set__response$i$1(value) { + this.responseText=value; + return value; + }, + send: function $h_EwsRequest$send(data) { + this._checkSendConditions$i$1(); + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + this._throwInvalidStateException$i$1(); + } + this._sendRequest$i$0(5, 'EwsRequest', { body: data }); + }, + _callOnReadyStateChangeCallback$i$1: function $h_EwsRequest$_callOnReadyStateChangeCallback$i$1() { + if (!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) { + this.onreadystatechange(); + } + }, + _parseExtraResponseData$i$1: function $h_EwsRequest$_parseExtraResponseData$i$1(response) { + } +} +$h.InitialData=function $h_InitialData(data) { + this._data$p$0=data; +} +$h.InitialData._defineReadOnlyProperty$i=function $h_InitialData$_defineReadOnlyProperty$i(o, methodName, getter) { + var propertyDescriptor={ get: getter, configurable: false }; + Object.defineProperty(o, methodName, propertyDescriptor); +} +$h.InitialData.prototype={ + _toRecipients$p$0: null, + _ccRecipients$p$0: null, + _attachments$p$0: null, + _resources$p$0: null, + _entities$p$0: null, + _data$p$0: null, + get__permissionLevel$i$0: function $h_InitialData$get__permissionLevel$i$0() { + var permissionLevel=this._data$p$0['permissionLevel']; + return (!$h.ScriptHelpers.isUndefined(permissionLevel)) ? permissionLevel : 0; + }, + get__itemId$i$0: function $h_InitialData$get__itemId$i$0() { + return this._data$p$0['id']; + }, + get__itemClass$i$0: function $h_InitialData$get__itemClass$i$0() { + return this._data$p$0['itemClass']; + }, + get__dateTimeCreated$i$0: function $h_InitialData$get__dateTimeCreated$i$0() { + return new Date(this._data$p$0['dateTimeCreated']); + }, + get__dateTimeModified$i$0: function $h_InitialData$get__dateTimeModified$i$0() { + return new Date(this._data$p$0['dateTimeModified']); + }, + get__dateTimeSent$i$0: function $h_InitialData$get__dateTimeSent$i$0() { + return new Date(this._data$p$0['dateTimeSent']); + }, + get__subject$i$0: function $h_InitialData$get__subject$i$0() { + return this._data$p$0['subject']; + }, + get__normalizedSubject$i$0: function $h_InitialData$get__normalizedSubject$i$0() { + return this._data$p$0['normalizedSubject']; + }, + get__internetMessageId$i$0: function $h_InitialData$get__internetMessageId$i$0() { + return this._data$p$0['internetMessageId']; + }, + get__conversationId$i$0: function $h_InitialData$get__conversationId$i$0() { + return this._data$p$0['conversationId']; + }, + get__sender$i$0: function $h_InitialData$get__sender$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + var sender=this._data$p$0['sender']; + return ($h.ScriptHelpers.isNullOrUndefined(sender)) ? null : new $h.EmailAddressDetails(sender); + }, + get__from$i$0: function $h_InitialData$get__from$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + var from=this._data$p$0['from']; + return ($h.ScriptHelpers.isNullOrUndefined(from)) ? null : new $h.EmailAddressDetails(from); + }, + get__to$i$0: function $h_InitialData$get__to$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._toRecipients$p$0) { + this._toRecipients$p$0=this._createEmailAddressDetails$p$0('to'); + } + return this._toRecipients$p$0; + }, + get__cc$i$0: function $h_InitialData$get__cc$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._ccRecipients$p$0) { + this._ccRecipients$p$0=this._createEmailAddressDetails$p$0('cc'); + } + return this._ccRecipients$p$0; + }, + get__attachments$i$0: function $h_InitialData$get__attachments$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._attachments$p$0) { + this._attachments$p$0=this._createAttachmentDetails$p$0(); + } + return this._attachments$p$0; + }, + get__ewsUrl$i$0: function $h_InitialData$get__ewsUrl$i$0() { + return this._data$p$0['ewsUrl']; + }, + get__start$i$0: function $h_InitialData$get__start$i$0() { + return new Date(this._data$p$0['start']); + }, + get__end$i$0: function $h_InitialData$get__end$i$0() { + return new Date(this._data$p$0['end']); + }, + get__location$i$0: function $h_InitialData$get__location$i$0() { + return this._data$p$0['location']; + }, + get__resources$i$0: function $h_InitialData$get__resources$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._resources$p$0) { + this._resources$p$0=this._createEmailAddressDetails$p$0('resources'); + } + return this._resources$p$0; + }, + get__organizer$i$0: function $h_InitialData$get__organizer$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + var organizer=this._data$p$0['organizer']; + return ($h.ScriptHelpers.isNullOrUndefined(organizer)) ? null : new $h.EmailAddressDetails(organizer); + }, + get__userDisplayName$i$0: function $h_InitialData$get__userDisplayName$i$0() { + return this._data$p$0['userDisplayName']; + }, + get__userEmailAddress$i$0: function $h_InitialData$get__userEmailAddress$i$0() { + return this._data$p$0['userEmailAddress']; + }, + get__userTimeZone$i$0: function $h_InitialData$get__userTimeZone$i$0() { + return this._data$p$0['userTimeZone']; + }, + get__timeZoneOffsets$i$0: function $h_InitialData$get__timeZoneOffsets$i$0() { + return this._data$p$0['timeZoneOffsets']; + }, + get__hostVersion$i$0: function $h_InitialData$get__hostVersion$i$0() { + return this._data$p$0['hostVersion']; + }, + get__owaView$i$0: function $h_InitialData$get__owaView$i$0() { + return this._data$p$0['owaView']; + }, + _getEntities$i$0: function $h_InitialData$_getEntities$i$0() { + if (!this._entities$p$0) { + this._entities$p$0=new $h.Entities(this._data$p$0['entities'], this._data$p$0['filteredEntities'], this.get__dateTimeSent$i$0(), this.get__permissionLevel$i$0()); + } + return this._entities$p$0; + }, + _getEntitiesByType$i$0: function $h_InitialData$_getEntitiesByType$i$0(entityType) { + var entites=this._getEntities$i$0(); + return entites._getByType$i$0(entityType); + }, + _getFilteredEntitiesByName$i$0: function $h_InitialData$_getFilteredEntitiesByName$i$0(name) { + var entities=this._getEntities$i$0(); + return entities._getFilteredEntitiesByName$i$0(name); + }, + _getRegExMatches$i$0: function $h_InitialData$_getRegExMatches$i$0() { + if (!this._data$p$0['regExMatches']) { + return null; + } + return this._data$p$0['regExMatches']; + }, + _getRegExMatchesByName$i$0: function $h_InitialData$_getRegExMatchesByName$i$0(regexName) { + var regexMatches=this._getRegExMatches$i$0(); + if (!regexMatches || !regexMatches[regexName]) { + return null; + } + return regexMatches[regexName]; + }, + _createEmailAddressDetails$p$0: function $h_InitialData$_createEmailAddressDetails$p$0(key) { + var to=this._data$p$0[key]; + if ($h.ScriptHelpers.isNullOrUndefined(to)) { + return []; + } + var recipients=[]; + for (var i=0; i < to.length; i++) { + if (!$h.ScriptHelpers.isNullOrUndefined(to[i])) { + recipients[i]=new $h.EmailAddressDetails(to[i]); + } + } + return recipients; + }, + _createAttachmentDetails$p$0: function $h_InitialData$_createAttachmentDetails$p$0() { + var attachments=this._data$p$0['attachments']; + if ($h.ScriptHelpers.isNullOrUndefined(attachments)) { + return []; + } + var attachmentDetails=[]; + for (var i=0; i < attachments.length; i++) { + if (!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) { + attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]); + } + } + return attachmentDetails; + }, + _throwOnRestrictedPermissionLevel$p$0: function $h_InitialData$_throwOnRestrictedPermissionLevel$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this.get__permissionLevel$i$0()); + } +} +$h._loadDictionaryRequest=function $h__loadDictionaryRequest(createResultObject, dictionaryName, callback, userContext) { + $h._loadDictionaryRequest.initializeBase(this, [ userContext ]); + this._createResultObject$p$1=createResultObject; + this._dictionaryName$p$1=dictionaryName; + this._callback$p$1=callback; +} +$h._loadDictionaryRequest.prototype={ + _dictionaryName$p$1: null, + _createResultObject$p$1: null, + _callback$p$1: null, + handleResponse: function $h__loadDictionaryRequest$handleResponse(response) { + if (response['wasSuccessful']) { + var value=response[this._dictionaryName$p$1]; + var responseData=JSON.parse(value); + this.createAsyncResult(this._createResultObject$p$1(responseData), 0, null); + } + else { + this.createAsyncResult(null, 1, response['errorMessage']); + } + this._callback$p$1(this._asyncResult$p$0); + } +} +$h.ProxyRequestBase=function $h_ProxyRequestBase(userContext) { + $h.ProxyRequestBase.initializeBase(this, [ userContext ]); +} +$h.ProxyRequestBase.prototype={ + handleResponse: function $h_ProxyRequestBase$handleResponse(response) { + if (!(response['wasProxySuccessful'])) { + this.set__statusCode$i$1(500); + this.set__statusDescription$i$1('Error'); + var errorMessage=response['errorMessage']; + this.set__response$i$1(errorMessage); + this.createAsyncResult(null, 1, errorMessage); + } + else { + this.set__statusCode$i$1(response['statusCode']); + this.set__statusDescription$i$1(response['statusDescription']); + this.set__response$i$1(response['body']); + this.createAsyncResult(this.get__response$i$1(), 0, null); + } + this._parseExtraResponseData$i$1(response); + this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1(); + }, + _throwInvalidStateException$i$1: function $h_ProxyRequestBase$_throwInvalidStateException$i$1() { + throw Error.create('DOMException', { code: 11, message: 'INVALID_STATE_ERR' }); + }, + _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function $h_ProxyRequestBase$_cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() { + var $$t_0=this; + this._changeReadyState$i$1(2, function() { + $$t_0._changeReadyState$i$1(3, function() { + $$t_0._changeReadyState$i$1(4, null); + }); + }); + }, + _changeReadyState$i$1: function $h_ProxyRequestBase$_changeReadyState$i$1(state, nextStep) { + this.set__requestState$i$1(state); + var $$t_2=this; + window.setTimeout(function() { + try { + $$t_2._callOnReadyStateChangeCallback$i$1(); + } + finally { + if (!$h.ScriptHelpers.isNullOrUndefined(nextStep)) { + nextStep(); + } + } + }, 0); + }, + _checkSendConditions$i$1: function $h_ProxyRequestBase$_checkSendConditions$i$1() { + if (this.get__requestState$i$1() !==1) { + this._throwInvalidStateException$i$1(); + } + if (this._isSent$p$0) { + this._throwInvalidStateException$i$1(); + } + } +} +$h.RequestBase=function $h_RequestBase(userContext) { + this._userContext$p$0=userContext; +} +$h.RequestBase.prototype={ + _isSent$p$0: false, + _asyncResult$p$0: null, + _userContext$p$0: null, + _sendRequest$i$0: function $h_RequestBase$_sendRequest$i$0(dispid, methodName, dataToSend) { + this._isSent$p$0=true; + var $$t_5=this; + OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid, methodName, dataToSend, function(resultCode, response) { + if (resultCode) { + $$t_5.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode)); + } + else { + $$t_5.handleResponse(response); + } + }); + }, + createAsyncResult: function $h_RequestBase$createAsyncResult(value, errorCode, errorDescription) { + this._asyncResult$p$0=OSF.DDA.OutlookAppOm._createAsyncResult$i(value, errorCode, errorDescription, this._userContext$p$0); + } +} +$h._saveDictionaryRequest=function $h__saveDictionaryRequest(callback, userContext) { + $h._saveDictionaryRequest.initializeBase(this, [ userContext ]); + if (!$h.ScriptHelpers.isNullOrUndefined(callback)) { + this._callback$p$1=callback; + } +} +$h._saveDictionaryRequest.prototype={ + _callback$p$1: null, + handleResponse: function $h__saveDictionaryRequest$handleResponse(response) { + if (response['wasSuccessful']) { + this.createAsyncResult(null, 0, null); + } + else { + this.createAsyncResult(null, 1, response['errorMessage']); + } + if (!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) { + this._callback$p$1(this._asyncResult$p$0); + } + } +} +$h.ScriptHelpers=function $h_ScriptHelpers() { +} +$h.ScriptHelpers.isNull=function $h_ScriptHelpers$isNull(value) { + return null===value; +} +$h.ScriptHelpers.isNullOrUndefined=function $h_ScriptHelpers$isNullOrUndefined(value) { + return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value); +} +$h.ScriptHelpers.isUndefined=function $h_ScriptHelpers$isUndefined(value) { + return value===undefined; +} +$h.ScriptHelpers.dictionaryContainsKey=function $h_ScriptHelpers$dictionaryContainsKey(obj, keyName) { + return (Object.isInstanceOfType(obj)) ? keyName in obj : false; +} +OSF.DDA.OutlookAppOm.registerClass('OSF.DDA.OutlookAppOm'); +OSF.DDA.Settings.registerClass('OSF.DDA.Settings'); +$h.Item.registerClass('$h.Item'); +$h.Appointment.registerClass('$h.Appointment', $h.Item); +$h.AttachmentDetails.registerClass('$h.AttachmentDetails'); +$h.Contact.registerClass('$h.Contact'); +$h.CustomProperties.registerClass('$h.CustomProperties'); +$h.Diagnostics.registerClass('$h.Diagnostics'); +$h.EmailAddressDetails.registerClass('$h.EmailAddressDetails'); +$h.Entities.registerClass('$h.Entities'); +$h.Message.registerClass('$h.Message', $h.Item); +$h.MeetingRequest.registerClass('$h.MeetingRequest', $h.Message); +$h.MeetingSuggestion.registerClass('$h.MeetingSuggestion'); +$h.MeetingSuggestionTimeDecoder.registerClass('$h.MeetingSuggestionTimeDecoder'); +$h._extractedDate.registerClass('$h._extractedDate'); +$h._preciseDate.registerClass('$h._preciseDate', $h._extractedDate); +$h._relativeDate.registerClass('$h._relativeDate', $h._extractedDate); +$h.PhoneNumber.registerClass('$h.PhoneNumber'); +$h.TaskSuggestion.registerClass('$h.TaskSuggestion'); +$h.UserProfile.registerClass('$h.UserProfile'); +$h.RequestBase.registerClass('$h.RequestBase'); +$h.ProxyRequestBase.registerClass('$h.ProxyRequestBase', $h.RequestBase); +$h.EwsRequest.registerClass('$h.EwsRequest', $h.ProxyRequestBase); +$h.InitialData.registerClass('$h.InitialData'); +$h._loadDictionaryRequest.registerClass('$h._loadDictionaryRequest', $h.RequestBase); +$h._saveDictionaryRequest.registerClass('$h._saveDictionaryRequest', $h.RequestBase); +$h.ScriptHelpers.registerClass('$h.ScriptHelpers'); +OSF.DDA.OutlookAppOm._maxRecipients$p=100; +OSF.DDA.OutlookAppOm._maxSubjectLength$p=255; +OSF.DDA.OutlookAppOm._maxBodyLength$p=32768; +OSF.DDA.OutlookAppOm._maxLocationLength$p=255; +OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1000000; +OSF.DDA.OutlookAppOm._instance$p=null; +$h.AttachmentDetails._attachmentTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File, Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item ]; +$h.Diagnostics.outlookAppName='Outlook'; +$h.Diagnostics.outlookWebAppName='OutlookWebApp'; +$h.EmailAddressDetails._emptyString$p=''; +$h.EmailAddressDetails._responseTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined ]; +$h.EmailAddressDetails._recipientTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser ]; +$h.Entities._allEntityKeys$p=[ 'Addresses', 'EmailAddresses', 'Urls', 'PhoneNumbers', 'TaskSuggestions', 'MeetingSuggestions', 'Contacts' ]; +$h.MeetingSuggestionTimeDecoder._baseDate$p=new Date('0001-01-01T00:00:00Z'); +$h.ScriptHelpers.emptyString=''; +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +} +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed" +}; +OSF.DDA.RichClientSettingsManager={ + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + window.external.GetContext().GetSettings().Read(keys, values); + if (onReceiving) { + onReceiving(); + } + var serializedSettings={}; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + return serializedSettings; + }, + write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving) { + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + if (onCalling) { + onCalling(); + } + window.external.GetContext().GetSettings().Write(keys, values); + if (onReceiving) { + onReceiving(); + } + } +}; +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + try { + response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name : Strings.OfficeOM.L_InternalError, message : ex }; + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving); + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.write( + hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], + hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], + onCalling, + onReceiving + ); + } + switch (actionId) { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break; + } + return delegateMethods; +} +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], + privateState + ); +} +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() { + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id]=dispatch; + } + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], + partId + ); +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], + handle + ); +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.js new file mode 100644 index 000000000..546342884 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-15.js @@ -0,0 +1,33 @@ +/* Outlook specific API library */ +/* Version: 15.0.4420.1017 Build Time: 03/31/2014 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item"} + +Type.registerNamespace("OSF.DDA");OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d_$1w_0=Function.createDelegate(this,this.$1w_0);this.$$d_$2Z_0=Function.createDelegate(this,this.$2Z_0);this.$$d_$2X_0=Function.createDelegate(this,this.$2X_0);this.$$d_$31_0=Function.createDelegate(this,this.$31_0);this.$$d_$2h_0=Function.createDelegate(this,this.$2h_0);this.$$d_$2e_0=Function.createDelegate(this,this.$2e_0);OSF.DDA.OutlookAppOm.$4=this;this.$L_0=n;this.$18_0=i;var u=this;var r=function(){i&&u.$7_0(1,"GetInitialData",null,u.$$d_$2e_0)};this.$19_0()?r():this.$36_0(r)};OSF.DDA.OutlookAppOm.$9=function(n,t,i,r){var f={};f[OSF.DDA.AsyncResultEnum.Properties.Value]=n;f[OSF.DDA.AsyncResultEnum.Properties.Context]=r;var u=null;if(0!==t){u={};u[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=t;u[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=i}return new OSF.DDA.AsyncResult(f,u)};OSF.DDA.OutlookAppOm.$D=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};OSF.DDA.OutlookAppOm.$C=function(n,t,i){if(ni)throw Error.argumentOutOfRange(r);};OSF.DDA.OutlookAppOm.$17=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm.$H(n,String,r);var u=n;OSF.DDA.OutlookAppOm.$T(u.length,t,i,r)}};OSF.DDA.OutlookAppOm.$21=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:break;case 4:var r=JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm.$e(t.requiredAttendees),OSF.DDA.OutlookAppOm.$e(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm.$e(t.resources),t.subject,t.body];break;case 11:case 10:i=[t.htmlBody];break;default:break}return i};OSF.DDA.OutlookAppOm.$e=function(n){return n?n.join(";"):null};OSF.DDA.OutlookAppOm.$1t=function(n,t){if($h.ScriptHelpers.isNullOrUndefined(n))return null;OSF.DDA.OutlookAppOm.$H(n,Array,t);var r=n;var u=null;var f=!1;OSF.DDA.OutlookAppOm.$T(r.length,0,OSF.DDA.OutlookAppOm.$1i,String.format("{0}.length",t));for(var e=0;eOSF.DDA.OutlookAppOm.$1g)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);OSF.DDA.OutlookAppOm.$C(this.$3_0.get_$8_0(),2,"makeEwsRequestAsync");var r=new $h.EwsRequest(i);var u=this;r.onreadystatechange=function(){4===r.get_$1l_1()&&t(r.$P_0)};r.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$7_0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$7_0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$7_0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this.$3_0&&this.$3_0.get_$13_0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this.$1P_0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this.$g_0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this.$2D_0(n);if(this.$3_0&&this.$3_0.get_$13_0()){var i=this.$1P_0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},getUserIdentityTokenAsync:function(n,t){OSF.DDA.OutlookAppOm.$C(this.$3_0.get_$8_0(),1,"getUserIdentityTokenAsync");this.$1c_0(2,"GetUserIdentityToken",n,t)},getCallbackTokenAsync:function(n,t){OSF.DDA.OutlookAppOm.$C(this.$3_0.get_$8_0(),1,"getCallbackTokenAsync");if(64!==this.$L_0.get_appName())throw Error.notImplemented("The getCallbackTokenAsync is not supported by outlook for now.");this.$1c_0(12,"GetCallbackToken",n,t)},displayMessageForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this.$7_0(8,"DisplayExistingMessageForm",{itemId:n},null)},displayAppointmentForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this.$7_0(9,"DisplayExistingAppointmentForm",{itemId:n},null)},displayNewAppointmentForm:function(n){var u=OSF.DDA.OutlookAppOm.$1t(n.requiredAttendees,"requiredAttendees");var r=OSF.DDA.OutlookAppOm.$1t(n.optionalAttendees,"optionalAttendees");OSF.DDA.OutlookAppOm.$17(n.location,0,OSF.DDA.OutlookAppOm.$1h,"location");OSF.DDA.OutlookAppOm.$17(n.body,0,OSF.DDA.OutlookAppOm.$S,"body");OSF.DDA.OutlookAppOm.$17(n.subject,0,OSF.DDA.OutlookAppOm.$1j,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){OSF.DDA.OutlookAppOm.$H(n.start,Date,"start");var o=n.start;n.start=o.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){OSF.DDA.OutlookAppOm.$H(n.end,Date,"end");var i=n.end;if(i=0&&n.getTime()-u<0)return parseInt(t.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},$19_0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},$36_0:function(n){for(var s=null,l="",a=document.getElementsByTagName("script"),o=a.length-1;o>=0;o--){var i=null;var v=a[o].attributes;if(v){var p=v.getNamedItem("src");p&&(i=p.value);if(i){var y=!1;i=i.toLowerCase();var f=i.indexOf("office_strings.js");if(f<0){f=i.indexOf("office_strings.debug.js");y=!0}if(f>0&&fu+1&&(l=r.substring(0,u+1));break}}}}if(s){var h=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var c=this;var w=function(){if(!c.$19_0()){var n=l+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=c.$1G_0(n);t.onload=e;t.onreadystatechange=e;h.appendChild(t)}};t=this.$1G_0(s);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);h.appendChild(t)}},$1G_0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};OSF.DDA.Settings=function(n){this.$u_0=n};OSF.DDA.Settings.$20=function(n){if(!n)return{};if(OSF.DDA.OutlookAppOm.$4.get_$O_0()===8){var t=n.SettingsKey;if(t)return OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={$u_0:null,$10_0:null,get_$J_0:function(){if(!this.$10_0){this.$10_0=OSF.DDA.Settings.$20(this.$u_0);this.$u_0=null}return this.$10_0},get:function(n){return this.get_$J_0()[n]},set:function(n,t){this.get_$J_0()[n]=t},remove:function(n){delete this.get_$J_0()[n]},saveAsync:function(){for(var n=[],i=0;i0){var t=n.length-1;if(Function.isInstanceOfType(n[t])){r=n[t];t--;t>=0&&(u=n[t].asyncContext)}}OSF.DDA.OutlookAppOm.$4.get_$O_0()===64?this.$3E_0(r,u):this.$3D_0(r,u)},$3D_0:function(n,t){var r=null;try{var f=OSF.DDA.SettingsManager.serializeSettings(this.get_$J_0());var e=JSON.stringify(f);var u={SettingsKey:e};OSF.DDA.RichClientSettingsManager.write(u)}catch(o){r=o}if(n){var i;i=r?OSF.DDA.OutlookAppOm.$9(null,1,r.message,t):OSF.DDA.OutlookAppOm.$9(null,0,null,t);n(i)}},$3E_0:function(n,t){var i=OSF.DDA.SettingsManager.serializeSettings(this.get_$J_0());var r=this;OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(i,r){if(n){var u;if(i)u=OSF.DDA.OutlookAppOm.$9(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,i),t);else{var f=r;u=f.error?OSF.DDA.OutlookAppOm.$9(null,1,f.errorMessage,t):OSF.DDA.OutlookAppOm.$9(null,0,null,t)}n(u)}},[i])}};Type.registerNamespace("$h");$h.Appointment=function(n){this.$$d_$2m_1=Function.createDelegate(this,this.$2m_1);this.$$d_$1W_1=Function.createDelegate(this,this.$1W_1);this.$$d_$q_1=Function.createDelegate(this,this.$q_1);this.$$d_$2t_1=Function.createDelegate(this,this.$2t_1);this.$$d_$1Z_1=Function.createDelegate(this,this.$1Z_1);this.$$d_$1X_1=Function.createDelegate(this,this.$1X_1);this.$$d_$n_1=Function.createDelegate(this,this.$n_1);this.$$d_$1T_1=Function.createDelegate(this,this.$1T_1);this.$$d_$1a_1=Function.createDelegate(this,this.$1a_1);$h.Appointment.initializeBase(this,[n]);$h.InitialData.$1(this,"start",this.$$d_$1a_1);$h.InitialData.$1(this,"end",this.$$d_$1T_1);$h.InitialData.$1(this,"location",this.$$d_$n_1);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1X_1);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_1);$h.InitialData.$1(this,"resources",this.$$d_$2t_1);$h.InitialData.$1(this,"subject",this.$$d_$q_1);$h.InitialData.$1(this,"normalizedSubject",this.$$d_$1W_1);$h.InitialData.$1(this,"organizer",this.$$d_$2m_1)};$h.Appointment.prototype={getEntities:function(){return this.$0_0.$Q_0()},getEntitiesByType:function(n){return this.$0_0.$1U_0(n)},getRegExMatches:function(){OSF.DDA.OutlookAppOm.$C(this.$0_0.get_$8_0(),1,"getRegExMatches");return this.$0_0.$p_0()},getFilteredEntitiesByName:function(n){return this.$0_0.$m_0(n)},getRegExMatchesByName:function(n){OSF.DDA.OutlookAppOm.$C(this.$0_0.get_$8_0(),1,"getRegExMatchesByName");return this.$0_0.$1Y_0(n)},displayReplyForm:function(n){OSF.DDA.OutlookAppOm.$4.$1M_0(n)},displayReplyAllForm:function(n){OSF.DDA.OutlookAppOm.$4.$1L_0(n)},getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},$1a_1:function(){return this.$0_0.get_$1m_0()},$1T_1:function(){return this.$0_0.get_$1N_0()},$n_1:function(){return this.$0_0.get_$1f_0()},$1X_1:function(){return this.$0_0.get_$a_0()},$1Z_1:function(){return this.$0_0.get_$14_0()},$2t_1:function(){return this.$0_0.get_$3C_0()},$q_1:function(){return this.$0_0.get_$1p_0()},$1W_1:function(){return this.$0_0.get_$1k_0()},$2m_1:function(){return this.$0_0.get_$37_0()}};$h.AttachmentDetails=function(n){this.$$d_$2g_0=Function.createDelegate(this,this.$2g_0);this.$$d_$2N_0=Function.createDelegate(this,this.$2N_0);this.$$d_$2v_0=Function.createDelegate(this,this.$2v_0);this.$$d_$2T_0=Function.createDelegate(this,this.$2T_0);this.$$d_$2l_0=Function.createDelegate(this,this.$2l_0);this.$$d_$2d_0=Function.createDelegate(this,this.$2d_0);this.$0_0=n;$h.InitialData.$1(this,"id",this.$$d_$2d_0);$h.InitialData.$1(this,"name",this.$$d_$2l_0);$h.InitialData.$1(this,"contentType",this.$$d_$2T_0);$h.InitialData.$1(this,"size",this.$$d_$2v_0);$h.InitialData.$1(this,"attachmentType",this.$$d_$2N_0);$h.InitialData.$1(this,"isInline",this.$$d_$2g_0)};$h.AttachmentDetails.prototype={$0_0:null,$2d_0:function(){return this.$0_0.id},$2l_0:function(){return this.$0_0.name},$2T_0:function(){return this.$0_0.contentType},$2v_0:function(){return this.$0_0.size},$2N_0:function(){var n=this.$0_0.attachmentType;return n<$h.AttachmentDetails.$Y.length?$h.AttachmentDetails.$Y[n]:Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File},$2g_0:function(){return this.$0_0.isInline}};$h.Contact=function(n){this.$$d_$2S_0=Function.createDelegate(this,this.$2S_0);this.$$d_$k_0=Function.createDelegate(this,this.$k_0);this.$$d_$r_0=Function.createDelegate(this,this.$r_0);this.$$d_$l_0=Function.createDelegate(this,this.$l_0);this.$$d_$o_0=Function.createDelegate(this,this.$o_0);this.$$d_$2P_0=Function.createDelegate(this,this.$2P_0);this.$$d_$2p_0=Function.createDelegate(this,this.$2p_0);this.$0_0=n;$h.InitialData.$1(this,"personName",this.$$d_$2p_0);$h.InitialData.$1(this,"businessName",this.$$d_$2P_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$o_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$l_0);$h.InitialData.$1(this,"urls",this.$$d_$r_0);$h.InitialData.$1(this,"addresses",this.$$d_$k_0);$h.InitialData.$1(this,"contactString",this.$$d_$2S_0)};$h.Contact.prototype={$0_0:null,$G_0:null,$2p_0:function(){return this.$0_0.PersonName},$2P_0:function(){return this.$0_0.BusinessName},$k_0:function(){return $h.Entities.$A(this.$0_0,"Addresses")},$l_0:function(){return $h.Entities.$A(this.$0_0,"EmailAddresses")},$r_0:function(){return $h.Entities.$A(this.$0_0,"Urls")},$o_0:function(){if(!this.$G_0){var n=this;this.$G_0=$h.Entities.$3K($h.PhoneNumber,this.$0_0,"PhoneNumbers",function(n){return new $h.PhoneNumber(n)})}return this.$G_0},$2S_0:function(){return this.$0_0.ContactString}};$h.CustomProperties=function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$0_0=n};$h.CustomProperties.prototype={$0_0:null,get:function(n){var i=this.$0_0[n];if(typeof i=="string"){var t=i;if(t.length>6&&t.startsWith("Date(")&&t.endsWith(")")){var f=t.substring(5,t.length-1);var r=parseInt(f);if(!isNaN(r)){var u=new Date(r);u&&(i=u)}}}return i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")");this.$0_0[n]=t},remove:function(n){delete this.$0_0[n]},saveAsync:function(n,t){var r=2500;if(JSON.stringify(this.$0_0).length>r)throw Error.argument();var i=new $h.SaveDictionaryRequest(n,t);i.$z_0(4,"SaveCustomProperties",{customProperties:this.$0_0})}};$h.Diagnostics=function(n,t){this.$$d_$2o_0=Function.createDelegate(this,this.$2o_0);this.$$d_$2c_0=Function.createDelegate(this,this.$2c_0);this.$$d_$2b_0=Function.createDelegate(this,this.$2b_0);this.$0_0=n;this.$N_0=t;$h.InitialData.$1(this,"hostName",this.$$d_$2b_0);$h.InitialData.$1(this,"hostVersion",this.$$d_$2c_0);64===this.$N_0&&$h.InitialData.$1(this,"OWAView",this.$$d_$2o_0)};$h.Diagnostics.prototype={$0_0:null,$N_0:0,$2b_0:function(){if(8===this.$N_0)return"Outlook";else if(64===this.$N_0)return"OutlookWebApp";return null},$2c_0:function(){return this.$0_0.get_$32_0()},$2o_0:function(){return this.$0_0.get_$38_0()}};$h.EmailAddressDetails=function(n){this.$$d_$2s_0=Function.createDelegate(this,this.$2s_0);this.$$d_$2K_0=Function.createDelegate(this,this.$2K_0);this.$$d_$1R_0=Function.createDelegate(this,this.$1R_0);this.$$d_$1S_0=Function.createDelegate(this,this.$1S_0);this.$0_0=n;$h.InitialData.$1(this,"emailAddress",this.$$d_$1S_0);$h.InitialData.$1(this,"displayName",this.$$d_$1R_0);$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData.$1(this,"appointmentResponse",this.$$d_$2K_0);$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData.$1(this,"recipientType",this.$$d_$2s_0)};$h.EmailAddressDetails.$1D=function(n){var t={};var r=n.Name;var i=n.UserId;t.name=r||$h.EmailAddressDetails.$i;t.address=i||$h.EmailAddressDetails.$i;return new $h.EmailAddressDetails(t)};$h.EmailAddressDetails.prototype={$0_0:null,$1S_0:function(){return this.$0_0.address},$1R_0:function(){return this.$0_0.name},$2K_0:function(){var n=this.$0_0.appointmentResponse;return n<$h.EmailAddressDetails.$y.length?$h.EmailAddressDetails.$y[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},$2s_0:function(){var n=this.$0_0.recipientType;return n<$h.EmailAddressDetails.$v.length?$h.EmailAddressDetails.$v[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}};$h.Entities=function(n,t,i,r){this.$$d_$24_0=Function.createDelegate(this,this.$24_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$$d_$o_0=Function.createDelegate(this,this.$o_0);this.$$d_$r_0=Function.createDelegate(this,this.$r_0);this.$$d_$l_0=Function.createDelegate(this,this.$l_0);this.$$d_$1V_0=Function.createDelegate(this,this.$1V_0);this.$$d_$1b_0=Function.createDelegate(this,this.$1b_0);this.$$d_$k_0=Function.createDelegate(this,this.$k_0);this.$0_0=n||{};this.$1O_0=t||{};this.$K_0=i;$h.InitialData.$1(this,"addresses",this.$$d_$k_0);$h.InitialData.$1(this,"taskSuggestions",this.$$d_$1b_0);$h.InitialData.$1(this,"meetingSuggestions",this.$$d_$1V_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$l_0);$h.InitialData.$1(this,"urls",this.$$d_$r_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$o_0);$h.InitialData.$1(this,"contacts",this.$$d_$1Q_0);this.$M_0=r};$h.Entities.$3K=function(n,t,i,r,u,f){var s=null;var e=t[i];if(!e)return new Array(0);u&&(e=$h.Entities.$3L(Object,e,$h.Entities.$2E,f));s=new Array(e.length);for(var l=0,h=e,a=h.length,o=0;o=0;u--){for(var e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t};$h.Entities.prototype={$K_0:null,$0_0:null,$1O_0:null,$6_0:null,$M_0:0,$11_0:null,$s_0:null,$G_0:null,$d_0:null,$U_0:null,$h_0:null,$16_0:null,$2Q_0:function(n){if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)return this.$1V_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)return this.$1b_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)return this.$k_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)return this.$o_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)return this.$l_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)return this.$r_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)return this.$1Q_0();return null},$m_0:function(n){this.$6_0||(this.$6_0={});if(!$h.ScriptHelpers.dictionaryContainsKey(this.$6_0,n)){for(var r=!1,i=0;i<$h.Entities.$V.length;i++){var u=$h.Entities.$V[i];var t=this.$1O_0[u];if(t&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this.$6_0[n]=$h.Entities.$A(t,n);break;case"Addresses":this.$6_0[n]=$h.Entities.$A(t,n,!0);break;case"PhoneNumbers":this.$6_0[n]=$h.Entities.$3K($h.PhoneNumber,t,n,$h.Entities.$1E,!1,null);break;case"TaskSuggestions":this.$6_0[n]=$h.Entities.$3K($h.TaskSuggestion,t,n,$h.Entities.$1H,!0,"TaskString");break;case"MeetingSuggestions":this.$6_0[n]=$h.Entities.$3K($h.MeetingSuggestion,t,n,this.$$d_$24_0,!0,"MeetingString");break;case"Contacts":this.$6_0[n]=$h.Entities.$3K($h.Contact,t,n,$h.Entities.$1B,!0,"ContactString");break}r=!0;break}}r||(this.$6_0[n]=null)}return this.$6_0[n]},$24_0:function(n){return new $h.MeetingSuggestion(n,this.$K_0)},$k_0:function(){this.$U_0||(this.$U_0=$h.Entities.$A(this.$0_0,"Addresses",!0));return this.$U_0},$l_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$h_0||(this.$h_0=$h.Entities.$A(this.$0_0,"EmailAddresses",!1));return this.$h_0},$r_0:function(){this.$16_0||(this.$16_0=$h.Entities.$A(this.$0_0,"Urls",!1));return this.$16_0},$o_0:function(){this.$G_0||(this.$G_0=$h.Entities.$3K($h.PhoneNumber,this.$0_0,"PhoneNumbers",$h.Entities.$1E));return this.$G_0},$1b_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$11_0||(this.$11_0=$h.Entities.$3K($h.TaskSuggestion,this.$0_0,"TaskSuggestions",$h.Entities.$1H,!0,"TaskString"));return this.$11_0},$1V_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$s_0||(this.$s_0=$h.Entities.$3K($h.MeetingSuggestion,this.$0_0,"MeetingSuggestions",this.$$d_$24_0,!0,"MeetingString"));return this.$s_0},$1Q_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$d_0||(this.$d_0=$h.Entities.$3K($h.Contact,this.$0_0,"Contacts",$h.Entities.$1B,!0,"ContactString"));return this.$d_0}};$h.Item=function(n){this.$$d_$23_0=Function.createDelegate(this,this.$23_0);this.$$d_$2M_0=Function.createDelegate(this,this.$2M_0);this.$$d_$2i_0=Function.createDelegate(this,this.$2i_0);this.$$d_$2j_0=Function.createDelegate(this,this.$2j_0);this.$$d_$2W_0=Function.createDelegate(this,this.$2W_0);this.$$d_$2V_0=Function.createDelegate(this,this.$2V_0);this.$0_0=n;$h.InitialData.$1(this,"dateTimeCreated",this.$$d_$2V_0);$h.InitialData.$1(this,"dateTimeModified",this.$$d_$2W_0);$h.InitialData.$1(this,"itemId",this.$$d_$2j_0);var t=this;$h.InitialData.$1(this,"itemType",function(){return t.getItemType()});$h.InitialData.$1(this,"itemClass",this.$$d_$2i_0);OSF.DDA.OutlookAppOm.$4.get_$O_0()===64&&$h.InitialData.$1(this,"attachments",this.$$d_$2M_0)};$h.Item.prototype={$0_0:null,loadCustomPropertiesAsync:function(n,t){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("callback");var i=new $h.LoadDictionaryRequest(this.$$d_$23_0,"customProperties",n,t);i.$z_0(3,"LoadCustomProperties",{})},$23_0:function(n){return new $h.CustomProperties(n)},$2j_0:function(){return this.$0_0.get_$35_0()},$2i_0:function(){return this.$0_0.get_$34_0()},$2V_0:function(){return this.$0_0.get_$26_0()},$2W_0:function(){return this.$0_0.get_$27_0()},$2M_0:function(){return this.$0_0.get_$1v_0()}};$h.MeetingRequest=function(n){this.$$d_$1Z_2=Function.createDelegate(this,this.$1Z_2);this.$$d_$1X_2=Function.createDelegate(this,this.$1X_2);this.$$d_$n_2=Function.createDelegate(this,this.$n_2);this.$$d_$1T_2=Function.createDelegate(this,this.$1T_2);this.$$d_$1a_2=Function.createDelegate(this,this.$1a_2);$h.MeetingRequest.initializeBase(this,[n]);$h.InitialData.$1(this,"start",this.$$d_$1a_2);$h.InitialData.$1(this,"end",this.$$d_$1T_2);$h.InitialData.$1(this,"location",this.$$d_$n_2);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1X_2);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_2)};$h.MeetingRequest.prototype={$1a_2:function(){return this.$0_0.get_$1m_0()},$1T_2:function(){return this.$0_0.get_$1N_0()},$n_2:function(){return this.$0_0.get_$1f_0()},$1X_2:function(){return this.$0_0.get_$a_0()},$1Z_2:function(){return this.$0_0.get_$14_0()}};$h.MeetingSuggestion=function(n,t){this.$$d_$2Y_0=Function.createDelegate(this,this.$2Y_0);this.$$d_$2w_0=Function.createDelegate(this,this.$2w_0);this.$$d_$q_0=Function.createDelegate(this,this.$q_0);this.$$d_$n_0=Function.createDelegate(this,this.$n_0);this.$$d_$2O_0=Function.createDelegate(this,this.$2O_0);this.$$d_$2k_0=Function.createDelegate(this,this.$2k_0);this.$0_0=n;this.$K_0=t;$h.InitialData.$1(this,"meetingString",this.$$d_$2k_0);$h.InitialData.$1(this,"attendees",this.$$d_$2O_0);$h.InitialData.$1(this,"location",this.$$d_$n_0);$h.InitialData.$1(this,"subject",this.$$d_$q_0);$h.InitialData.$1(this,"start",this.$$d_$2w_0);$h.InitialData.$1(this,"end",this.$$d_$2Y_0)};$h.MeetingSuggestion.prototype={$K_0:null,$0_0:null,$Z_0:null,$2k_0:function(){return this.$0_0.MeetingString},$n_0:function(){return this.$0_0.Location},$q_0:function(){return this.$0_0.Subject},$2w_0:function(){var n=this.$1C_0("StartTime");var t=$h.MeetingSuggestionTimeDecoder.resolve(n,this.$K_0);return t.getTime()!==n.getTime()?OSF.DDA.OutlookAppOm.$4.convertToUtcClientTime(OSF.DDA.OutlookAppOm.$4.$g_0(t)):n},$2Y_0:function(){var n=this.$1C_0("EndTime");var t=$h.MeetingSuggestionTimeDecoder.resolve(n,this.$K_0);return t.getTime()!==n.getTime()?OSF.DDA.OutlookAppOm.$4.convertToUtcClientTime(OSF.DDA.OutlookAppOm.$4.$g_0(t)):n},$1C_0:function(n){var t=this.$0_0[n];return t?new Date(t):null},$2O_0:function(){if(!this.$Z_0){var n=this;this.$Z_0=$h.Entities.$3K($h.EmailAddressDetails,this.$0_0,"Attendees",function(n){return $h.EmailAddressDetails.$1D(n)})}return this.$Z_0}};$h.MeetingSuggestionTimeDecoder=function(){};$h.MeetingSuggestionTimeDecoder.resolve=function(n,t){if(!t)return n;try{var f;var i;var r;var u=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0);var s,o,e;if(e=$h.MeetingSuggestionTimeDecoder.$2A(n,s={val:r},o={val:f}),r=s.val,f=o.val,e){i=$h.PreciseDate.isInstanceOfType(r)?$h.MeetingSuggestionTimeDecoder.$3A(u,r):$h.RelativeDate.isInstanceOfType(r)?$h.MeetingSuggestionTimeDecoder.$3B(u,r):u;if(isNaN(i.getTime()))return t;i.setMilliseconds(i.getMilliseconds()+f);return i}else return n}catch(h){return t}};$h.MeetingSuggestionTimeDecoder.$1d=function(n){return null===n||n===undefined};$h.MeetingSuggestionTimeDecoder.$3A=function(n,t){var r=t.$1u_1;var f=t.$t_1?t.$t_1-1:n.getMonth();var u=t.$1I_1;if(!u)return n;var i;if($h.MeetingSuggestionTimeDecoder.$1d(r)){i=new Date(n.getFullYear(),f,u);i.getTime()0)return new Date(n.getFullYear()+t.$5_1,0,1);break;default:break}return n};$h.MeetingSuggestionTimeDecoder.$2G=function(n,t,i){if(t>-5&&t<5){var u;var f;u=(i+6)%7+1;f=7*t+(u-n.getDay());n.setDate(n.getDate()+f);return n}else{var r=(i-n.getDay())%7;r<0&&(r+=7);n.setDate(n.getDate()+r);return n}};$h.MeetingSuggestionTimeDecoder.$2H=function(n,t){var f;var i;var r;f=n;if(t.$B_1<=0||t.$B_1>12||t.$5_1<=0||t.$5_1>5)return n;var e=(12+t.$B_1-f.getMonth()-1)%12;i=new Date(f.getFullYear(),f.getMonth()+e,1);if(t.$F_1===1)if(t.$5_1===1&&i.getDay()!==6&&i.getDay()!==0)return i;else{r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()+(8-i.getDay())%7);i.getDay()!==6&&i.getDay()!==0&&i.getDay()!==1&&r.setDate(r.getDate()-7);r.setDate(r.getDate()+7*(t.$5_1-1));return r.getMonth()+1!==t.$B_1?n:r}else{r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder.$29(i.getMonth(),i.getFullYear()));var u=1-r.getDay();u>0&&(u=u-7);r.setDate(r.getDate()+u);r.setDate(r.getDate()+7*(1-t.$5_1));return r.getMonth()+1!==t.$B_1?i.getDay()!==6&&i.getDay()!==0?i:n:r}};$h.MeetingSuggestionTimeDecoder.$2A=function(n,t,i){var f=32767;t.val=null;i.val=0;if(!n)return!1;i.val=$h.MeetingSuggestionTimeDecoder.$2y(n);var e=n.getTime()-i.val;var r=(e-$h.MeetingSuggestionTimeDecoder.$1A.getTime())/864e5;if(r<0)return!1;else if(r>=262144)return!1;else{var u=r>>15;r=r&f;switch(u){case 0:return $h.MeetingSuggestionTimeDecoder.$2B(r,t);case 1:return $h.MeetingSuggestionTimeDecoder.$2C(r,t);default:return!1}}};$h.MeetingSuggestionTimeDecoder.$2B=function(n,t){var h=7;var e=15;var o=31;var s=127;var u=null;var r=0;var f=0;t.val=null;var i=n>>12&h;if((i&4)==4){u=n>>5&s;if((i&2)==2){if((i&1)==1)return!1;r=n>>1&e}}else{(i&2)==2&&(r=n>>8&e);(i&1)==1&&(f=n>>3&o)}t.val=new $h.PreciseDate(f,r,u);return!0};$h.MeetingSuggestionTimeDecoder.$2C=function(n,t){var o=15;var e=63;var h=7;var s=3;var r=n&o;n>>=4;var i=$h.MeetingSuggestionTimeDecoder.$2J(n&e,6);n>>=6;var f=n&h;n>>=3;var u=n&s;try{t.val=new $h.RelativeDate(u,i,f,r);return!0}catch(c){t.val=null;return!1}};$h.MeetingSuggestionTimeDecoder.$2J=function(n,t){var i=1< 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage=_getSessionStorage(); + if(!skipSessionStorage && osfSessionStorage) + { + var sessionKeyStart=window.name.indexOf(_xdmSessionKeyPrefix); + if(sessionKeyStart > -1) + { + var sessionKeyEnd=window.name.indexOf(";",sessionKeyStart); + if(sessionKeyEnd==-1) + sessionKeyEnd=window.name.length; + var sessionKey=window.name.substring(sessionKeyStart,sessionKeyEnd); + if(xdmInfoValue) + osfSessionStorage.setItem(sessionKey,xdmInfoValue); + else + xdmInfoValue=osfSessionStorage.getItem(sessionKey) + } + } + return xdmInfoValue + }, + getConversationId: function OSF_OUtil$getConversationId() + { + var searchString=window.location.search; + var conversationId=null; + if(searchString) + { + var index=searchString.indexOf("&"); + conversationId=index > 0 ? searchString.substring(1,index) : searchString.substr(1); + if(conversationId && conversationId.charAt(conversationId.length - 1)==="=") + { + conversationId=conversationId.substring(0,conversationId.length - 1); + if(conversationId) + conversationId=decodeURIComponent(conversationId) + } + } + return conversationId + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) + { + var items=strInfo.split("$"); + if(typeof items[1]=="undefined") + items=strInfo.split("|"); + return items + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() + { + var conversationUrl=""; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(true); + if(xdmInfoValue) + { + var items=OSF.OUtil.getInfoItems(xdmInfoValue); + if(items !=undefined && items.length >=3) + conversationUrl=items[2] + } + return conversationUrl + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) + { + var e=Function._validateParams(arguments,[{ + name: "params", + type: Object, + mayBeNull: false + },{ + name: "expectedProperties", + type: Object, + mayBeNull: false + },{ + name: "callback", + type: Function, + mayBeNull: true + }]); + if(e) + throw e; + for(var p in expectedProperties) + { + e=Function._validateParameter(params[p],expectedProperties[p],p); + if(e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) + { + if(window.msWriteProfilerMark) + { + window.msWriteProfilerMark(text); + if(typeof Sys !=="undefined" && Sys && Sys.Debug) + Sys.Debug.trace(text) + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) + { + if(typeof Sys !=="undefined" && Sys && Sys.Debug) + Sys.Debug.trace(text) + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) + { + descriptor=descriptor || {}; + for(var nd in attributes) + { + var attribute=attributes[nd]; + if(descriptor[attribute]==undefined) + descriptor[attribute]=true + } + Object.defineProperty(obj,prop,descriptor); + return obj + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) + { + descriptors=descriptors || {}; + for(var prop in descriptors) + OSF.OUtil.defineNondefaultProperty(obj,prop,descriptors[prop],attributes); + return obj + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) + { + return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["enumerable"]) + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) + { + return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["enumerable"]) + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) + { + return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["writable","enumerable","configurable"]) + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) + { + return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["writable","enumerable","configurable"]) + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) + { + descriptor=descriptor || {}; + var props=Object.getOwnPropertyNames(obj); + var propsLength=props.length; + for(var i=0; i < propsLength; i++) + { + var prop=props[i]; + var desc=Object.getOwnPropertyDescriptor(obj,prop); + if(!desc.get && !desc.set) + desc.writable=descriptor.writable || false; + desc.configurable=descriptor.configurable || false; + desc.enumerable=descriptor.enumerable || true; + Object.defineProperty(obj,prop,desc) + } + return obj + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) + { + var ret=[]; + if(list) + for(var item in list) + ret.push(mapFunction(list[item])); + return ret + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) + { + for(var item in list) + if(key==item) + return true; + return false + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) + { + for(var item in list) + if(value==list[item]) + return true; + return false + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) + { + var add=list.push ? function(key, value) + { + list.push(value) + } : function(key, value) + { + list[key]=value + }; + for(var key in addenda) + add(key,addenda[key]) + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) + { + for(var key1 in oldList) + delete oldList[key1]; + for(var key2 in newList) + oldList[key2]=newList[key2] + }, + isArray: function OSF_OUtil$isArray(obj) + { + return Object.prototype.toString.apply(obj)==="[object Array]" + }, + isFunction: function OSF_OUtil$isFunction(obj) + { + return Object.prototype.toString.apply(obj)==="[object Function]" + }, + isDate: function OSF_OUtil$isDate(obj) + { + return Object.prototype.toString.apply(obj)==="[object Date]" + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) + { + if(element.addEventListener) + element.addEventListener(eventName,listener,false); + else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.attachEvent) + element.attachEvent("on"+eventName,listener); + else + element["on"+eventName]=listener + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) + { + if(element.removeEventListener) + element.removeEventListener(eventName,listener,false); + else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.detachEvent) + element.detachEvent("on"+eventName,listener); + else + element["on"+eventName]=null + }, + encodeBase64: function OSF_Outil$encodeBase64(input) + { + if(!input) + return input; + var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/="; + var output=[]; + var temp=[]; + var index=0; + var c1, + c2, + c3, + a, + b, + c; + var i; + var length=input.length; + do + { + c1=input.charCodeAt(index++); + c2=input.charCodeAt(index++); + c3=input.charCodeAt(index++); + i=0; + a=c1 & 255; + b=c1 >> 8; + c=c2 & 255; + temp[i++]=a >> 2; + temp[i++]=(a & 3) << 4 | b >> 4; + temp[i++]=(b & 15) << 2 | c >> 6; + temp[i++]=c & 63; + if(!isNaN(c2)) + { + a=c2 >> 8; + b=c3 & 255; + c=c3 >> 8; + temp[i++]=a >> 2; + temp[i++]=(a & 3) << 4 | b >> 4; + temp[i++]=(b & 15) << 2 | c >> 6; + temp[i++]=c & 63 + } + if(isNaN(c2)) + temp[i - 1]=64; + else if(isNaN(c3)) + { + temp[i - 2]=64; + temp[i - 1]=64 + } + for(var t=0; t < i; t++) + output.push(codex.charAt(temp[t])) + } while(index < length); + return output.join("") + }, + getSessionStorage: function OSF_Outil$getSessionStorage() + { + return _getSessionStorage() + }, + getLocalStorage: function OSF_Outil$getLocalStorage() + { + if(!_safeLocalStorage) + { + try + { + var localStorage=window.localStorage + } + catch(ex) + { + localStorage=null + } + _safeLocalStorage=new OfficeExt.SafeStorage(localStorage) + } + return _safeLocalStorage + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) + { + var hex="#"+(Number(val)+16777216).toString(16).slice(-6); + return hex + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) + { + element.onclick=function(e) + { + handler() + }; + element.ontouchend=function(e) + { + handler(); + e.preventDefault() + } + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) + { + var e=Function._validateParams(arguments,[{ + name: "queryString", + type: String, + mayBeNull: false + },{ + name: "paramName", + type: String, + mayBeNull: false + }]); + if(e) + { + Sys.Debug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return"" + } + var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)","i"); + if(!queryExp.test(queryString)) + { + Sys.Debug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return"" + } + return queryExp.exec(queryString)[1] + }, + isiOS: function OSF_Outil$isiOS() + { + return window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) + { + var copyObj=sourceObj.constructor(); + for(var property in sourceObj) + if(sourceObj.hasOwnProperty(property)) + copyObj[property]=sourceObj[property]; + return copyObj + } + } +}(); +OSF.OUtil.Guid=function() +{ + var hexCode=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; + return{generateNewGuid: function OSF_Outil_Guid$generateNewGuid() + { + var result=""; + var tick=(new Date).getTime(); + var index=0; + for(; index < 32 && tick > 0; index++) + { + if(index==8 || index==12 || index==16 || index==20) + result+="-"; + result+=hexCode[tick % 16]; + tick=Math.floor(tick / 16) + } + for(; index < 32; index++) + { + if(index==8 || index==12 || index==16 || index==20) + result+="-"; + result+=hexCode[Math.floor(Math.random() * 16)] + } + return result + }} +}(); +window.OSF=OSF; +OSF.OUtil.setNamespace("OSF",window); +OSF.InternalPerfMarker={ + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker={ + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; +OSF.AgaveHostAction={ + Select: 0, + UnSelect: 1, + CancelDialog: 2, + InsertAgave: 3, + CtrlF6In: 4, + CtrlF6Exit: 5, + CtrlF6ExitShift: 6, + SelectWithError: 7 +}; +OSF.SharedConstants={NotificationConversationIdSuffix: "_ntf"}; +OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId) +{ + this._id=id; + this._appName=appName; + this._appVersion=appVersion; + this._appUILocale=appUILocale; + this._dataLocale=dataLocale; + this._docUrl=docUrl; + this._clientMode=clientMode; + this._settings=settings; + this._reason=reason; + this._osfControlType=osfControlType; + this._eToken=eToken; + this._correlationId=correlationId; + this._appInstanceId=appInstanceId; + this.get_id=function get_id() + { + return this._id + }; + this.get_appName=function get_appName() + { + return this._appName + }; + this.get_appVersion=function get_appVersion() + { + return this._appVersion + }; + this.get_appUILocale=function get_appUILocale() + { + return this._appUILocale + }; + this.get_dataLocale=function get_dataLocale() + { + return this._dataLocale + }; + this.get_docUrl=function get_docUrl() + { + return this._docUrl + }; + this.get_clientMode=function get_clientMode() + { + return this._clientMode + }; + this.get_bindings=function get_bindings() + { + return this._bindings + }; + this.get_settings=function get_settings() + { + return this._settings + }; + this.get_reason=function get_reason() + { + return this._reason + }; + this.get_osfControlType=function get_osfControlType() + { + return this._osfControlType + }; + this.get_eToken=function get_eToken() + { + return this._eToken + }; + this.get_correlationId=function get_correlationId() + { + return this._correlationId + }; + this.get_appInstanceId=function get_appInstanceId() + { + return this._appInstanceId + } +}; +OSF.AppName={ + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768 +}; +OSF.OsfControlType={ + DocumentLevel: 0, + ContainerLevel: 1 +}; +OSF.ClientMode={ + ReadOnly: 0, + ReadWrite: 1 +}; +OSF.OUtil.setNamespace("Microsoft",window); +OSF.OUtil.setNamespace("Office",Microsoft); +OSF.OUtil.setNamespace("Client",Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension",Microsoft.Office); +Microsoft.Office.WebExtension.InitializationReason={ + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; +Microsoft.Office.WebExtension.ValueFormat={ + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType={All: "all"}; +Microsoft.Office.WebExtension.Parameters={ + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA",OSF); +OSF.DDA.DocumentMode={ + ReadOnly: 1, + ReadWrite: 0 +}; +OSF.DDA.PropertyDescriptors={AsyncResultStatus: "AsyncResultStatus"}; +OSF.DDA.EventDescriptors={}; +OSF.DDA.ListDescriptors={}; +OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) +{ + if(eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) + return bindingId+"_"+eventType; + else + return eventType +}; +OSF.DDA.MethodDispId={ + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId={ + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager=function() +{ + var _errorMappings={}; + return{ + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) + { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError] + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) + { + _errorMappings[errorCode]=errorNameMessage + }, + errorCodes: { + ooeSuccess: 0, + ooeCoercionTypeNotSupported: 1e3, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2e3, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3e3, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4e3, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5e3, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeCustomXmlNodeNotFound: 6e3, + ooeCustomXmlError: 6100, + ooeNoCapability: 7e3, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8e3, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11e3, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) + { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ + name: stringNS.L_InvalidCoercion, + message: stringNS.L_CoercionTypeNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ + name: stringNS.L_DataReadError, + message: stringNS.L_GetSelectionNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ + name: stringNS.L_InvalidCoercion, + message: stringNS.L_CoercionTypeNotMatchBinding + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetRowColumnCounts + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ + name: stringNS.L_DataReadError, + message: stringNS.L_SelectionNotSupportCoercionType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetStartRowColumn + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ + name: stringNS.L_DataReadError, + message: stringNS.L_NonUniformPartialGetNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ + name: stringNS.L_DataReadError, + message: stringNS.L_GetDataIsTooLarge + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ + name: stringNS.L_DataReadError, + message: stringNS.L_FileTypeNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ + name: stringNS.L_DataReadError, + message: stringNS.L_GetDataParametersConflict + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetColumns + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetRows + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidReadForBlankRow + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_UnsupportedDataObject + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_CannotWriteToSelection + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_DataNotMatchSelection + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_OverwriteWorksheetData + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_DataNotMatchBindingSize + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_InvalidSetStartRowColumn + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ + name: stringNS.L_InvalidFormat, + message: stringNS.L_InvalidDataFormat + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ + name: stringNS.L_InvalidDataObject, + message: stringNS.L_DataNotMatchCoercionType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ + name: stringNS.L_InvalidDataObject, + message: stringNS.L_DataNotMatchBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_SetDataIsTooLarge + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_NonUniformPartialSetNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_InvalidSetColumns + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_InvalidSetRows + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_SetDataParametersConflict + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_SelectionCannotBound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ + name: stringNS.L_InvalidBindingError, + message: stringNS.L_BindingNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_BindingToMultipleSelection + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_InvalidSelectionForBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ + name: stringNS.L_InvalidBindingOperation, + message: stringNS.L_OperationNotSupportedOnThisBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_NamedItemNotFound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_MultipleNamedItemFound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_InvalidNamedItemForBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ + name: stringNS.L_InvalidBinding, + message: stringNS.L_UnknownBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ + name: stringNS.L_InvalidBindingOperation, + message: stringNS.L_OperationNotSupportedOnMatrixData + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ + name: stringNS.L_InvalidBinding, + message: stringNS.L_InvalidColumnsForBinding + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ + name: stringNS.L_ReadSettingsError, + message: stringNS.L_SettingNameNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ + name: stringNS.L_SaveSettingsError, + message: stringNS.L_SettingsCannotSave + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ + name: stringNS.L_SettingsStaleError, + message: stringNS.L_SettingsAreStale + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ + name: stringNS.L_HostError, + message: stringNS.L_OperationNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ + name: stringNS.L_InternalError, + message: stringNS.L_InternalErrorDescription + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ + name: stringNS.L_PermissionDenied, + message: stringNS.L_DocumentReadOnly + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ + name: stringNS.L_EventRegistrationError, + message: stringNS.L_EventHandlerNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ + name: stringNS.L_InvalidAPICall, + message: stringNS.L_InvalidApiCallInContext + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ + name: stringNS.L_ShuttingDown, + message: stringNS.L_ShuttingDown + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ + name: stringNS.L_UnsupportedEnumeration, + message: stringNS.L_UnsupportedEnumerationMessage + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ + name: stringNS.L_IndexOutOfRange, + message: stringNS.L_IndexOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ + name: stringNS.L_APINotSupported, + message: stringNS.L_BrowserAPINotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ + name: stringNS.L_APICallFailed, + message: stringNS.L_RequestTimeout + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ + name: stringNS.L_APICallFailed, + message: stringNS.L_TooManyIncompleteRequests + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ + name: stringNS.L_APICallFailed, + message: stringNS.L_RequestTokenUnavailable + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ + name: stringNS.L_InvalidNode, + message: stringNS.L_CustomXmlNodeNotFound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ + name: stringNS.L_CustomXmlError, + message: stringNS.L_CustomXmlError + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ + name: stringNS.L_PermissionDenied, + message: stringNS.L_NoCapability + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ + name: stringNS.L_CannotNavigateTo, + message: stringNS.L_CannotNavigateTo + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ + name: stringNS.L_SpecifiedIdNotExist, + message: stringNS.L_SpecifiedIdNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ + name: stringNS.L_NavOutOfBound, + message: stringNS.L_NavOutOfBound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ + name: stringNS.L_DataWriteReminder, + message: stringNS.L_CellDataAmountBeyondLimits + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ + name: stringNS.L_MissingParameter, + message: stringNS.L_ElementMissing + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ + name: stringNS.L_PermissionDenied, + message: stringNS.L_NoCapability + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_InvalidCellsValue + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_InvalidTableOptionValue + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_InvalidFormatValue + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ + name: stringNS.L_OutOfRange, + message: stringNS.L_RowIndexOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ + name: stringNS.L_OutOfRange, + message: stringNS.L_ColIndexOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ + name: stringNS.L_OutOfRange, + message: stringNS.L_FormatValueOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ + name: stringNS.L_FormattingReminder, + message: stringNS.L_CellFormatAmountBeyondLimits + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ + name: stringNS.L_MemoryLimit, + message: stringNS.L_CloseFileBeforeRetrieve + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ + name: stringNS.L_NetworkProblem, + message: stringNS.L_NetworkProblemRetrieveFile + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_SliceSizeNotSupported + } + } + } +}(); +Microsoft.Office.WebExtension.ApplicationMode={ + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; +Microsoft.Office.WebExtension.DocumentMode={ + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; +OSF.NamespaceManager=function OSF_NamespaceManager() +{ + var _userOffice; + var _useShortcut=false; + return{ + enableShortcut: function OSF_NamespaceManager$enableShortcut() + { + if(!_useShortcut) + { + if(window.Office) + _userOffice=window.Office; + else + OSF.OUtil.setNamespace("Office",window); + window.Office=Microsoft.Office.WebExtension; + _useShortcut=true + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() + { + if(_useShortcut) + { + if(_userOffice) + window.Office=_userOffice; + else + OSF.OUtil.unsetNamespace("Office",window); + _useShortcut=false + } + } + } +}(); +OSF.NamespaceManager.enableShortcut(); +Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) +{ + if(useShortcut) + OSF.NamespaceManager.enableShortcut(); + else + OSF.NamespaceManager.disableShortcut() +}; +Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) +{ + var promise; + if(str && typeof str=="string") + { + var index=str.indexOf("#"); + if(index !=-1) + { + var op=str.substring(0,index); + var target=str.substring(index+1); + switch(op) + { + case"binding": + case"bindings": + if(target) + promise=new OSF.DDA.BindingPromise(target); + break + } + } + } + if(!promise) + { + if(errorCallback) + { + var callbackType=typeof errorCallback; + if(callbackType=="function") + { + var callArgs={}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback; + OSF.DDA.issueAsyncResult(callArgs,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)) + } + else + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,callbackType); + } + } + else + { + promise.onFail=errorCallback; + return promise + } +}; +OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + contentLanguage: {value: officeAppContext.get_dataLocale()}, + displayLanguage: {value: officeAppContext.get_appUILocale()} + }); + if(document) + OSF.OUtil.defineEnumerableProperty(this,"document",{value: document}); + if(license) + OSF.OUtil.defineEnumerableProperty(this,"license",{value: license}); + if(appOM) + { + var displayName=appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this,displayName,{value: appOM}) + } + if(getOfficeTheme) + OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get: function() + { + return getOfficeTheme() + }}) +}; +OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) +{ + OSF.DDA.OutlookContext.uber.constructor.call(this,appContext,null,license,appOM,getOfficeTheme); + if(settings) + OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value: settings}) +}; +OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context); +OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady){}; +OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) +{ + var mode; + switch(officeAppContext.get_clientMode()) + { + case OSF.ClientMode.ReadOnly: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break + } + if(settings) + OSF.OUtil.defineEnumerableProperty(this,"settings",{value: settings}); + OSF.OUtil.defineMutableProperties(this,{ + mode: {value: mode}, + url: {value: officeAppContext.get_docUrl()} + }) +}; +OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) +{ + OSF.DDA.JsomDocument.uber.constructor.call(this,officeAppContext,settings); + if(bindingFacade) + OSF.OUtil.defineEnumerableProperty(this,"bindings",{get: function OSF_DDA_Document$GetBindings() + { + return bindingFacade + }}); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetSelectedDataAsync,am.SetSelectedDataAsync]); + OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])) +}; +OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document); +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get: function Microsoft_Office_WebExtension$GetContext() + { + var context; + if(OSF && OSF._OfficeAppFactory) + context=OSF._OfficeAppFactory.getContext(); + return context + }}); +OSF.DDA.License=function OSF_DDA_License(eToken) +{ + OSF.OUtil.defineEnumerableProperty(this,"value",{value: eToken}) +}; +OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties={ + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus={ + Succeeded: "succeeded", + Failed: "failed" +}; +OSF.DDA.AsyncResultEnum.ErrorCode={ + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties={ + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames={}; +OSF.DDA.AsyncMethodNames.addNames=function(methodNames) +{ + for(var entry in methodNames) + { + var am={}; + OSF.OUtil.defineEnumerableProperties(am,{ + id: {value: entry}, + displayName: {value: methodNames[entry]} + }); + OSF.DDA.AsyncMethodNames[entry]=am + } +}; +OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) +{ + var requiredCount=requiredParameters.length; + var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function() + { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,displayName) + }); + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) + { + for(var name in params) + { + var param=params[name]; + var arg=args[name]; + if(param["enum"]) + switch(typeof arg) + { + case"string": + if(OSF.OUtil.listContainsValue(param["enum"],arg)) + break; + case"undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + if(param["types"]) + if(!OSF.OUtil.listContainsValue(param["types"],typeof arg)) + throw getInvalidParameterString(); + } + } + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) + { + if(userArgs.length < requiredCount) + throw Error.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + var requiredArgs=[]; + var index; + for(index=0; index < requiredCount; index++) + requiredArgs.push(userArgs[index]); + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters,requiredArgs); + var ret={}; + for(index=0; index < requiredCount; index++) + { + var param=requiredParameters[index]; + var arg=requiredArgs[index]; + if(param.verify) + { + var isValid=param.verify(arg,caller,stateInfo); + if(!isValid) + throw getInvalidParameterString(); + } + ret[param.name]=arg + } + return ret + } + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) + { + if(userArgs.length > requiredCount+2) + throw Error.parameterCount(Strings.OfficeOM.L_TooManyArguments); + var options, + parameterCallback; + for(var i=userArgs.length - 1; i >=requiredCount; i--) + { + var argument=userArgs[i]; + switch(typeof argument) + { + case"object": + if(options) + throw Error.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + else + options=argument; + break; + case"function": + if(parameterCallback) + throw Error.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + else + parameterCallback=argument; + break; + default: + throw Error.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break + } + } + options=options || {}; + for(var optionName in supportedOptions) + if(!OSF.OUtil.listContainsKey(options,optionName)) + { + var value=undefined; + var option=supportedOptions[optionName]; + if(option.calculate && requiredArgs) + value=option.calculate(requiredArgs,caller,stateInfo); + if(!value && option.defaultValue !==undefined) + value=option.defaultValue; + options[optionName]=value + } + if(parameterCallback) + if(options[Microsoft.Office.WebExtension.Parameters.Callback]) + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + else + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions,options); + return options + } + this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) + { + var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs,caller,stateInfo); + var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs,required,caller,stateInfo); + var callArgs={}; + for(var r in required) + callArgs[r]=required[r]; + for(var o in options) + callArgs[o]=options[o]; + for(var s in privateStateCallbacks) + callArgs[s]=privateStateCallbacks[s](caller,stateInfo); + if(checkCallArgs) + callArgs=checkCallArgs(callArgs,caller,stateInfo); + return callArgs + }; + this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) + { + var payload; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + if(onSucceeded) + payload=onSucceeded(response,caller,callArgs); + else + payload=response; + else if(onFailed) + payload=onFailed(status,response); + else + payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + return payload + }; + this.getCallArgs=function(suppliedArgs) + { + var options, + parameterCallback; + for(var i=suppliedArgs.length - 1; i >=requiredCount; i--) + { + var argument=suppliedArgs[i]; + switch(typeof argument) + { + case"object": + options=argument; + break; + case"function": + parameterCallback=argument; + break + } + } + options=options || {}; + if(parameterCallback) + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + return options + } +}; +OSF.DDA.AsyncMethodCallFactory=function() +{ + function createObject(properties) + { + var obj=null; + if(properties) + { + obj={}; + var len=properties.length; + for(var i=0; i < len; i++) + obj[properties[i].name]=properties[i].value + } + return obj + } + return{manufacture: function(params) + { + var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [],supportedOptions,privateStateCallbacks,params.onSucceeded,params.onFailed,params.checkCallArgs,params.method.displayName) + }} +}(); +OSF.DDA.AsyncMethodCalls={}; +OSF.DDA.AsyncMethodCalls.define=function(callDefinition) +{ + OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition) +}; +OSF.DDA.Error=function OSF_DDA_Error(name, message, code) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + name: {value: name}, + message: {value: message}, + code: {value: code} + }) +}; +OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + value: {value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]}, + status: {value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded} + }); + if(initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) + OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]}); + if(errorArgs) + OSF.OUtil.defineEnumerableProperty(this,"error",{value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])}) +}; +OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) +{ + var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if(callback) + { + var asyncInitArgs={}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload; + else + { + errorArgs={}; + payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs,errorArgs)) + } +}; +OSF.DDA.ListType=function() +{ + var listTypes={}; + return{ + setListType: function OSF_DDA_ListType$AddListType(t, prop) + { + listTypes[t]=prop + }, + isListType: function OSF_DDA_ListType$IsListType(t) + { + return OSF.OUtil.listContainsKey(listTypes,t) + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) + { + return listTypes[t] + } + } +}(); +OSF.DDA.HostParameterMap=function(specialProcessor, mappings) +{ + var toHostMap="toHost"; + var fromHostMap="fromHost"; + var self="self"; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={ + toHost: function(data) + { + if(data !=null && data.rows !==undefined) + { + var tableData={}; + tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers; + data=tableData + } + return data + }, + fromHost: function(args) + { + return args + } + }; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + function mapValues(preimageSet, mapping) + { + var ret=preimageSet ? {} : undefined; + for(var entry in preimageSet) + { + var preimage=preimageSet[entry]; + var image; + if(OSF.DDA.ListType.isListType(entry)) + { + image=[]; + for(var subEntry in preimage) + image.push(mapValues(preimage[subEntry],mapping)) + } + else if(OSF.OUtil.listContainsKey(dynamicTypes,entry)) + image=dynamicTypes[entry][mapping](preimage); + else if(mapping==fromHostMap && specialProcessor.preserveNesting(entry)) + image=mapValues(preimage,mapping); + else + { + var maps=mappings[entry]; + if(maps) + { + var map=maps[mapping]; + if(map) + { + image=map[preimage]; + if(image===undefined) + image=preimage + } + } + else + image=preimage + } + ret[entry]=image + } + return ret + } + function generateArguments(imageSet, parameters) + { + var ret; + for(var param in parameters) + { + var arg; + if(specialProcessor.isComplexType(param)) + arg=generateArguments(imageSet,mappings[param][toHostMap]); + else + arg=imageSet[param]; + if(arg !=undefined) + { + if(!ret) + ret={}; + var index=parameters[param]; + if(index==self) + index=param; + ret[index]=specialProcessor.pack(param,arg) + } + } + return ret + } + function extractArguments(source, parameters, extracted) + { + if(!extracted) + extracted={}; + for(var param in parameters) + { + var index=parameters[param]; + var value; + if(index==self) + value=source; + else + value=source[index]; + if(value===null || value===undefined) + extracted[param]=undefined; + else + { + value=specialProcessor.unpack(param,value); + var map; + if(specialProcessor.isComplexType(param)) + { + map=mappings[param][fromHostMap]; + if(specialProcessor.preserveNesting(param)) + extracted[param]=extractArguments(value,map); + else + extractArguments(value,map,extracted) + } + else + { + if(OSF.DDA.ListType.isListType(param)) + { + map={}; + var entryDescriptor=OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor]=self; + for(var item in value) + value[item]=extractArguments(value[item],map) + } + extracted[param]=value + } + } + } + return extracted + } + function applyMap(mapName, preimage, mapping) + { + var parameters=mappings[mapName][mapping]; + var image; + if(mapping=="toHost") + { + var imageSet=mapValues(preimage,mapping); + image=generateArguments(imageSet,parameters) + } + else if(mapping=="fromHost") + { + var argumentSet=extractArguments(preimage,parameters); + image=mapValues(argumentSet,mapping) + } + return image + } + if(!mappings) + mappings={}; + this.addMapping=function(mapName, description) + { + var toHost, + fromHost; + if(description.map) + { + toHost=description.map; + fromHost={}; + for(var preimage in toHost) + { + var image=toHost[preimage]; + if(image==self) + image=preimage; + fromHost[image]=preimage + } + } + else + { + toHost=description.toHost; + fromHost=description.fromHost + } + var pair=mappings[mapName]; + if(pair) + { + var currMap=pair[toHostMap]; + for(var th in currMap) + toHost[th]=currMap[th]; + currMap=pair[fromHostMap]; + for(var fh in currMap) + fromHost[fh]=currMap[fh] + } + else + pair=mappings[mapName]={}; + pair[toHostMap]=toHost; + pair[fromHostMap]=fromHost + }; + this.toHost=function(mapName, preimage) + { + return applyMap(mapName,preimage,toHostMap) + }; + this.fromHost=function(mapName, image) + { + return applyMap(mapName,image,fromHostMap) + }; + this.self=self; + this.addComplexType=function(ct) + { + specialProcessor.addComplexType(ct) + }; + this.getDynamicType=function(dt) + { + return specialProcessor.getDynamicType(dt) + }; + this.setDynamicType=function(dt, handler) + { + specialProcessor.setDynamicType(dt,handler) + }; + this.dynamicTypes=dynamicTypes; + this.doMapValues=function(preimageSet, mapping) + { + return mapValues(preimageSet,mapping) + } +}; +OSF.DDA.SpecialProcessor=function(complexTypes, dynamicTypes) +{ + this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) + { + complexTypes.push(ct) + }; + this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) + { + return dynamicTypes[dt] + }; + this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) + { + dynamicTypes[dt]=handler + }; + this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) + { + return OSF.OUtil.listContainsValue(complexTypes,t) + }; + this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) + { + return OSF.OUtil.listContainsKey(dynamicTypes,p) + }; + this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) + { + var pn=[]; + if(OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if(OSF.DDA.DataNodeEventProperties) + pn=pn.concat([OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode]); + return OSF.OUtil.listContainsValue(pn,p) + }; + this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) + { + var value; + if(this.isDynamicType(param)) + value=dynamicTypes[param].toHost(arg); + else + value=arg; + return value + }; + this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) + { + var value; + if(this.isDynamicType(param)) + value=dynamicTypes[param].fromHost(arg); + else + value=arg; + return value + } +}; +OSF.DDA.getDecoratedParameterMap=function(specialProcessor, initialDefs) +{ + var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor); + var self=parameterMap.self; + function createObject(properties) + { + var obj=null; + if(properties) + { + obj={}; + var len=properties.length; + for(var i=0; i < len; i++) + obj[properties[i].name]=properties[i].value + } + return obj + } + parameterMap.define=function define(definition) + { + var args={}; + var toHost=createObject(definition.toHost); + if(definition.invertible) + args.map=toHost; + else if(definition.canonical) + args.toHost=args.fromHost=toHost; + else + { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost) + } + parameterMap.addMapping(definition.type,args); + if(definition.isComplexType) + parameterMap.addComplexType(definition.type) + }; + for(var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap +}; +OSF.OUtil.setNamespace("DispIdHost",OSF.DDA); +OSF.DDA.DispIdHost.Methods={ + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates={ + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) +{ + var dispIdMap={}; + var jsom=OSF.DDA.AsyncMethodNames; + var did=OSF.DDA.MethodDispId; + var methodMap={ + GoToByIdAsync: did.dispidNavigateToMethod, + GetSelectedDataAsync: did.dispidGetSelectedDataMethod, + SetSelectedDataAsync: did.dispidSetSelectedDataMethod, + GetDocumentCopyChunkAsync: did.dispidGetDocumentCopyChunkMethod, + ReleaseDocumentCopyAsync: did.dispidReleaseDocumentCopyMethod, + GetDocumentCopyAsync: did.dispidGetDocumentCopyMethod, + AddFromSelectionAsync: did.dispidAddBindingFromSelectionMethod, + AddFromPromptAsync: did.dispidAddBindingFromPromptMethod, + AddFromNamedItemAsync: did.dispidAddBindingFromNamedItemMethod, + GetAllAsync: did.dispidGetAllBindingsMethod, + GetByIdAsync: did.dispidGetBindingMethod, + ReleaseByIdAsync: did.dispidReleaseBindingMethod, + GetDataAsync: did.dispidGetBindingDataMethod, + SetDataAsync: did.dispidSetBindingDataMethod, + AddRowsAsync: did.dispidAddRowsMethod, + AddColumnsAsync: did.dispidAddColumnsMethod, + DeleteAllDataValuesAsync: did.dispidClearAllRowsMethod, + RefreshAsync: did.dispidLoadSettingsMethod, + SaveAsync: did.dispidSaveSettingsMethod, + GetActiveViewAsync: did.dispidGetActiveViewMethod, + GetFilePropertiesAsync: did.dispidGetFilePropertiesMethod, + GetOfficeThemeAsync: did.dispidGetOfficeThemeMethod, + GetDocumentThemeAsync: did.dispidGetDocumentThemeMethod, + ClearFormatsAsync: did.dispidClearFormatsMethod, + SetTableOptionsAsync: did.dispidSetTableOptionsMethod, + SetFormatsAsync: did.dispidSetFormatsMethod, + ExecuteRichApiRequestAsync: did.dispidExecuteRichApiRequestMethod, + AppCommandInvocationCompletedAsync: did.dispidAppCommandInvocationCompletedMethod, + AddDataPartAsync: did.dispidAddDataPartMethod, + GetDataPartByIdAsync: did.dispidGetDataPartByIdMethod, + GetDataPartsByNameSpaceAsync: did.dispidGetDataPartsByNamespaceMethod, + GetPartXmlAsync: did.dispidGetDataPartXmlMethod, + GetPartNodesAsync: did.dispidGetDataPartNodesMethod, + DeleteDataPartAsync: did.dispidDeleteDataPartMethod, + GetNodeValueAsync: did.dispidGetDataNodeValueMethod, + GetNodeXmlAsync: did.dispidGetDataNodeXmlMethod, + GetRelativeNodesAsync: did.dispidGetDataNodesMethod, + SetNodeValueAsync: did.dispidSetDataNodeValueMethod, + SetNodeXmlAsync: did.dispidSetDataNodeXmlMethod, + AddDataPartNamespaceAsync: did.dispidAddDataNamespaceMethod, + GetDataPartNamespaceAsync: did.dispidGetDataUriByPrefixMethod, + GetDataPartPrefixAsync: did.dispidGetDataPrefixByUriMethod, + GetSelectedTask: did.dispidGetSelectedTaskMethod, + GetTask: did.dispidGetTaskMethod, + GetWSSUrl: did.dispidGetWSSUrlMethod, + GetTaskField: did.dispidGetTaskFieldMethod, + GetSelectedResource: did.dispidGetSelectedResourceMethod, + GetResourceField: did.dispidGetResourceFieldMethod, + GetProjectField: did.dispidGetProjectFieldMethod, + GetSelectedView: did.dispidGetSelectedViewMethod, + GetTaskByIndex: did.dispidGetTaskByIndexMethod, + GetResourceByIndex: did.dispidGetResourceByIndexMethod, + SetTaskField: did.dispidSetTaskFieldMethod, + SetResourceField: did.dispidSetResourceFieldMethod, + GetMaxTaskIndex: did.dispidGetMaxTaskIndexMethod, + GetMaxResourceIndex: did.dispidGetMaxResourceIndexMethod + }; + for(var method in methodMap) + if(jsom[method]) + dispIdMap[jsom[method].id]=methodMap[method]; + jsom=Microsoft.Office.WebExtension.EventType; + did=OSF.DDA.EventDispId; + var eventMap={ + SettingsChanged: did.dispidSettingsChangedEvent, + DocumentSelectionChanged: did.dispidDocumentSelectionChangedEvent, + BindingSelectionChanged: did.dispidBindingSelectionChangedEvent, + BindingDataChanged: did.dispidBindingDataChangedEvent, + ActiveViewChanged: did.dispidActiveViewChangedEvent, + OfficeThemeChanged: did.dispidOfficeThemeChangedEvent, + DocumentThemeChanged: did.dispidDocumentThemeChangedEvent, + AppCommandInvoked: did.dispidAppCommandInvokedEvent, + TaskSelectionChanged: did.dispidTaskSelectionChangedEvent, + ResourceSelectionChanged: did.dispidResourceSelectionChangedEvent, + ViewSelectionChanged: did.dispidViewSelectionChangedEvent, + DataNodeInserted: did.dispidDataNodeAddedEvent, + DataNodeReplaced: did.dispidDataNodeReplacedEvent, + DataNodeDeleted: did.dispidDataNodeDeletedEvent + }; + for(var event in eventMap) + if(jsom[event]) + dispIdMap[jsom[event]]=eventMap[event]; + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) + { + if(typeof ex=="number") + { + if(!callArgs) + callArgs=asyncMethodCall.getCallArgs(suppliedArgs); + OSF.DDA.issueAsyncResult(callArgs,ex,OSF.DDA.ErrorCodeManager.getErrorArgs(ex)) + } + else + throw ex; + } + this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) + { + var callArgs; + try + { + var methodName=method.id; + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,privateState); + var dispId=dispIdMap[methodName]; + var delegate=getDelegateMethods(methodName); + var hostCallArgs; + if(parameterMap.toHost) + hostCallArgs=parameterMap.toHost(dispId,callArgs); + else + hostCallArgs=callArgs; + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + dispId: dispId, + hostCallArgs: hostCallArgs, + onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall) + }, + onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse) + }, + onComplete: function(status, hostResponseArgs) + { + var responseArgs; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + if(parameterMap.fromHost) + responseArgs=parameterMap.fromHost(dispId,hostResponseArgs); + else + responseArgs=hostResponseArgs; + else + responseArgs=hostResponseArgs; + var payload=asyncMethodCall.processResponse(status,responseArgs,caller,callArgs); + OSF.DDA.issueAsyncResult(callArgs,status,payload) + } + }) + } + catch(ex) + { + onException(ex,asyncMethodCall,suppliedArguments,callArgs) + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) + { + var callArgs; + var eventType, + handler; + function onEnsureRegistration(status) + { + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + { + var added=eventDispatch.addEventHandler(eventType,handler); + if(!added) + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed + } + var error; + if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + OSF.DDA.issueAsyncResult(callArgs,status,error) + } + try + { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch); + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if(eventDispatch.getEventHandlerCount(eventType)==0) + { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + eventType: eventType, + dispId: dispId, + targetId: caller.id || "", + onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall) + }, + onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse) + }, + onComplete: onEnsureRegistration, + onEvent: function handleEvent(hostArgs) + { + var args=parameterMap.fromHost(dispId,hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType,caller,args)) + } + }) + } + else + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + } + catch(ex) + { + onException(ex,asyncMethodCall,suppliedArguments,callArgs) + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) + { + var callArgs; + var eventType, + handler; + function onEnsureRegistration(status) + { + var error; + if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + OSF.DDA.issueAsyncResult(callArgs,status,error) + } + try + { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch); + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, + removeSuccess; + if(handler===null) + { + removeSuccess=eventDispatch.clearEventHandlers(eventType); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess + } + else + { + removeSuccess=eventDispatch.removeEventHandler(eventType,handler); + status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist + } + if(removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) + { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + eventType: eventType, + dispId: dispId, + targetId: caller.id || "", + onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall) + }, + onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse) + }, + onComplete: onEnsureRegistration + }) + } + else + onEnsureRegistration(status) + } + catch(ex) + { + onException(ex,asyncMethodCall,suppliedArguments,callArgs) + } + } +}; +OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) +{ + for(var entry in asyncMethodNames) + { + var method=asyncMethodNames[entry]; + var name=method.displayName; + if(!target[name]) + OSF.OUtil.defineEnumerableProperty(target,name,{value: function(asyncMethod) + { + return function() + { + var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod,arguments,target,privateState) + } + }(method)}) + } +}; +OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) +{ + var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if(!target[add]) + OSF.OUtil.defineEnumerableProperty(target,add,{value: function() + { + var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments,eventDispatch,target) + }}); + if(!target[remove]) + OSF.OUtil.defineEnumerableProperty(target,remove,{value: function() + { + var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments,eventDispatch,target) + }}) +}; +OSF.OUtil.setNamespace("Microsoft",window); +OSF.OUtil.setNamespace("Office",Microsoft); +OSF.OUtil.setNamespace("Common",Microsoft.Office); +(function(window) +{ + "use strict"; + var stringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"',"g"), + trueFalseNullRegEx=new RegExp("\\b(true|false|null)\\b","g"), + numbersRegEx=new RegExp("-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?","g"), + badBracketsRegEx=new RegExp("[^{:,\\[\\s](?=\\s*\\[)"), + badRemainderRegEx=new RegExp("[^\\s\\[\\]{}:,]"), + jsonErrorMsg="Cannot deserialize. The data does not correspond to valid JSON."; + function addHandler(element, eventName, handler) + { + if(element.addEventListener) + element.addEventListener(eventName,handler,false); + else if(element.attachEvent) + element.attachEvent("on"+eventName,handler) + } + function getAjaxSerializer() + { + if(typeof Sys !=="undefined" && typeof Sys.Serialization !=="undefined" && typeof Sys.Serialization.JavaScriptSerializer !=="undefined") + return Sys.Serialization.JavaScriptSerializer; + return null + } + function deserialize(data, secure, oldDeserialize) + { + var transformed; + if(!secure) + return oldDeserialize(data); + if(window.JSON && window.JSON.parse) + return window.JSON.parse(data); + transformed=data.replace(stringRegEx,"[]"); + transformed=transformed.replace(trueFalseNullRegEx,"[]"); + transformed=transformed.replace(numbersRegEx,"[]"); + if(badBracketsRegEx.test(transformed)) + throw jsonErrorMsg; + if(badRemainderRegEx.test(transformed)) + throw jsonErrorMsg; + try + { + eval("("+data+")") + } + catch(e) + { + throw jsonErrorMsg; + } + } + function patchDeserializer() + { + var serializer=getAjaxSerializer(), + oldDeserialize; + if(serializer===null || typeof serializer.deserialize !=="function") + return false; + if(serializer.__patchVersion >=1) + return true; + oldDeserialize=serializer.deserialize; + serializer.deserialize=function(data, secure) + { + return deserialize(data,true,oldDeserialize) + }; + serializer.__patchVersion=1; + return true + } + if(!patchDeserializer()) + addHandler(window,"load",function() + { + patchDeserializer() + }) +})(window); +Microsoft.Office.Common.InvokeType={ + async: 0, + sync: 1, + asyncRegisterEvent: 2, + asyncUnregisterEvent: 3, + syncRegisterEvent: 4, + syncUnregisterEvent: 5 +}; +Microsoft.Office.Common.InvokeResultCode={ + noError: 0, + errorInRequest: -1, + errorHandlingRequest: -2, + errorInResponse: -3, + errorHandlingResponse: -4, + errorHandlingRequestAccessDenied: -5, + errorHandlingMethodCallTimedout: -6 +}; +Microsoft.Office.Common.MessageType={ + request: 0, + response: 1 +}; +Microsoft.Office.Common.ActionType={ + invoke: 0, + registerEvent: 1, + unregisterEvent: 2 +}; +Microsoft.Office.Common.ResponseType={ + forCalling: 0, + forEventing: 1 +}; +Microsoft.Office.Common.MethodObject=function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) +{ + this._method=method; + this._invokeType=invokeType; + this._blockingOthers=blockingOthers +}; +Microsoft.Office.Common.MethodObject.prototype={ + getMethod: function Microsoft_Office_Common_MethodObject$getMethod() + { + return this._method + }, + getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() + { + return this._invokeType + }, + getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() + { + return this._blockingOthers + } +}; +Microsoft.Office.Common.EventMethodObject=function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) +{ + this._registerMethodObject=registerMethodObject; + this._unregisterMethodObject=unregisterMethodObject +}; +Microsoft.Office.Common.EventMethodObject.prototype={ + getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() + { + return this._registerMethodObject + }, + getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() + { + return this._unregisterMethodObject + } +}; +Microsoft.Office.Common.ServiceEndPoint=function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) +{ + var e=Function._validateParams(arguments,[{ + name: "serviceEndPointId", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + this._methodObjectList={}; + this._eventHandlerProxyList={}; + this._Id=serviceEndPointId; + this._conversations={}; + this._policyManager=null +}; +Microsoft.Office.Common.ServiceEndPoint.prototype={ + registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) + { + var e=Function._validateParams(arguments,[{ + name: "methodName", + type: String, + mayBeNull: false + },{ + name: "method", + type: Function, + mayBeNull: false + },{ + name: "invokeType", + type: Number, + mayBeNull: false + },{ + name: "blockingOthers", + type: Boolean, + mayBeNull: false + }]); + if(e) + throw e; + if(invokeType !==Microsoft.Office.Common.InvokeType.async && invokeType !==Microsoft.Office.Common.InvokeType.sync) + throw Error.argument("invokeType"); + var methodObject=new Microsoft.Office.Common.MethodObject(method,invokeType,blockingOthers); + this._methodObjectList[methodName]=methodObject + }, + unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) + { + var e=Function._validateParams(arguments,[{ + name: "methodName", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + delete this._methodObjectList[methodName] + }, + registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) + { + var e=Function._validateParams(arguments,[{ + name: "eventName", + type: String, + mayBeNull: false + },{ + name: "registerMethod", + type: Function, + mayBeNull: false + },{ + name: "unregisterMethod", + type: Function, + mayBeNull: false + }]); + if(e) + throw e; + var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod,Microsoft.Office.Common.InvokeType.syncRegisterEvent,false),new Microsoft.Office.Common.MethodObject(unregisterMethod,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,false)); + this._methodObjectList[eventName]=methodObject + }, + registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) + { + var e=Function._validateParams(arguments,[{ + name: "eventName", + type: String, + mayBeNull: false + },{ + name: "registerMethod", + type: Function, + mayBeNull: false + },{ + name: "registerMethodInvokeType", + type: Number, + mayBeNull: false + },{ + name: "unregisterMethod", + type: Function, + mayBeNull: false + },{ + name: "unregisterMethodInvokeType", + type: Number, + mayBeNull: false + }]); + if(e) + throw e; + var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod,registerMethodInvokeType,false),new Microsoft.Office.Common.MethodObject(unregisterMethod,unregisterMethodInvokeType,false)); + this._methodObjectList[eventName]=methodObject + }, + unregisterEvent: function(eventName) + { + var e=Function._validateParams(arguments,[{ + name: "eventName", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + this.unregisterMethod(eventName) + }, + registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId, conversationUrl) + { + var e=Function._validateParams(arguments,[{ + name: "conversationId", + type: String, + mayBeNull: false + },{ + name: "conversationUrl", + type: String, + mayBeNull: false, + optional: true + }]); + if(e) + throw e; + if(conversationUrl) + this._conversations[conversationId]=conversationUrl; + else + this._conversations[conversationId]=true + }, + unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) + { + var e=Function._validateParams(arguments,[{ + name: "conversationId", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + delete this._conversations[conversationId] + }, + setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) + { + var e=Function._validateParams(arguments,[{ + name: "policyManager", + type: Object, + mayBeNull: false + }]); + if(e) + throw e; + if(!policyManager.checkPermission) + throw Error.argument("policyManager"); + this._policyManager=policyManager + }, + getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() + { + return this._policyManager + } +}; +Microsoft.Office.Common.ClientEndPoint=function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl) +{ + var e=Function._validateParams(arguments,[{ + name: "conversationId", + type: String, + mayBeNull: false + },{ + name: "targetWindow", + mayBeNull: false + },{ + name: "targetUrl", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + if(!targetWindow.postMessage) + throw Error.argument("targetWindow"); + this._conversationId=conversationId; + this._targetWindow=targetWindow; + this._targetUrl=targetUrl; + this._callingIndex=0; + this._callbackList={}; + this._eventHandlerList={} +}; +Microsoft.Office.Common.ClientEndPoint.prototype={ + invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) + { + var e=Function._validateParams(arguments,[{ + name: "targetMethodName", + type: String, + mayBeNull: false + },{ + name: "callback", + type: Function, + mayBeNull: true + },{ + name: "param", + mayBeNull: true + }]); + if(e) + throw e; + var correlationId=this._callingIndex++; + var now=new Date; + var callbackEntry={ + callback: callback, + createdOn: now.getTime() + }; + if(param && typeof param==="object" && typeof param.__timeout__==="number") + { + callbackEntry.timeout=param.__timeout__; + delete param.__timeout__ + } + this._callbackList[correlationId]=callbackEntry; + try + { + var callRequest=new Microsoft.Office.Common.Request(targetMethodName,Microsoft.Office.Common.ActionType.invoke,this._conversationId,correlationId,param); + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest); + this._targetWindow.postMessage(msg,this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer() + } + catch(ex) + { + try + { + if(callback !==null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest,ex) + } + finally + { + delete this._callbackList[correlationId] + } + } + }, + registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) + { + var e=Function._validateParams(arguments,[{ + name: "targetEventName", + type: String, + mayBeNull: false + },{ + name: "eventHandler", + type: Function, + mayBeNull: false + },{ + name: "callback", + type: Function, + mayBeNull: true + },{ + name: "data", + mayBeNull: true, + optional: true + }]); + if(e) + throw e; + var correlationId=this._callingIndex++; + var now=new Date; + this._callbackList[correlationId]={ + callback: callback, + createdOn: now.getTime() + }; + try + { + var callRequest=new Microsoft.Office.Common.Request(targetEventName,Microsoft.Office.Common.ActionType.registerEvent,this._conversationId,correlationId,data); + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest); + this._targetWindow.postMessage(msg,this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + this._eventHandlerList[targetEventName]=eventHandler + } + catch(ex) + { + try + { + if(callback !==null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest,ex) + } + finally + { + delete this._callbackList[correlationId] + } + } + }, + unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) + { + var e=Function._validateParams(arguments,[{ + name: "targetEventName", + type: String, + mayBeNull: false + },{ + name: "callback", + type: Function, + mayBeNull: true + },{ + name: "data", + mayBeNull: true, + optional: true + }]); + if(e) + throw e; + var correlationId=this._callingIndex++; + var now=new Date; + this._callbackList[correlationId]={ + callback: callback, + createdOn: now.getTime() + }; + try + { + var callRequest=new Microsoft.Office.Common.Request(targetEventName,Microsoft.Office.Common.ActionType.unregisterEvent,this._conversationId,correlationId,data); + var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest); + this._targetWindow.postMessage(msg,this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer() + } + catch(ex) + { + try + { + if(callback !==null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest,ex) + } + finally + { + delete this._callbackList[correlationId] + } + } + finally + { + delete this._eventHandlerList[targetEventName] + } + } +}; +Microsoft.Office.Common.XdmCommunicationManager=function() +{ + var _invokerQueue=[]; + var _messageProcessingTimer=null; + var _processInterval=10; + var _blockingFlag=false; + var _methodTimeoutTimer=null; + var _methodTimeoutProcessInterval=2e3; + var _methodTimeoutDefault=65e3; + var _methodTimeout=_methodTimeoutDefault; + var _serviceEndPoints={}; + var _clientEndPoints={}; + var _initialized=false; + function _lookupServiceEndPoint(conversationId) + { + for(var id in _serviceEndPoints) + if(_serviceEndPoints[id]._conversations[conversationId]) + return _serviceEndPoints[id]; + Sys.Debug.trace("Unknown conversation Id."); + throw Error.argument("conversationId"); + } + function _lookupClientEndPoint(conversationId) + { + var clientEndPoint=_clientEndPoints[conversationId]; + if(!clientEndPoint) + { + Sys.Debug.trace("Unknown conversation Id."); + throw Error.argument("conversationId"); + } + return clientEndPoint + } + function _lookupMethodObject(serviceEndPoint, messageObject) + { + var methodOrEventMethodObject=serviceEndPoint._methodObjectList[messageObject._actionName]; + if(!methodOrEventMethodObject) + { + Sys.Debug.trace("The specified method is not registered on service endpoint:"+messageObject._actionName); + throw Error.argument("messageObject"); + } + var methodObject=null; + if(messageObject._actionType===Microsoft.Office.Common.ActionType.invoke) + methodObject=methodOrEventMethodObject; + else if(messageObject._actionType===Microsoft.Office.Common.ActionType.registerEvent) + methodObject=methodOrEventMethodObject.getRegisterMethodObject(); + else + methodObject=methodOrEventMethodObject.getUnregisterMethodObject(); + return methodObject + } + function _enqueInvoker(invoker) + { + _invokerQueue.push(invoker) + } + function _dequeInvoker() + { + if(_messageProcessingTimer !==null) + { + if(!_blockingFlag) + if(_invokerQueue.length > 0) + { + var invoker=_invokerQueue.shift(); + _blockingFlag=invoker.getInvokeBlockingFlag(); + invoker.invoke() + } + else + { + clearInterval(_messageProcessingTimer); + _messageProcessingTimer=null + } + } + else + Sys.Debug.trace("channel is not ready.") + } + function _checkMethodTimeout() + { + if(_methodTimeoutTimer) + { + var clientEndPoint; + var methodCallsNotTimedout=0; + var now=new Date; + var timeoutValue; + for(var conversationId in _clientEndPoints) + { + clientEndPoint=_clientEndPoints[conversationId]; + for(var correlationId in clientEndPoint._callbackList) + { + var callbackEntry=clientEndPoint._callbackList[correlationId]; + timeoutValue=callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout; + if(timeoutValue >=0 && Math.abs(now.getTime() - callbackEntry.createdOn) >=timeoutValue) + try + { + if(callbackEntry.callback) + callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,null) + } + finally + { + delete clientEndPoint._callbackList[correlationId] + } + else + methodCallsNotTimedout++ } + } + if(methodCallsNotTimedout===0) + { + clearInterval(_methodTimeoutTimer); + _methodTimeoutTimer=null + } + } + else + Sys.Debug.trace("channel is not ready.") + } + function _postCallbackHandler() + { + _blockingFlag=false + } + function _registerListener(listener) + { + if(window.addEventListener) + window.addEventListener("message",listener,false); + else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && window.attachEvent) + window.attachEvent("onmessage",listener); + else + { + Sys.Debug.trace("Browser doesn't support the required API."); + throw Error.argument("Browser"); + } + } + function _checkOrigin(url, origin) + { + var res=false; + if(url===true) + return true; + if(!url || !origin || !url.length || !origin.length) + return res; + var url_parser, + org_parser; + url_parser=document.createElement("a"); + org_parser=document.createElement("a"); + url_parser.href=url; + org_parser.href=origin; + res=url_parser.hostname==org_parser.hostname && url_parser.protocol==org_parser.protocol && url_parser.port==org_parser.port; + delete url_parser,org_parser; + return res + } + function _receive(e) + { + if(e.data !="") + { + var messageObject; + try + { + messageObject=Microsoft.Office.Common.MessagePackager.unenvelope(e.data) + } + catch(ex) + { + return + } + if(typeof messageObject._messageType=="undefined") + return; + if(messageObject._messageType===Microsoft.Office.Common.MessageType.request) + { + var requesterUrl=e.origin==null || e.origin=="null" ? messageObject._origin : e.origin; + try + { + var serviceEndPoint=_lookupServiceEndPoint(messageObject._conversationId); + if(!_checkOrigin(serviceEndPoint._conversations[messageObject._conversationId],e.origin)) + throw"Failed origin check"; + var policyManager=serviceEndPoint.getPolicyManager(); + if(policyManager && !policyManager.checkPermission(messageObject._conversationId,messageObject._actionName,messageObject._data)) + throw"Access Denied"; + var methodObject=_lookupMethodObject(serviceEndPoint,messageObject); + var invokeCompleteCallback=new Microsoft.Office.Common.InvokeCompleteCallback(e.source,requesterUrl,messageObject._actionName,messageObject._conversationId,messageObject._correlationId,_postCallbackHandler); + var invoker=new Microsoft.Office.Common.Invoker(methodObject,messageObject._data,invokeCompleteCallback,serviceEndPoint._eventHandlerProxyList,messageObject._conversationId,messageObject._actionName); + if(_messageProcessingTimer==null) + _messageProcessingTimer=setInterval(_dequeInvoker,_processInterval); + _enqueInvoker(invoker) + } + catch(ex) + { + var errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest; + if(ex=="Access Denied") + errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied; + var callResponse=new Microsoft.Office.Common.Response(messageObject._actionName,messageObject._conversationId,messageObject._correlationId,errorCode,Microsoft.Office.Common.ResponseType.forCalling,ex); + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(callResponse); + if(e.source && e.source.postMessage) + e.source.postMessage(envelopedResult,requesterUrl) + } + } + else if(messageObject._messageType===Microsoft.Office.Common.MessageType.response) + { + var clientEndPoint=_lookupClientEndPoint(messageObject._conversationId); + if(!_checkOrigin(clientEndPoint._targetUrl,e.origin)) + throw"Failed orgin check"; + if(messageObject._responseType===Microsoft.Office.Common.ResponseType.forCalling) + { + var callbackEntry=clientEndPoint._callbackList[messageObject._correlationId]; + if(callbackEntry) + try + { + if(callbackEntry.callback) + callbackEntry.callback(messageObject._errorCode,messageObject._data) + } + finally + { + delete clientEndPoint._callbackList[messageObject._correlationId] + } + } + else + { + var eventhandler=clientEndPoint._eventHandlerList[messageObject._actionName]; + if(eventhandler !==undefined && eventhandler !==null) + eventhandler(messageObject._data) + } + } + else + return + } + } + function _initialize() + { + if(!_initialized) + { + _registerListener(_receive); + _initialized=true + } + } + return{ + connect: function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl) + { + var clientEndPoint=_clientEndPoints[conversationId]; + if(!clientEndPoint) + { + _initialize(); + clientEndPoint=new Microsoft.Office.Common.ClientEndPoint(conversationId,targetWindow,targetUrl); + _clientEndPoints[conversationId]=clientEndPoint + } + return clientEndPoint + }, + getClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) + { + var e=Function._validateParams(arguments,[{ + name: "conversationId", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + return _clientEndPoints[conversationId] + }, + createServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) + { + _initialize(); + var serviceEndPoint=new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId); + _serviceEndPoints[serviceEndPointId]=serviceEndPoint; + return serviceEndPoint + }, + getServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) + { + var e=Function._validateParams(arguments,[{ + name: "serviceEndPointId", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + return _serviceEndPoints[serviceEndPointId] + }, + deleteClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) + { + var e=Function._validateParams(arguments,[{ + name: "conversationId", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + delete _clientEndPoints[conversationId] + }, + _setMethodTimeout: function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) + { + var e=Function._validateParams(arguments,[{ + name: "methodTimeout", + type: Number, + mayBeNull: false + }]); + if(e) + throw e; + _methodTimeout=methodTimeout <=0 ? _methodTimeoutDefault : methodTimeout + }, + _startMethodTimeoutTimer: function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() + { + if(!_methodTimeoutTimer) + _methodTimeoutTimer=setInterval(_checkMethodTimeout,_methodTimeoutProcessInterval) + } + } +}(); +Microsoft.Office.Common.Message=function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) +{ + var e=Function._validateParams(arguments,[{ + name: "messageType", + type: Number, + mayBeNull: false + },{ + name: "actionName", + type: String, + mayBeNull: false + },{ + name: "conversationId", + type: String, + mayBeNull: false + },{ + name: "correlationId", + mayBeNull: false + },{ + name: "data", + mayBeNull: true, + optional: true + }]); + if(e) + throw e; + this._messageType=messageType; + this._actionName=actionName; + this._conversationId=conversationId; + this._correlationId=correlationId; + this._origin=window.location.href; + if(typeof data=="undefined") + this._data=null; + else + this._data=data +}; +Microsoft.Office.Common.Message.prototype={ + getActionName: function Microsoft_Office_Common_Message$getActionName() + { + return this._actionName + }, + getConversationId: function Microsoft_Office_Common_Message$getConversationId() + { + return this._conversationId + }, + getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() + { + return this._correlationId + }, + getOrigin: function Microsoft_Office_Common_Message$getOrigin() + { + return this._origin + }, + getData: function Microsoft_Office_Common_Message$getData() + { + return this._data + }, + getMessageType: function Microsoft_Office_Common_Message$getMessageType() + { + return this._messageType + } +}; +Microsoft.Office.Common.Request=function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) +{ + Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,actionName,conversationId,correlationId,data); + this._actionType=actionType +}; +OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message); +Microsoft.Office.Common.Request.prototype.getActionType=function Microsoft_Office_Common_Request$getActionType() +{ + return this._actionType +}; +Microsoft.Office.Common.Response=function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) +{ + Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,actionName,conversationId,correlationId,data); + this._errorCode=errorCode; + this._responseType=responseType +}; +OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message); +Microsoft.Office.Common.Response.prototype.getErrorCode=function Microsoft_Office_Common_Response$getErrorCode() +{ + return this._errorCode +}; +Microsoft.Office.Common.Response.prototype.getResponseType=function Microsoft_Office_Common_Response$getResponseType() +{ + return this._responseType +}; +Microsoft.Office.Common.MessagePackager={ + envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject) + { + return Sys.Serialization.JavaScriptSerializer.serialize(messageObject) + }, + unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject) + { + return Sys.Serialization.JavaScriptSerializer.deserialize(messageObject,true) + } +}; +Microsoft.Office.Common.ResponseSender=function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType) +{ + var e=Function._validateParams(arguments,[{ + name: "requesterWindow", + mayBeNull: false + },{ + name: "requesterUrl", + type: String, + mayBeNull: false + },{ + name: "actionName", + type: String, + mayBeNull: false + },{ + name: "conversationId", + type: String, + mayBeNull: false + },{ + name: "correlationId", + mayBeNull: false + },{ + name: "responsetype", + type: Number, + maybeNull: false + }]); + if(e) + throw e; + this._requesterWindow=requesterWindow; + this._requesterUrl=requesterUrl; + this._actionName=actionName; + this._conversationId=conversationId; + this._correlationId=correlationId; + this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError; + this._responseType=responseType; + var me=this; + this._send=function(result) + { + try + { + var response=new Microsoft.Office.Common.Response(me._actionName,me._conversationId,me._correlationId,me._invokeResultCode,me._responseType,result); + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response); + me._requesterWindow.postMessage(envelopedResult,me._requesterUrl) + } + catch(ex) + { + Sys.Debug.trace("ResponseSender._send error:"+ex.message) + } + } +}; +Microsoft.Office.Common.ResponseSender.prototype={ + getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() + { + return this._requesterWindow + }, + getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() + { + return this._requesterUrl + }, + getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() + { + return this._actionName + }, + getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() + { + return this._conversationId + }, + getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() + { + return this._correlationId + }, + getSend: function Microsoft_Office_Common_ResponseSender$getSend() + { + return this._send + }, + setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) + { + this._invokeResultCode=resultCode + } +}; +Microsoft.Office.Common.InvokeCompleteCallback=function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler) +{ + Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this,requesterWindow,requesterUrl,actionName,conversationId,correlationId,Microsoft.Office.Common.ResponseType.forCalling); + this._postCallbackHandler=postCallbackHandler; + var me=this; + this._send=function(result) + { + try + { + var response=new Microsoft.Office.Common.Response(me._actionName,me._conversationId,me._correlationId,me._invokeResultCode,me._responseType,result); + var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response); + me._requesterWindow.postMessage(envelopedResult,me._requesterUrl); + me._postCallbackHandler() + } + catch(ex) + { + Sys.Debug.trace("InvokeCompleteCallback._send error:"+ex.message) + } + } +}; +OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender); +Microsoft.Office.Common.Invoker=function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName) +{ + var e=Function._validateParams(arguments,[{ + name: "methodObject", + mayBeNull: false + },{ + name: "paramValue", + mayBeNull: true + },{ + name: "invokeCompleteCallback", + mayBeNull: false + },{ + name: "eventHandlerProxyList", + mayBeNull: true + },{ + name: "conversationId", + type: String, + mayBeNull: false + },{ + name: "eventName", + type: String, + mayBeNull: false + }]); + if(e) + throw e; + this._methodObject=methodObject; + this._param=paramValue; + this._invokeCompleteCallback=invokeCompleteCallback; + this._eventHandlerProxyList=eventHandlerProxyList; + this._conversationId=conversationId; + this._eventName=eventName +}; +Microsoft.Office.Common.Invoker.prototype={ + invoke: function Microsoft_Office_Common_Invoker$invoke() + { + try + { + var result; + switch(this._methodObject.getInvokeType()) + { + case Microsoft.Office.Common.InvokeType.async: + this._methodObject.getMethod()(this._param,this._invokeCompleteCallback.getSend()); + break; + case Microsoft.Office.Common.InvokeType.sync: + result=this._methodObject.getMethod()(this._param); + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncRegisterEvent: + var eventHandlerProxy=this._createEventHandlerProxyObject(this._invokeCompleteCallback); + result=this._methodObject.getMethod()(eventHandlerProxy.getSend(),this._param); + this._eventHandlerProxyList[this._conversationId+this._eventName]=eventHandlerProxy.getSend(); + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncUnregisterEvent: + var eventHandler=this._eventHandlerProxyList[this._conversationId+this._eventName]; + result=this._methodObject.getMethod()(eventHandler,this._param); + delete this._eventHandlerProxyList[this._conversationId+this._eventName]; + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.asyncRegisterEvent: + var eventHandlerProxyAsync=this._createEventHandlerProxyObject(this._invokeCompleteCallback); + this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(),this._invokeCompleteCallback.getSend(),this._param); + this._eventHandlerProxyList[this._callerId+this._eventName]=eventHandlerProxyAsync.getSend(); + break; + case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: + var eventHandlerAsync=this._eventHandlerProxyList[this._callerId+this._eventName]; + this._methodObject.getMethod()(eventHandlerAsync,this._invokeCompleteCallback.getSend(),this._param); + delete this._eventHandlerProxyList[this._callerId+this._eventName]; + break; + default: + break + } + } + catch(ex) + { + this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse); + this._invokeCompleteCallback.getSend()(ex) + } + }, + getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() + { + return this._methodObject.getBlockingFlag() + }, + _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) + { + return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(),invokeCompleteObject.getRequesterUrl(),invokeCompleteObject.getActionName(),invokeCompleteObject.getConversationId(),invokeCompleteObject.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing) + } +}; +OSF.OUtil.setNamespace("WAC",OSF.DDA); +OSF.DDA.WAC.UniqueArguments={ + Data: "Data", + Properties: "Properties", + BindingRequest: "DdaBindingsMethod", + BindingResponse: "Bindings", + SingleBindingResponse: "singleBindingResponse", + GetData: "DdaGetBindingData", + AddRowsColumns: "DdaAddRowsColumns", + SetData: "DdaSetBindingData", + ClearFormats: "DdaClearBindingFormats", + SetFormats: "DdaSetBindingFormats", + SettingsRequest: "DdaSettingsMethod", + BindingEventSource: "ddaBinding", + ArrayData: "ArrayData" +}; +OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC); +OSF.DDA.WAC.Delegate.SpecialProcessor=function OSF_DDA_WAC_Delegate_SpecialProcessor() +{ + var complexTypes=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource]; + var dynamicTypes={}; + OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,complexTypes,dynamicTypes) +}; +OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor); +OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]); +OSF.OUtil.setNamespace("WAC",OSF.DDA); +OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC); +OSF.DDA.WAC.getDelegateMethods=function OSF_DDA_WAC_getDelegateMethods() +{ + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync; + return delegateMethods +}; +OSF.DDA.WAC.Delegate.version=1; +OSF.DDA.WAC.Delegate.executeAsync=function OSF_DDA_WAC_Delegate$executeAsync(args) +{ + if(!args.hostCallArgs) + args.hostCallArgs={}; + args.hostCallArgs["DdaMethod"]={ + ControlId: OSF._OfficeAppFactory.getId(), + Version: OSF.DDA.WAC.Delegate.version, + DispatchId: args.dispId + }; + args.hostCallArgs["__timeout__"]=-1; + if(args.onCalling) + args.onCalling(); + var startTime=(new Date).getTime(); + OSF.getClientEndPoint().invoke("executeMethod",function OSF_DDA_WAC_Delegate$OMFacade$OnResponse(xdmStatus, payload) + { + if(args.onReceiving) + args.onReceiving(); + var error; + if(xdmStatus==Microsoft.Office.Common.InvokeResultCode.noError) + { + OSF.DDA.WAC.Delegate.version=payload["Version"]; + error=payload["Error"] + } + else + switch(xdmStatus) + { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + error=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + error=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break + } + if(args.onComplete) + args.onComplete(error,payload); + if(OSF.AppTelemetry) + OSF.AppTelemetry.onMethodDone(args.dispId,null,Math.abs((new Date).getTime() - startTime),error) + },args.hostCallArgs) +}; +OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function OSF_DDA_WAC_Delegate$GetOnAfterRegisterEvent(register, args) +{ + var startTime=(new Date).getTime(); + return function OSF_DDA_WAC_Delegate$OnAfterRegisterEvent(xdmStatus, payload) + { + if(args.onReceiving) + args.onReceiving(); + var status; + if(xdmStatus !=Microsoft.Office.Common.InvokeResultCode.noError) + switch(xdmStatus) + { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break + } + else if(payload) + if(payload["Error"]) + status=payload["Error"]; + else + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + else + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + if(args.onComplete) + args.onComplete(status); + if(OSF.AppTelemetry) + OSF.AppTelemetry.onRegisterDone(register,args.dispId,Math.abs((new Date).getTime() - startTime),status) + } +}; +OSF.DDA.WAC.Delegate.registerEventAsync=function OSF_DDA_WAC_Delegate$RegisterEventAsync(args) +{ + if(args.onCalling) + args.onCalling(); + OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(args.targetId,args.eventType),function OSF_DDA_WACOMFacade$OnEvent(payload) + { + if(args.onEvent) + args.onEvent(payload); + if(OSF.AppTelemetry) + OSF.AppTelemetry.onEventDone(args.dispId) + },OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true,args),{ + controlId: OSF._OfficeAppFactory.getId(), + eventDispId: args.dispId, + targetId: args.targetId + }) +}; +OSF.DDA.WAC.Delegate.unregisterEventAsync=function OSF_DDA_WAC_Delegate$UnregisterEventAsync(args) +{ + if(args.onCalling) + args.onCalling(); + OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(args.targetId,args.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false,args),{ + controlId: OSF._OfficeAppFactory.getId(), + eventDispId: args.dispId, + targetId: args.targetId + }) +}; +(function() +{ + var checkScriptOverride=function OSF$checkScriptOverride() + { + var postScriptOverrideCheckAction=function OSF$postScriptOverrideCheckAction(customizedScriptPath) + { + if(customizedScriptPath) + OSF.OUtil.loadScript(customizedScriptPath,function() + { + Sys.Debug.trace("loaded customized script:"+customizedScriptPath) + }) + }; + var conversationID, + webAppUrl, + items; + var clientEndPoint=null; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(); + if(xdmInfoValue) + { + items=OSF.OUtil.getInfoItems(xdmInfoValue); + if(items && items.length >=3) + { + conversationID=items[0]; + webAppUrl=items[2]; + clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(conversationID,window.parent,webAppUrl) + } + } + var customizedScriptPath=null; + if(!clientEndPoint) + { + try + { + if(typeof window.external.getCustomizedScriptPath !=="undefined") + customizedScriptPath=window.external.getCustomizedScriptPath() + } + catch(ex) + { + Sys.Debug.trace("no script override through window.external.") + } + postScriptOverrideCheckAction(customizedScriptPath) + } + else + try + { + clientEndPoint.invoke("getCustomizedScriptPathAsync",function OSF$getCustomizedScriptPathAsyncCallback(errorCode, scriptPath) + { + postScriptOverrideCheckAction(errorCode===0 ? scriptPath : null) + },{__timeout__: 1e3}) + } + catch(ex) + { + Sys.Debug.trace("no script override through cross frame communication.") + } + }; + var isMicrosftAjaxLoaded=function OSF$isMicrosftAjaxLoaded() + { + if(typeof Sys !=="undefined" && typeof Type !=="undefined" && Sys.StringBuilder && typeof Sys.StringBuilder==="function" && Type.registerNamespace && typeof Type.registerNamespace==="function" && Type.registerClass && typeof Type.registerClass==="function") + return true; + else + return false + }; + if(isMicrosftAjaxLoaded()) + checkScriptOverride(); + else if(typeof Function !=="undefined") + { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==="https:" ? "https:" : "http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js"; + var onMicrosoftAjaxLoaded=function() + { + if(isMicrosftAjaxLoaded()) + checkScriptOverride(); + else if(typeof Function !=="undefined") + throw"Not able to load MicrosoftAjax.js."; + }; + if(!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) + OSF.OUtil.loadScript(msAjaxCDNPath,onMicrosoftAjaxLoaded); + else + OSF._OfficeAppFactory.getLoadScriptHelper().waitForScripts([OSF.ConstantNames.MicrosoftAjaxId],onMicrosoftAjaxLoaded) + } +})(); +OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) +{ + this._hostInfo=hostInfo; + this._webAppState=webAppState; + this._context=context; + this._settings=settings; + this._hostFacade=hostFacade; + this._initializeSettings=function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) + { + var settings; + var serializedSettings=appContext.get_settings(); + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if(osfSessionStorage) + { + var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if(storageSettings) + serializedSettings=JSON ? JSON.parse(storageSettings) : Sys.Serialization.JavaScriptSerializer.deserialize(storageSettings,true); + else + { + storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),storageSettings) + } + } + var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if(refreshSupported) + settings=new OSF.DDA.RefreshableSettings(deserializedSettings); + else + settings=new OSF.DDA.Settings(deserializedSettings); + return settings + }; + var windowOpen=function OSF_InitializationHelper$windowOpen(windowObj) + { + var proxy=window.open; + windowObj.open=function(strUrl, strWindowName, strWindowFeatures) + { + var windowObject=null; + try + { + windowObject=proxy(strUrl,strWindowName,strWindowFeatures) + } + catch(ex){} + if(!windowObject) + { + var params={ + strUrl: strUrl, + strWindowName: strWindowName, + strWindowFeatures: strWindowFeatures + }; + OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,params) + } + return windowObject + } + }; + windowOpen(window) +}; +OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) +{ + var getInvocationCallbackWebApp=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) + { + var settings; + if(appContext._appName===OSF.AppName.ExcelWebApp) + { + var serializedSettings=appContext._settings; + settings={}; + for(var index in serializedSettings) + { + var setting=serializedSettings[index]; + settings[setting[0]]=setting[1] + } + } + else + settings=appContext._settings; + if(errorCode===0 && appContext._id !=undefined && appContext._appName !=undefined && appContext._appVersion !=undefined && appContext._appUILocale !=undefined && appContext._dataLocale !=undefined && appContext._docUrl !=undefined && appContext._clientMode !=undefined && appContext._settings !=undefined && appContext._reason !=undefined) + { + var returnedContext=new OSF.OfficeAppContext(appContext._id,appContext._appName,appContext._appVersion,appContext._appUILocale,appContext._dataLocale,appContext._docUrl,appContext._clientMode,settings,appContext._reason,appContext._osfControlType,appContext._eToken,appContext._correlationId,appContext._id); + if(OSF.AppTelemetry) + OSF.AppTelemetry.initialize(returnedContext); + gotAppContext(returnedContext) + } + else + throw"Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+errorCode; + }; + this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",getInvocationCallbackWebApp,this._webAppState.id) +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() +{ + var me=this; + var xdmInfoValue=OSF.OUtil.parseXdmInfoWithGivenFragment(false,OSF._OfficeAppFactory.getWindowLocationHash()); + if(xdmInfoValue) + { + var xdmItems=OSF.OUtil.getInfoItems(xdmInfoValue); + if(xdmItems !=undefined && xdmItems.length===3) + { + me._webAppState.conversationID=xdmItems[0]; + me._webAppState.id=xdmItems[1]; + me._webAppState.webAppUrl=xdmItems[2] + } + } + me._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID,me._webAppState.wnd,me._webAppState.webAppUrl); + me._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id); + var notificationConversationId=me._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix; + me._webAppState.serviceEndPoint.registerConversation(notificationConversationId,me._webAppState.webAppUrl); + var focusFirstItem=function OSF_OfficeAppFactory_initialize$focusFirstItem() + { + if(!me._webAppState.focused) + { + me._webAppState.focused=true; + var list=document.querySelectorAll("input,a,button"); + for(var i=0; i < list.length; i++) + { + var node=list[i]; + if(node instanceof HTMLElement) + { + var element=node; + element.focus(); + break + } + } + } + }; + var notifyAgave=function OSF__OfficeAppFactory_initialize$notifyAgave(actionId) + { + switch(actionId) + { + case OSF.AgaveHostAction.Select: + me._webAppState.focused=true; + break; + case OSF.AgaveHostAction.UnSelect: + me._webAppState.focused=false; + break; + case OSF.AgaveHostAction.CtrlF6In: + focusFirstItem(); + default: + Sys.Debug.trace("actionId "+actionId+" notifyAgave is wrong."); + break + } + }; + me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",notifyAgave,Microsoft.Office.Common.InvokeType.async,false); + OSF.OUtil.addEventListener(window,"focus",function() + { + if(!me._webAppState.focused) + me._webAppState.focused=true; + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[me._webAppState.id,OSF.AgaveHostAction.Select]) + }); + OSF.OUtil.addEventListener(window,"blur",function() + { + if(me._webAppState.focused) + me._webAppState.focused=false; + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[me._webAppState.id,OSF.AgaveHostAction.UnSelect]) + }); + OSF.OUtil.addEventListener(window,"keydown",function(e) + { + if(e.keyCode==117 && e.ctrlKey) + { + if(e.preventDefault) + e.preventDefault(); + else + e.returnValue=false; + var actionId=OSF.AgaveHostAction.CtrlF6Exit; + if(e.shiftKey) + actionId=OSF.AgaveHostAction.CtrlF6ExitShift; + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[me._webAppState.id,actionId]) + } + }); + OSF.OUtil.addEventListener(window,"keypress",function(e) + { + if(e.keyCode==117 && e.ctrlKey) + if(e.preventDefault) + e.preventDefault(); + else + e.returnValue=false + }) +}; +OSF.getClientEndPoint=function OSF$getClientEndPoint() +{ + var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper(); + return initializationHelper._webAppState.clientEndPoint +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) +{ + var license=new OSF.DDA.License(appContext.get_eToken()); + var isOwa=appContext.get_appName()==OSF.AppName.OutlookWebApp; + if(isOwa) + OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM)); + else + OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM,OSF.DDA.Theming ? OSF.DDA.Theming.getOfficeTheme : null)); + var reason=appContext.get_reason(); + Microsoft.Office.WebExtension.initialize(reason); + if(!isOwa) + OfficeJsClient_OutlookWin32.prepareRightBeforeWebExtensionInitialize() +}; +OSF.DDA.SettingsManager={ + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) + { + var ret={}; + for(var key in settingsCollection) + { + var value=settingsCollection[key]; + try + { + if(JSON) + value=JSON.stringify(value,function dateReplacer(k, v) + { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v + }); + else + value=Sys.Serialization.JavaScriptSerializer.serialize(value); + ret[key]=value + } + catch(ex){} + } + return ret + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) + { + var ret={}; + serializedSettings=serializedSettings || {}; + for(var key in serializedSettings) + { + var value=serializedSettings[key]; + try + { + if(JSON) + value=JSON.parse(value,function dateReviver(k, v) + { + var d; + if(typeof v==="string" && v && v.length > 6 && v.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) + { + d=new Date(parseInt(v.slice(5,-1))); + if(d) + return d + } + return v + }); + else + value=Sys.Serialization.JavaScriptSerializer.deserialize(value,true); + ret[key]=value + } + catch(ex){} + } + return ret + } +}; +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) +{ + Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums"); + Microsoft.Office.WebExtension.MailboxEnums.EntityType={ + MeetingSuggestion: "meetingSuggestion", + TaskSuggestion: "taskSuggestion", + Address: "address", + EmailAddress: "emailAddress", + Url: "url", + PhoneNumber: "phoneNumber", + Contact: "contact", + FlightReservations: "flightReservations", + ParcelDeliveries: "parcelDeliveries" + }; + Microsoft.Office.WebExtension.MailboxEnums.ItemType={ + Message: "message", + Appointment: "appointment" + }; + Microsoft.Office.WebExtension.MailboxEnums.ResponseType={ + None: "none", + Organizer: "organizer", + Tentative: "tentative", + Accepted: "accepted", + Declined: "declined" + }; + Microsoft.Office.WebExtension.MailboxEnums.RecipientType={ + Other: "other", + DistributionList: "distributionList", + User: "user", + ExternalUser: "externalUser" + }; + Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={ + File: "file", + Item: "item" + }; + Microsoft.Office.WebExtension.MailboxEnums.BodyType={ + Text: "text", + Html: "html" + }; + Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType={ + ProgressIndicator: "progressIndicator", + InformationalMessage: "informationalMessage", + ErrorMessage: "errorMessage" + }; + Microsoft.Office.WebExtension.CoercionType={ + Text: "text", + Html: "html" + }; + Type.registerNamespace("OSF.DDA"); + OSF.DDA.OutlookAppOm=function(officeAppContext, targetWindow, appReadyCallback) + { + this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this,this._callAppReadyCallback$p$0); + this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this,this._displayNewAppointmentFormApi$p$0); + this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler); + this.$$d__getEwsUrl$p$0=Function.createDelegate(this,this._getEwsUrl$p$0); + this.$$d__getDiagnostics$p$0=Function.createDelegate(this,this._getDiagnostics$p$0); + this.$$d__getUserProfile$p$0=Function.createDelegate(this,this._getUserProfile$p$0); + this.$$d__getItem$p$0=Function.createDelegate(this,this._getItem$p$0); + this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this,this._getInitialDataResponseHandler$p$0); + OSF.DDA.OutlookAppOm._instance$p=this; + this._officeAppContext$p$0=officeAppContext; + this._appReadyCallback$p$0=appReadyCallback; + var $$t_4=this; + var stringLoadedCallback=function() + { + if(appReadyCallback) + $$t_4._invokeHostMethod$i$0(1,"GetInitialData",null,$$t_4.$$d__getInitialDataResponseHandler$p$0) + }; + if(this._areStringsLoaded$p$0()) + stringLoadedCallback(); + else + this._loadLocalizedScript$p$0(stringLoadedCallback) + }; + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function(currentPermissionLevel) + { + if(!currentPermissionLevel) + throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text); + }; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function(value, minValue, maxValue, argumentName) + { + if(value < minValue || value > maxValue) + throw Error.argumentOutOfRange(argumentName); + }; + OSF.DDA.OutlookAppOm._getHtmlBody$p=function(data) + { + var htmlBody=""; + if("htmlBody" in data) + { + OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p(data["htmlBody"]); + htmlBody=data["htmlBody"] + } + return htmlBody + }; + OSF.DDA.OutlookAppOm._getAttachments$p=function(data) + { + var attachments=[]; + if("attachments" in data) + { + attachments=data["attachments"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p(attachments) + } + return attachments + }; + OSF.DDA.OutlookAppOm._getOptionsAndCallback$p=function(data) + { + var args=[]; + if("options" in data) + args[0]=data["options"]; + if("callback" in data) + args[args.length]=data["callback"]; + return args + }; + OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p=function(attachments) + { + var attachmentsData=new Array(0); + if(Array.isInstanceOfType(attachments)) + for(var i=0; i < attachments.length; i++) + if(Object.isInstanceOfType(attachments[i])) + { + var attachment=attachments[i]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p(attachment); + attachmentsData[i]=OSF.DDA.OutlookAppOm._createAttachmentData$p(attachment) + } + else + throw Error.argument("attachments"); + return attachmentsData + }; + OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p=function(htmlBody) + { + if(!String.isInstanceOfType(htmlBody)) + throw Error.argument("htmlBody"); + if($h.ScriptHelpers.isNullOrUndefined(htmlBody)) + throw Error.argument("htmlBody"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody") + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p=function(attachments) + { + if(!Array.isInstanceOfType(attachments)) + throw Error.argument("attachments"); + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p=function(attachment) + { + if(!Object.isInstanceOfType(attachment)) + throw Error.argument("attachments"); + if(!("type" in attachment) || !("name" in attachment)) + throw Error.argument("attachments"); + if(!("url" in attachment || "itemId" in attachment)) + throw Error.argument("attachments"); + }; + OSF.DDA.OutlookAppOm._createAttachmentData$p=function(attachment) + { + var attachmentData=null; + if(attachment["type"]==="file") + { + var url=attachment["url"]; + var name=attachment["name"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p(url,name); + attachmentData=OSF.DDA.OutlookAppOm._createFileAttachmentData$p(url,name) + } + else if(attachment["type"]==="item") + { + var itemId=attachment["itemId"]; + var name=attachment["name"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p(itemId,name); + attachmentData=OSF.DDA.OutlookAppOm._createItemAttachmentData$p(itemId,name) + } + else + throw Error.argument("attachments"); + return attachmentData + }; + OSF.DDA.OutlookAppOm._createFileAttachmentData$p=function(url, name) + { + return["file",name,url] + }; + OSF.DDA.OutlookAppOm._createItemAttachmentData$p=function(itemId, name) + { + return["item",name,itemId] + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p=function(url, name) + { + if(!String.isInstanceOfType(url) || !String.isInstanceOfType(name)) + throw Error.argument("attachments"); + if(url.length > 2048) + throw Error.argumentOutOfRange("attachments",url.length,_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text); + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name) + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p=function(itemId, name) + { + if(!String.isInstanceOfType(itemId) || !String.isInstanceOfType(name)) + throw Error.argument("attachments"); + if(itemId.length > 200) + throw Error.argumentOutOfRange("attachments",itemId.length,_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text); + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name) + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p=function(name) + { + if(name.length > 255) + throw Error.argumentOutOfRange("attachments",name.length,_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text); + }; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function(value, expectedType, argumentName) + { + if(Object.getType(value) !==expectedType) + throw Error.argumentType(argumentName); + }; + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function(value, minLength, maxLength, name) + { + if($h.ScriptHelpers.isNullOrUndefined(value)) + return; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value,String,name); + var stringValue=value; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(stringValue.length,minLength,maxLength,name) + }; + OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function(dispid, data) + { + var executeParameters=null; + switch(dispid) + { + case 1: + case 2: + case 12: + case 3: + case 14: + case 18: + case 26: + case 32: + case 41: + case 34: + break; + case 4: + var jsonProperty=JSON.stringify(data["customProperties"]); + executeParameters=[jsonProperty]; + break; + case 5: + executeParameters=[data["body"]]; + break; + case 8: + case 9: + executeParameters=[data["itemId"]]; + break; + case 7: + executeParameters=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["requiredAttendees"]),OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["optionalAttendees"]),data["start"],data["end"],data["location"],OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["resources"]),data["subject"],data["body"]]; + break; + case 40: + executeParameters=[data["marketplaceAssetId"],data["consentState"]]; + break; + case 11: + case 10: + executeParameters=[data["htmlBody"]]; + break; + case 31: + case 30: + executeParameters=[data["htmlBody"],data["attachments"]]; + break; + case 23: + case 13: + case 38: + case 29: + executeParameters=[data["data"],data["coercionType"]]; + break; + case 37: + case 28: + executeParameters=[data["coercionType"]]; + break; + case 17: + executeParameters=[data["subject"]]; + break; + case 15: + executeParameters=[data["recipientField"]]; + break; + case 22: + case 21: + executeParameters=[data["recipientField"],OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(data["recipientArray"])]; + break; + case 19: + executeParameters=[data["itemId"],data["name"]]; + break; + case 16: + executeParameters=[data["uri"],data["name"]]; + break; + case 20: + executeParameters=[data["attachmentIndex"]]; + break; + case 25: + executeParameters=[data["TimeProperty"],data["time"]]; + break; + case 24: + executeParameters=[data["TimeProperty"]]; + break; + case 27: + executeParameters=[data["location"]]; + break; + case 33: + case 35: + executeParameters=[data["key"],data["type"],data["persistent"],data["message"],data["icon"]]; + break; + case 36: + executeParameters=[data["key"]]; + break; + default: + Sys.Debug.fail("Unexpected method dispid"); + break + } + return executeParameters + }; + OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(array) + { + return array ? array.join(";") : null + }; + OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function(recipients) + { + if(!recipients) + return null; + var results=new Array(recipients.length); + for(var i=0; i < recipients.length; i++) + results[i]=[recipients[i]["address"],recipients[i]["name"]]; + return results + }; + OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function(emailset, name) + { + if($h.ScriptHelpers.isNullOrUndefined(emailset)) + return null; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset,Array,name); + var originalAttendees=emailset; + var updatedAttendees=null; + var normalizationNeeded=false; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(originalAttendees.length,0,OSF.DDA.OutlookAppOm._maxRecipients$p,String.format("{0}.length",name)); + for(var i=0; i < originalAttendees.length; i++) + if($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) + { + normalizationNeeded=true; + break + } + if(normalizationNeeded) + updatedAttendees=[]; + for(var i=0; i < originalAttendees.length; i++) + if(normalizationNeeded) + { + updatedAttendees[i]=$h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]) ? originalAttendees[i].emailAddress : originalAttendees[i]; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i],String,String.format("{0}[{1}]",name,i)) + } + else + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i],String,String.format("{0}[{1}]",name,i)); + return updatedAttendees + }; + OSF.DDA.OutlookAppOm.prototype={ + _initialData$p$0: null, + _item$p$0: null, + _userProfile$p$0: null, + _diagnostics$p$0: null, + _officeAppContext$p$0: null, + _appReadyCallback$p$0: null, + _clientEndPoint$p$0: null, + get_clientEndPoint: function() + { + if(!this._clientEndPoint$p$0) + this._clientEndPoint$p$0=OSF._OfficeAppFactory.getClientEndPoint(); + return this._clientEndPoint$p$0 + }, + set_clientEndPoint: function(value) + { + this._clientEndPoint$p$0=value; + return value + }, + get_initialData: function() + { + return this._initialData$p$0 + }, + get__appName$i$0: function() + { + return this._officeAppContext$p$0.get_appName() + }, + initialize: function(initialData) + { + var ItemTypeKey="itemType"; + this._initialData$p$0=new $h.InitialData(initialData); + if(1===initialData[ItemTypeKey]) + this._item$p$0=new $h.Message(this._initialData$p$0); + else if(3===initialData[ItemTypeKey]) + this._item$p$0=new $h.MeetingRequest(this._initialData$p$0); + else if(2===initialData[ItemTypeKey]) + this._item$p$0=new $h.Appointment(this._initialData$p$0); + else if(4===initialData[ItemTypeKey]) + this._item$p$0=new $h.MessageCompose(this._initialData$p$0); + else if(5===initialData[ItemTypeKey]) + this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0); + else + Sys.Debug.trace("Unexpected item type was received from the host."); + this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0); + this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0.get_appName()); + this._initializeMethods$p$0(); + $h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"ewsUrl",this.$$d__getEwsUrl$p$0); + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + if(this._initialData$p$0.get__overrideWindowOpen$i$0()) + window.open=this.$$d_windowOpenOverrideHandler + }, + windowOpenOverrideHandler: function(url, targetName, features, replace) + { + this._invokeHostMethod$i$0(0,"LaunchPalUrl",{launchUrl: url},null) + }, + makeEwsRequestAsync: function(data) + { + var args=[]; + for(var $$pai_5=1; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 1]=arguments[$$pai_5]; + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + if(data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) + throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text); + this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0); + var $$t_4=this; + ewsRequest.onreadystatechange=function() + { + if(4===ewsRequest.get__requestState$i$1()) + parameters._callback$p$0(ewsRequest._asyncResult$p$0) + }; + ewsRequest.send(data) + }, + recordDataPoint: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"RecordDataPoint",data,null) + }, + recordTrace: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"RecordTrace",data,null) + }, + trackCtq: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"TrackCtq",data,null) + }, + convertToLocalClientTime: function(timeValue) + { + var date=new Date(timeValue.getTime()); + var offset=date.getTimezoneOffset() * -1; + if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + date.setUTCMinutes(date.getUTCMinutes() - offset); + offset=this._findOffset$p$0(date); + date.setUTCMinutes(date.getUTCMinutes()+offset) + } + var retValue=this._dateToDictionary$i$0(date); + retValue["timezoneOffset"]=offset; + return retValue + }, + convertToUtcClientTime: function(input) + { + var retValue=this._dictionaryToDate$i$0(input); + if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + var offset=this._findOffset$p$0(retValue); + retValue.setUTCMinutes(retValue.getUTCMinutes() - offset); + offset=!input["timezoneOffset"] ? retValue.getTimezoneOffset() * -1 : input["timezoneOffset"]; + retValue.setUTCMinutes(retValue.getUTCMinutes()+offset) + } + return retValue + }, + getUserIdentityTokenAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",parameters._callback$p$0,parameters._asyncContext$p$0) + }, + getCallbackTokenAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",parameters._callback$p$0,parameters._asyncContext$p$0) + }, + displayMessageForm: function(itemId) + { + if($h.ScriptHelpers.isNullOrUndefined(itemId)) + throw Error.argumentNull("itemId"); + this._invokeHostMethod$i$0(8,"DisplayExistingMessageForm",{itemId: itemId},null) + }, + displayAppointmentForm: function(itemId) + { + if($h.ScriptHelpers.isNullOrUndefined(itemId)) + throw Error.argumentNull("itemId"); + this._invokeHostMethod$i$0(9,"DisplayExistingAppointmentForm",{itemId: itemId},null) + }, + RegisterConsentAsync: function(consentState) + { + if(consentState !==2 && consentState !==1 && consentState) + throw Error.argumentOutOfRange("consentState"); + var parameters={}; + parameters["consentState"]=consentState.toString(); + parameters["marketplaceAssetId"]=this.GetMarketplaceAssetId(); + this._invokeHostMethod$i$0(40,"RegisterConsentAsync",parameters,null) + }, + GetIsRead: function() + { + return this._initialData$p$0.get__isRead$i$0() + }, + GetConsentMetadata: function() + { + return this._initialData$p$0.get__consentMetadata$i$0() + }, + GetEntryPointUrl: function() + { + return this._initialData$p$0.get__entryPointUrl$i$0() + }, + GetMarketplaceContentMarket: function() + { + return this._initialData$p$0.get__marketplaceContentMarket$i$0() + }, + GetMarketplaceAssetId: function() + { + return this._initialData$p$0.get__marketplaceAssetId$i$0() + }, + createAsyncResult: function(value, errorCode, detailedErrorCode, userContext, errorMessage) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if(0 !==errorCode) + { + errorArgs={}; + var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorProperties["name"]; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=!errorMessage ? errorProperties["message"] : errorMessage; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=detailedErrorCode + } + return new OSF.DDA.AsyncResult(initArgs,errorArgs) + }, + _throwOnMethodCallForInsufficientPermission$i$0: function(requiredPermissionLevel, methodName) + { + if(this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel) + throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text,methodName)); + }, + _displayReplyForm$i$0: function(obj) + { + this._displayReplyFormHelper$p$0(obj,false) + }, + _displayReplyAllForm$i$0: function(obj) + { + this._displayReplyFormHelper$p$0(obj,true) + }, + _displayReplyFormHelper$p$0: function(obj, isReplyAll) + { + if(String.isInstanceOfType(obj)) + this._doDisplayReplyForm$p$0(obj,isReplyAll); + else if(Object.isInstanceOfType(obj) && Object.getTypeName(obj)==="Object") + { + var data={}; + data=$.extend(true,data,obj); + this._doDisplayReplyFormWithAttachments$p$0(data,isReplyAll) + } + else + throw Error.argumentType(); + }, + _doDisplayReplyForm$p$0: function(htmlBody, isReplyAll) + { + if(!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody"); + this._invokeHostMethod$i$0(isReplyAll ? 11 : 10,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{htmlBody: htmlBody},null) + }, + _doDisplayReplyFormWithAttachments$p$0: function(data, isReplyAll) + { + var htmlBody=OSF.DDA.OutlookAppOm._getHtmlBody$p(data); + var attachments=OSF.DDA.OutlookAppOm._getAttachments$p(data); + var parameters=$h.CommonParameters.parse(OSF.DDA.OutlookAppOm._getOptionsAndCallback$p(data),false); + var $$t_6=this; + this._standardInvokeHostMethod$i$0(isReplyAll ? 31 : 30,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{ + htmlBody: htmlBody, + attachments: OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(attachments) + },function(rawInput) + { + return rawInput + },parameters._asyncContext$p$0,parameters._callback$p$0) + }, + _standardInvokeHostMethod$i$0: function(dispid, name, data, format, userContext, callback) + { + var $$t_C=this; + this._invokeHostMethod$i$0(dispid,name,data,function(resultCode, response) + { + if(callback) + { + var asyncResult=null; + if(Object.isInstanceOfType(response)) + { + var responseDictionary=response; + if("error" in responseDictionary || "data" in responseDictionary || "errorCode" in responseDictionary) + if(!responseDictionary["error"]) + { + var formattedData=format ? format(responseDictionary["data"]) : responseDictionary["data"]; + asyncResult=$$t_C.createAsyncResult(formattedData,0,0,userContext,null) + } + else + { + var errorCode=responseDictionary["errorCode"]; + asyncResult=$$t_C.createAsyncResult(null,1,errorCode,userContext,null) + } + } + if(!asyncResult && resultCode) + asyncResult=$$t_C.createAsyncResult(null,1,9002,userContext,null); + callback(asyncResult) + } + }) + }, + _invokeHostMethod$i$0: function(dispid, name, data, responseCallback) + { + if(64===this._officeAppContext$p$0.get_appName()) + this.get_clientEndPoint().invoke(name,responseCallback,data); + else if(dispid) + { + var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid,data); + var $$t_B=this; + window.external.execute(dispid,executeParameters,function(nativeData, resultCode) + { + if(responseCallback) + { + var responseData=nativeData.toArray(); + var rawData=JSON.parse(responseData[0]); + if(Object.isInstanceOfType(rawData)) + { + var deserializedData=rawData; + if(responseData.length > 1 && responseData[1]) + { + deserializedData["error"]=true; + deserializedData["errorCode"]=responseData[1] + } + else + deserializedData["error"]=false; + responseCallback(resultCode,deserializedData) + } + else if(Number.isInstanceOfType(rawData)) + { + var returnDict={}; + returnDict["error"]=true; + returnDict["errorCode"]=rawData; + responseCallback(resultCode,returnDict) + } + else + throw Error.notImplemented("Return data type from host must be Dictionary or int"); + } + }) + } + else if(responseCallback) + responseCallback(-2,null) + }, + _dictionaryToDate$i$0: function(input) + { + var retValue=new Date(input["year"],input["month"],input["date"],input["hours"],input["minutes"],input["seconds"],!input["milliseconds"] ? 0 : input["milliseconds"]); + if(isNaN(retValue.getTime())) + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + return retValue + }, + _dateToDictionary$i$0: function(input) + { + var retValue={}; + retValue["month"]=input.getMonth(); + retValue["date"]=input.getDate(); + retValue["year"]=input.getFullYear(); + retValue["hours"]=input.getHours(); + retValue["minutes"]=input.getMinutes(); + retValue["seconds"]=input.getSeconds(); + retValue["milliseconds"]=input.getMilliseconds(); + return retValue + }, + _displayNewAppointmentFormApi$p$0: function(parameters) + { + var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["requiredAttendees"],"requiredAttendees"); + var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["optionalAttendees"],"optionalAttendees"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["location"],0,OSF.DDA.OutlookAppOm._maxLocationLength$p,"location"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["body"],0,OSF.DDA.OutlookAppOm.maxBodyLength,"body"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["subject"],0,OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject"); + if(!$h.ScriptHelpers.isNullOrUndefined(parameters["start"])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["start"],Date,"start"); + var startDateTime=parameters["start"]; + parameters["start"]=startDateTime.getTime(); + if(!$h.ScriptHelpers.isNullOrUndefined(parameters["end"])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["end"],Date,"end"); + var endDateTime=parameters["end"]; + if(endDateTime < startDateTime) + throw Error.argumentOutOfRange("end",endDateTime,_u.ExtensibilityStrings.l_InvalidEventDates_Text); + parameters["end"]=endDateTime.getTime() + } + } + var updatedParameters=null; + if(normalizedRequiredAttendees || normalizedOptionalAttendees) + { + updatedParameters={}; + var $$dict_7=parameters; + for(var $$key_8 in $$dict_7) + { + var entry={ + key: $$key_8, + value: $$dict_7[$$key_8] + }; + updatedParameters[entry.key]=entry.value + } + if(normalizedRequiredAttendees) + updatedParameters["requiredAttendees"]=normalizedRequiredAttendees; + if(normalizedOptionalAttendees) + updatedParameters["optionalAttendees"]=normalizedOptionalAttendees + } + this._invokeHostMethod$i$0(7,"DisplayNewAppointmentForm",updatedParameters || parameters,null) + }, + _initializeMethods$p$0: function() + { + var currentInstance=this; + if($h.Item.isInstanceOfType(this._item$p$0)) + currentInstance.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0 + }, + _getInitialDataResponseHandler$p$0: function(resultCode, data) + { + if(resultCode) + return; + this.initialize(data); + this.displayName="mailbox"; + window.setTimeout(this.$$d__callAppReadyCallback$p$0,0) + }, + _callAppReadyCallback$p$0: function() + { + this._appReadyCallback$p$0() + }, + _invokeGetTokenMethodAsync$p$0: function(outlookDispid, methodName, callback, userContext) + { + if($h.ScriptHelpers.isNullOrUndefined(callback)) + throw Error.argumentNull("callback"); + var $$t_8=this; + this._invokeHostMethod$i$0(outlookDispid,methodName,null,function(resultCode, response) + { + var asyncResult; + if(resultCode) + asyncResult=$$t_8.createAsyncResult(null,1,9017,userContext,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode)); + else + { + var responseDictionary=response; + if(responseDictionary["wasSuccessful"]) + asyncResult=$$t_8.createAsyncResult(responseDictionary["token"],0,0,userContext,null); + else + asyncResult=$$t_8.createAsyncResult(null,1,responseDictionary["errorCode"],userContext,responseDictionary["errorMessage"]) + } + callback(asyncResult) + }) + }, + _getItem$p$0: function() + { + return this._item$p$0 + }, + _getUserProfile$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._userProfile$p$0 + }, + _getDiagnostics$p$0: function() + { + return this._diagnostics$p$0 + }, + _getEwsUrl$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._initialData$p$0.get__ewsUrl$i$0() + }, + _findOffset$p$0: function(value) + { + var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0(); + for(var r=0; r < ranges.length; r++) + { + var range=ranges[r]; + var start=parseInt(range["start"]); + var end=parseInt(range["end"]); + if(value.getTime() - start >=0 && value.getTime() - end < 0) + return parseInt(range["offset"]) + } + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + }, + _areStringsLoaded$p$0: function() + { + var stringsLoaded=false; + try + { + stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text) + } + catch($$e_1){} + return stringsLoaded + }, + _loadLocalizedScript$p$0: function(stringLoadedCallback) + { + var url=null; + var baseUrl=""; + var scripts=document.getElementsByTagName("script"); + for(var i=scripts.length - 1; i >=0; i--) + { + var filename=null; + var attributes=scripts[i].attributes; + if(attributes) + { + var attribute=attributes.getNamedItem("src"); + if(attribute) + filename=attribute.value; + if(filename) + { + var debug=false; + filename=filename.toLowerCase(); + var officeIndex=filename.indexOf("office_strings.js"); + if(officeIndex < 0) + { + officeIndex=filename.indexOf("office_strings.debug.js"); + debug=true + } + if(officeIndex > 0 && officeIndex < filename.length) + { + url=filename.replace(debug ? "office_strings.debug.js" : "office_strings.js","outlook_strings.js"); + var languageUrl=filename.substring(0,officeIndex); + var lastIndexOfSlash=languageUrl.lastIndexOf("/",languageUrl.length - 2); + if(lastIndexOfSlash===-1) + lastIndexOfSlash=languageUrl.lastIndexOf("\\",languageUrl.length - 2); + if(lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) + baseUrl=languageUrl.substring(0,lastIndexOfSlash+1); + break + } + } + } + } + if(url) + { + var head=document.getElementsByTagName("head")[0]; + var scriptElement=null; + var $$t_H=this; + var scriptElementCallback=function() + { + if(stringLoadedCallback && (!scriptElement.readyState || scriptElement.readyState && (scriptElement.readyState==="loaded" || scriptElement.readyState==="complete"))) + { + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + stringLoadedCallback() + } + }; + var $$t_I=this; + var failureCallback=function() + { + if(!$$t_I._areStringsLoaded$p$0()) + { + var fallbackUrl=baseUrl+"en-us/"+"outlook_strings.js"; + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + head.appendChild(scriptElement) + } + }; + scriptElement=this._createScriptElement$p$0(url); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + window.setTimeout(failureCallback,2e3); + head.appendChild(scriptElement) + } + }, + _createScriptElement$p$0: function(url) + { + var scriptElement=document.createElement("script"); + scriptElement.type="text/javascript"; + scriptElement.src=url; + return scriptElement + } + }; + OSF.DDA.Settings=function(data) + { + this._rawData$p$0=data + }; + OSF.DDA.Settings._convertFromRawSettings$p=function(rawSettings) + { + if(!rawSettings) + return{}; + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) + { + var outlookSettings=rawSettings["SettingsKey"]; + if(outlookSettings) + return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings) + } + return rawSettings + }; + OSF.DDA.Settings.prototype={ + _rawData$p$0: null, + _settingsData$p$0: null, + get__data$p$0: function() + { + if(!this._settingsData$p$0) + { + this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0); + this._rawData$p$0=null + } + return this._settingsData$p$0 + }, + get: function(name) + { + return this.get__data$p$0()[name] + }, + set: function(name, value) + { + this.get__data$p$0()[name]=value + }, + remove: function(name) + { + delete this.get__data$p$0()[name] + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4]=arguments[$$pai_4]; + var commonParameters=$h.CommonParameters.parse(args,false); + if(JSON.stringify(OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0())).length > 32768) + { + var asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,commonParameters._asyncContext$p$0,""); + var $$t_3=this; + window.setTimeout(function() + { + commonParameters._callback$p$0(asyncResult) + },0); + return + } + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + this._saveSettingsForOwa$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0); + else + this._saveSettingsForOutlook$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0) + }, + _saveSettingsForOutlook$p$0: function(callback, userContext) + { + var storedException=null; + try + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var jsonSettings=JSON.stringify(serializedSettings); + var settingsObjectToSave={SettingsKey: jsonSettings}; + OSF.DDA.ClientSettingsManager.write(settingsObjectToSave) + } + catch(ex) + { + storedException=ex + } + if(callback) + { + var asyncResult; + if(storedException) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,userContext,storedException.message); + else + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,userContext,null); + callback(asyncResult) + } + }, + _saveSettingsForOwa$p$0: function(callback, userContext) + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var $$t_7=this; + OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(resultCode, response) + { + if(callback) + { + var asyncResult; + if(resultCode) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9017,userContext,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode)); + else + { + var responseDictionary=response; + if(!responseDictionary["error"]) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,userContext,null); + else + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,userContext,responseDictionary["errorMessage"]) + } + callback(asyncResult) + } + },[serializedSettings]) + } + }; + Type.registerNamespace("$h"); + Type.registerNamespace("Office.cast"); + $h.Appointment=function(dataDictionary) + { + this.$$d__getOrganizer$p$2=Function.createDelegate(this,this._getOrganizer$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2); + this.$$d__getResources$p$2=Function.createDelegate(this,this._getResources$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2); + this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2); + $h.Appointment.initializeBase(this,[dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$2) + }; + $h.Appointment.prototype={ + getEntities: function() + { + return this._data$p$0._getEntities$i$0() + }, + getEntitiesByType: function(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, + getRegExMatches: function() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches"); + return this._data$p$0._getRegExMatches$i$0() + }, + getFilteredEntitiesByName: function(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, + getRegExMatchesByName: function(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName"); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, + displayReplyForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj) + }, + displayReplyAllForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj) + }, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, + _getStart$p$2: function() + { + return this._data$p$0.get__start$i$0() + }, + _getEnd$p$2: function() + { + return this._data$p$0.get__end$i$0() + }, + _getLocation$p$2: function() + { + return this._data$p$0.get__location$i$0() + }, + _getOptionalAttendees$p$2: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getRequiredAttendees$p$2: function() + { + return this._data$p$0.get__to$i$0() + }, + _getResources$p$2: function() + { + return this._data$p$0.get__resources$i$0() + }, + _getSubject$p$2: function() + { + return this._data$p$0.get__subject$i$0() + }, + _getNormalizedSubject$p$2: function() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, + _getOrganizer$p$2: function() + { + return this._data$p$0.get__organizer$i$0() + } + }; + $h.AppointmentCompose=function(data) + { + this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2); + $h.AppointmentCompose.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2) + }; + $h.AppointmentCompose.prototype={ + _requiredAttendees$p$2: null, + _optionalAttendees$p$2: null, + _start$p$2: null, + _end$p$2: null, + _location$p$2: null, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, + _getRequiredAttendees$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._requiredAttendees$p$2) + this._requiredAttendees$p$2=new $h.ComposeRecipient(0,"requiredAttendees"); + return this._requiredAttendees$p$2 + }, + _getOptionalAttendees$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._optionalAttendees$p$2) + this._optionalAttendees$p$2=new $h.ComposeRecipient(1,"optionalAttendees"); + return this._optionalAttendees$p$2 + }, + _getStart$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._start$p$2) + this._start$p$2=new $h.ComposeTime(1); + return this._start$p$2 + }, + _getEnd$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._end$p$2) + this._end$p$2=new $h.ComposeTime(2); + return this._end$p$2 + }, + _getLocation$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._location$p$2) + this._location$p$2=new $h.ComposeLocation; + return this._location$p$2 + } + }; + $h.AttachmentConstants=function(){}; + $h.AttachmentDetails=function(data) + { + this.$$d__getIsInline$p$0=Function.createDelegate(this,this._getIsInline$p$0); + this.$$d__getAttachmentType$p$0=Function.createDelegate(this,this._getAttachmentType$p$0); + this.$$d__getSize$p$0=Function.createDelegate(this,this._getSize$p$0); + this.$$d__getContentType$p$0=Function.createDelegate(this,this._getContentType$p$0); + this.$$d__getName$p$0=Function.createDelegate(this,this._getName$p$0); + this.$$d__getId$p$0=Function.createDelegate(this,this._getId$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"id",this.$$d__getId$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"name",this.$$d__getName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contentType",this.$$d__getContentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"size",this.$$d__getSize$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"attachmentType",this.$$d__getAttachmentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"isInline",this.$$d__getIsInline$p$0) + }; + $h.AttachmentDetails.prototype={ + _data$p$0: null, + _getId$p$0: function() + { + return this._data$p$0["id"] + }, + _getName$p$0: function() + { + return this._data$p$0["name"] + }, + _getContentType$p$0: function() + { + return this._data$p$0["contentType"] + }, + _getSize$p$0: function() + { + return this._data$p$0["size"] + }, + _getAttachmentType$p$0: function() + { + var response=this._data$p$0["attachmentType"]; + return response < $h.AttachmentDetails._attachmentTypeMap$p.length ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File + }, + _getIsInline$p$0: function() + { + return this._data$p$0["isInline"] + } + }; + $h.Body=function(){}; + $h.Body._createParameterDictionaryToHost$i=function(data, parameters) + { + var dataToHost={data: data}; + if(parameters._options$p$0 && !$h.ScriptHelpers.isNull(parameters._options$p$0["coercionType"])) + { + var hostCoercionType; + var $$t_4, + $$t_5; + if(!($$t_5=$h.Body._tryMapToHostCoercionType$i(parameters._options$p$0["coercionType"],$$t_4={val: hostCoercionType}),hostCoercionType=$$t_4.val,$$t_5)) + { + if(parameters._callback$p$0) + parameters._callback$p$0(OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,1e3,parameters._asyncContext$p$0,null)); + return null + } + dataToHost["coercionType"]=hostCoercionType + } + else + dataToHost["coercionType"]=0; + return dataToHost + }; + $h.Body._tryMapToHostCoercionType$i=function(coercionType, hostCoercionType) + { + hostCoercionType.val=undefined; + if(coercionType===Microsoft.Office.WebExtension.CoercionType.Html) + hostCoercionType.val=3; + else if(coercionType===Microsoft.Office.WebExtension.CoercionType.Text) + hostCoercionType.val=0; + else + return false; + return true + }; + $h.Body.prototype={getAsync: function() + { + var args=[]; + for(var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getAsync"); + var commonParameters=$h.CommonParameters.parse(args,true); + var dataToHost=$h.Body._createParameterDictionaryToHost$i(null,commonParameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(37,"GetBodyAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }}; + $h.ComposeBody=function() + { + $h.ComposeBody.initializeBase(this) + }; + $h.ComposeBody.prototype={ + getTypeAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14,"GetBodyTypeAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setSelectedDataAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.Body._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13,"BodySetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + prependAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.Body._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23,"BodyPrependAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.Body._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(38,"SetBodyAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeItem=function(data) + { + this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1); + $h.ComposeItem.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1) + }; + $h.ComposeItem.prototype={ + _subject$p$1: null, + _body$p$1: null, + addFileAttachmentAsync: function(uri, attachmentName) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(uri)) + throw Error.argument("uri"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + throw Error.argument("attachmentName"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(uri.length,0,2048,"uri"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName"); + var commonParameters=$h.CommonParameters.parse(args,false); + var parameters={ + uri: uri, + name: attachmentName, + __timeout__: 6e5 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16,"AddFileAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + addItemAttachmentAsync: function(itemId, attachmentName) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(itemId)) + throw Error.argument("itemId"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + throw Error.argument("attachmentName"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(itemId.length,0,200,"itemId"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName"); + var commonParameters=$h.CommonParameters.parse(args,false); + var parameters={ + itemId: itemId, + name: attachmentName, + __timeout__: 6e5 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19,"AddItemAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + removeAttachmentAsync: function(attachmentId) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentId)) + throw Error.argument("attachmentId"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentId.length,0,200,"attachmentId"); + var commonParameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20,"RemoveAttachmentAsync",{attachmentIndex: attachmentId},null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + getSelectedDataAsync: function(coercionType) + { + var args=[]; + for(var $$pai_7=1; $$pai_7 < arguments.length;++$$pai_7) + args[$$pai_7 - 1]=arguments[$$pai_7]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync"); + var commonParameters=$h.CommonParameters.parse(args,true); + var hostCoercionType; + var $$t_5, + $$t_6; + if(coercionType !==Microsoft.Office.WebExtension.CoercionType.Html && coercionType !==Microsoft.Office.WebExtension.CoercionType.Text || !($$t_6=$h.Body._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5.val,$$t_6)) + throw Error.argument("coercionType"); + var dataToHost={coercionType: hostCoercionType}; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(28,"GetSelectedDataAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + setSelectedDataAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.Body._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(29,"SetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + close: function() + { + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(41,"Close",null,null,null,null) + }, + _getBody$p$1: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._body$p$1) + this._body$p$1=new $h.ComposeBody; + return this._body$p$1 + }, + _getSubject$p$1: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._subject$p$1) + this._subject$p$1=new $h.ComposeSubject; + return this._subject$p$1 + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"saveAsync"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(32,"SaveAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeRecipient=function(type, propertyName) + { + this._type$p$0=type; + this._propertyName$p$0=propertyName + }; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(displayName, emailAddress) + { + if(!displayName && !emailAddress) + throw Error.argument("recipients"); + if(displayName && displayName.length > 255) + throw Error.argumentOutOfRange("recipients",displayName.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text); + if(emailAddress && emailAddress.length > 571) + throw Error.argumentOutOfRange("recipients",emailAddress.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text); + }; + $h.ComposeRecipient._getAsyncFormatter$p=function(rawInput) + { + var input=rawInput; + var output=[]; + for(var i=0; i < input.length; i++) + { + var email=new $h.EmailAddressDetails(input[i]); + output[i]=email + } + return output + }; + $h.ComposeRecipient._createEmailDictionaryForHost$p=function(address, name) + { + return{ + address: address, + name: name + } + }; + $h.ComposeRecipient.prototype={ + _propertyName$p$0: null, + _type$p$0: 0, + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._propertyName$p$0+".getAsync"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15,"GetRecipientsAsync",{recipientField: this._type$p$0},$h.ComposeRecipient._getAsyncFormatter$p,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(recipients) + { + var args=[]; + for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2 - 1]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync"); + this.setAddHelper(recipients,args,true) + }, + addAsync: function(recipients) + { + var args=[]; + for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2 - 1]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync"); + this.setAddHelper(recipients,args,false) + }, + setAddHelper: function(recipients, args, isSet) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(recipients.length,0,100,"recipients"); + var parameters=$h.CommonParameters.parse(args,false); + var recipientData=[]; + if(Array.isInstanceOfType(recipients)) + for(var i=0; i < recipients.length; i++) + if(String.isInstanceOfType(recipients[i])) + { + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i],recipients[i]); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i],recipients[i]) + } + else if($h.EmailAddressDetails.isInstanceOfType(recipients[i])) + { + var address=recipients[i]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address.displayName,address.emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address.emailAddress,address.displayName) + } + else if(Object.isInstanceOfType(recipients[i])) + { + var input=recipients[i]; + var emailAddress=input["emailAddress"]; + var displayName=input["displayName"]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName,emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress,displayName) + } + else + throw Error.argument("recipients"); + else + throw Error.argument("recipients"); + var $$t_B=this; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(isSet ? 21 : 22,isSet ? "SetRecipientsAsync" : "AddRecipientsAsync",{ + recipientField: this._type$p$0, + recipientArray: recipientData + },function(rawInput) + { + return rawInput + },parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeRecipient.RecipientField=function(){}; + $h.ComposeRecipient.RecipientField.prototype={ + to: 0, + cc: 1, + bcc: 2, + requiredAttendees: 0, + optionalAttendees: 1 + }; + $h.ComposeRecipient.RecipientField.registerEnum("$h.ComposeRecipient.RecipientField",false); + $h.ComposeLocation=function(){}; + $h.ComposeLocation.prototype={ + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26,"GetLocationAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(location) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(location.length,0,255,"location"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27,"SetLocationAsync",{location: location},null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeSubject=function(){}; + $h.ComposeSubject.prototype={ + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18,"GetSubjectAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(data) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync"); + if(!String.isInstanceOfType(data)) + throw Error.argument("data"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,255,"data"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17,"SetSubjectAsync",{subject: data},null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeTime=function(type) + { + this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0); + this._timeType$p$0=type + }; + $h.ComposeTime.prototype={ + _timeType$p$0: 0, + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24,"GetTimeAsync",{TimeProperty: this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(dateTime) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync"); + if(!Date.isInstanceOfType(dateTime)) + throw Error.argumentType("dateTime",Object.getType(dateTime),Date); + if(isNaN(dateTime.getTime())) + throw Error.argument("dateTime"); + if(dateTime.getTime() < -864e13 || dateTime.getTime() > 864e13) + throw Error.argumentOutOfRange("dateTime"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25,"SetTimeAsync",{ + TimeProperty: this._timeType$p$0, + time: dateTime.getTime() + },null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + _ticksToDateFormatter$p$0: function(rawInput) + { + var ticks=rawInput; + return new Date(ticks) + }, + _getPropertyName$p$0: function() + { + return this._timeType$p$0===1 ? "start" : "end" + } + }; + $h.ComposeTime.TimeType=function(){}; + $h.ComposeTime.TimeType.prototype={ + start: 1, + end: 2 + }; + $h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",false); + $h.Contact=function(data) + { + this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0); + this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0); + this.$$d__getPersonName$p$0=Function.createDelegate(this,this._getPersonName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"personName",this.$$d__getPersonName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"businessName",this.$$d__getBusinessName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contactString",this.$$d__getContactString$p$0) + }; + $h.Contact.prototype={ + _data$p$0: null, + _phoneNumbers$p$0: null, + _getPersonName$p$0: function() + { + return this._data$p$0["PersonName"] + }, + _getBusinessName$p$0: function() + { + return this._data$p$0["BusinessName"] + }, + _getAddresses$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses") + }, + _getEmailAddresses$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses") + }, + _getUrls$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls") + }, + _getPhoneNumbers$p$0: function() + { + if(!this._phoneNumbers$p$0) + { + var $$t_1=this; + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",function(data) + { + return new $h.PhoneNumber(data) + }) + } + return this._phoneNumbers$p$0 + }, + _getContactString$p$0: function() + { + return this._data$p$0["ContactString"] + } + }; + $h.CustomProperties=function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + if(Array.isInstanceOfType(data)) + { + var customPropertiesArray=data; + if(customPropertiesArray.length > 0) + this._data$p$0=customPropertiesArray[0]; + else + throw Error.argument("data"); + } + else + this._data$p$0=data + }; + $h.CustomProperties.prototype={ + _data$p$0: null, + get: function(name) + { + var value=this._data$p$0[name]; + if(typeof value==="string") + { + var valueString=value; + if(valueString.length > 6 && valueString.startsWith("Date(") && valueString.endsWith(")")) + { + var ticksString=valueString.substring(5,valueString.length - 1); + var ticks=parseInt(ticksString); + if(!isNaN(ticks)) + { + var dateTimeValue=new Date(ticks); + if(dateTimeValue) + value=dateTimeValue + } + } + } + return value + }, + set: function(name, value) + { + if(OSF.OUtil.isDate(value)) + value="Date("+value.getTime()+")"; + this._data$p$0[name]=value + }, + remove: function(name) + { + delete this._data$p$0[name] + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4]=arguments[$$pai_4]; + var MaxCustomPropertiesLength=2500; + if(JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) + throw Error.argument(); + var parameters=$h.CommonParameters.parse(args,false,true); + var saveCustomProperties=new $h.SaveDictionaryRequest(parameters._callback$p$0,parameters._asyncContext$p$0); + saveCustomProperties._sendRequest$i$0(4,"SaveCustomProperties",{customProperties: this._data$p$0}) + } + }; + $h.Diagnostics=function(data, appName) + { + this.$$d__getOwaView$p$0=Function.createDelegate(this,this._getOwaView$p$0); + this.$$d__getHostVersion$p$0=Function.createDelegate(this,this._getHostVersion$p$0); + this.$$d__getHostName$p$0=Function.createDelegate(this,this._getHostName$p$0); + this._data$p$0=data; + this._appName$p$0=appName; + $h.InitialData._defineReadOnlyProperty$i(this,"hostName",this.$$d__getHostName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"hostVersion",this.$$d__getHostVersion$p$0); + if(64===this._appName$p$0) + $h.InitialData._defineReadOnlyProperty$i(this,"OWAView",this.$$d__getOwaView$p$0) + }; + $h.Diagnostics.prototype={ + _data$p$0: null, + _appName$p$0: 0, + _getHostName$p$0: function() + { + if(8===this._appName$p$0) + return"Outlook"; + else if(64===this._appName$p$0) + return"OutlookWebApp"; + return null + }, + _getHostVersion$p$0: function() + { + return this._data$p$0.get__hostVersion$i$0() + }, + _getOwaView$p$0: function() + { + return this._data$p$0.get__owaView$i$0() + } + }; + $h.EmailAddressDetails=function(data) + { + this.$$d__getRecipientType$p$0=Function.createDelegate(this,this._getRecipientType$p$0); + this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this,this._getAppointmentResponse$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0); + if($h.ScriptHelpers.dictionaryContainsKey(data,"appointmentResponse")) + $h.InitialData._defineReadOnlyProperty$i(this,"appointmentResponse",this.$$d__getAppointmentResponse$p$0); + if($h.ScriptHelpers.dictionaryContainsKey(data,"recipientType")) + $h.InitialData._defineReadOnlyProperty$i(this,"recipientType",this.$$d__getRecipientType$p$0) + }; + $h.EmailAddressDetails._createFromEmailUserDictionary$i=function(data) + { + var emailAddressDetailsDictionary={}; + var displayName=data["Name"]; + var emailAddress=data["UserId"]; + emailAddressDetailsDictionary["name"]=displayName || $h.EmailAddressDetails._emptyString$p; + emailAddressDetailsDictionary["address"]=emailAddress || $h.EmailAddressDetails._emptyString$p; + return new $h.EmailAddressDetails(emailAddressDetailsDictionary) + }; + $h.EmailAddressDetails.prototype={ + _data$p$0: null, + toJSON: function() + { + var result={}; + result["emailAddress"]=this._getEmailAddress$p$0(); + result["displayName"]=this._getDisplayName$p$0(); + if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"appointmentResponse")) + result["appointmentResponse"]=this._getAppointmentResponse$p$0(); + if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"recipientType")) + result["recipientType"]=this._getRecipientType$p$0(); + return result + }, + _getEmailAddress$p$0: function() + { + return this._data$p$0["address"] + }, + _getDisplayName$p$0: function() + { + return this._data$p$0["name"] + }, + _getAppointmentResponse$p$0: function() + { + var response=this._data$p$0["appointmentResponse"]; + return response < $h.EmailAddressDetails._responseTypeMap$p.length ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None + }, + _getRecipientType$p$0: function() + { + var response=this._data$p$0["recipientType"]; + return response < $h.EmailAddressDetails._recipientTypeMap$p.length ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other + } + }; + $h.Entities=function(data, filteredEntitiesData, timeSent, permissionLevel) + { + this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this,this._createMeetingSuggestion$p$0); + this.$$d__getParcelDeliveries$p$0=Function.createDelegate(this,this._getParcelDeliveries$p$0); + this.$$d__getFlightReservations$p$0=Function.createDelegate(this,this._getFlightReservations$p$0); + this.$$d__getContacts$p$0=Function.createDelegate(this,this._getContacts$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0); + this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this,this._getMeetingSuggestions$p$0); + this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this,this._getTaskSuggestions$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0); + this._data$p$0=data || {}; + this._filteredData$p$0=filteredEntitiesData || {}; + this._dateTimeSent$p$0=timeSent; + $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"taskSuggestions",this.$$d__getTaskSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"meetingSuggestions",this.$$d__getMeetingSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contacts",this.$$d__getContacts$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"flightReservations",this.$$d__getFlightReservations$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"parcelDeliveries",this.$$d__getParcelDeliveries$p$0); + this._permissionLevel$p$0=permissionLevel + }; + $h.Entities._getExtractedObjects$i=function(T, data, name, creator, removeDuplicates, stringPropertyName) + { + var results=null; + var extractedObjects=data[name]; + if(!extractedObjects) + return new Array(0); + if(removeDuplicates) + extractedObjects=$h.Entities._removeDuplicate$p(Object,extractedObjects,$h.Entities._entityDictionaryEquals$p,stringPropertyName); + results=new Array(extractedObjects.length); + var count=0; + for(var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) + { + var extractedObject=$$arr_9[$$idx_B]; + if(creator) + results[count++]=creator(extractedObject); + else + results[count++]=extractedObject + } + return results + }; + $h.Entities._getExtractedStringProperty$i=function(data, name, removeDuplicate) + { + var extractedProperties=data[name]; + if(!extractedProperties) + return new Array(0); + if(removeDuplicate) + extractedProperties=$h.Entities._removeDuplicate$p(String,extractedProperties,$h.Entities._stringEquals$p,null); + return extractedProperties + }; + $h.Entities._createContact$p=function(data) + { + return new $h.Contact(data) + }; + $h.Entities._createTaskSuggestion$p=function(data) + { + return new $h.TaskSuggestion(data) + }; + $h.Entities._createPhoneNumber$p=function(data) + { + return new $h.PhoneNumber(data) + }; + $h.Entities._entityDictionaryEquals$p=function(dictionary1, dictionary2, entityPropertyIdentifier) + { + if(dictionary1===dictionary2) + return true; + if(!dictionary1 || !dictionary2) + return false; + if(dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) + return true; + return false + }; + $h.Entities._stringEquals$p=function(string1, string2, entityProperty) + { + return string1===string2 + }; + $h.Entities._removeDuplicate$p=function(T, array, entityEquals, entityPropertyIdentifier) + { + for(var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) + { + var removeMatch=false; + for(var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) + if(entityEquals(array[matchIndex1],array[matchIndex2],entityPropertyIdentifier)) + { + removeMatch=true; + break + } + if(removeMatch) + Array.removeAt(array,matchIndex1) + } + return array + }; + $h.Entities.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _filteredData$p$0: null, + _filteredEntitiesCache$p$0: null, + _permissionLevel$p$0: 0, + _taskSuggestions$p$0: null, + _meetingSuggestions$p$0: null, + _phoneNumbers$p$0: null, + _contacts$p$0: null, + _addresses$p$0: null, + _emailAddresses$p$0: null, + _urls$p$0: null, + _flightReservations$p$0: null, + _parcelDeliveries$p$0: null, + _getByType$i$0: function(entityType) + { + if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) + return this._getMeetingSuggestions$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) + return this._getTaskSuggestions$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) + return this._getAddresses$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) + return this._getPhoneNumbers$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) + return this._getEmailAddresses$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) + return this._getUrls$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) + return this._getContacts$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.FlightReservations) + return this._getFlightReservations$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.ParcelDeliveries) + return this._getParcelDeliveries$p$0(); + return null + }, + _getFilteredEntitiesByName$i$0: function(name) + { + if(!this._filteredEntitiesCache$p$0) + this._filteredEntitiesCache$p$0={}; + if(!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0,name)) + { + var found=false; + for(var i=0; i < $h.Entities._allEntityKeys$p.length; i++) + { + var entityTypeKey=$h.Entities._allEntityKeys$p[i]; + var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey]; + if(!perEntityTypeDictionary) + continue; + if($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary,name)) + { + switch(entityTypeKey) + { + case"EmailAddresses": + case"Urls": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name); + break; + case"Addresses": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name,true); + break; + case"PhoneNumbers": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber,perEntityTypeDictionary,name,$h.Entities._createPhoneNumber$p,false,null); + break; + case"TaskSuggestions": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,perEntityTypeDictionary,name,$h.Entities._createTaskSuggestion$p,true,"TaskString"); + break; + case"MeetingSuggestions": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,perEntityTypeDictionary,name,this.$$d__createMeetingSuggestion$p$0,true,"MeetingString"); + break; + case"Contacts": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact,perEntityTypeDictionary,name,$h.Entities._createContact$p,true,"ContactString"); + break + } + found=true; + break + } + } + if(!found) + this._filteredEntitiesCache$p$0[name]=null + } + return this._filteredEntitiesCache$p$0[name] + }, + _createMeetingSuggestion$p$0: function(data) + { + return new $h.MeetingSuggestion(data,this._dateTimeSent$p$0) + }, + _getAddresses$p$0: function() + { + if(!this._addresses$p$0) + this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses",true); + return this._addresses$p$0 + }, + _getEmailAddresses$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._emailAddresses$p$0) + this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses",false); + return this._emailAddresses$p$0 + }, + _getUrls$p$0: function() + { + if(!this._urls$p$0) + this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls",false); + return this._urls$p$0 + }, + _getPhoneNumbers$p$0: function() + { + if(!this._phoneNumbers$p$0) + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",$h.Entities._createPhoneNumber$p); + return this._phoneNumbers$p$0 + }, + _getTaskSuggestions$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._taskSuggestions$p$0) + this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,this._data$p$0,"TaskSuggestions",$h.Entities._createTaskSuggestion$p,true,"TaskString"); + return this._taskSuggestions$p$0 + }, + _getMeetingSuggestions$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._meetingSuggestions$p$0) + this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,this._data$p$0,"MeetingSuggestions",this.$$d__createMeetingSuggestion$p$0,true,"MeetingString"); + return this._meetingSuggestions$p$0 + }, + _getContacts$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._contacts$p$0) + this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact,this._data$p$0,"Contacts",$h.Entities._createContact$p,true,"ContactString"); + return this._contacts$p$0 + }, + _getParcelDeliveries$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._parcelDeliveries$p$0) + this._parcelDeliveries$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"ParcelDeliveries",null); + return this._parcelDeliveries$p$0 + }, + _getFlightReservations$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._flightReservations$p$0) + this._flightReservations$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"FlightReservations",null); + return this._flightReservations$p$0 + } + }; + $h.ReplyConstants=function(){}; + $h.AsyncConstants=function(){}; + Office.cast.item=function(){}; + Office.cast.item.toItemRead=function(item) + { + if($h.Item.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toItemCompose=function(item) + { + if($h.ComposeItem.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toMessage=function(item) + { + return Office.cast.item.toMessageRead(item) + }; + Office.cast.item.toMessageRead=function(item) + { + if($h.Message.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toMessageCompose=function(item) + { + if($h.MessageCompose.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toMeetingRequest=function(item) + { + if($h.MeetingRequest.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toAppointment=function(item) + { + return Office.cast.item.toAppointmentRead(item) + }; + Office.cast.item.toAppointmentRead=function(item) + { + if($h.Appointment.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toAppointmentCompose=function(item) + { + if($h.AppointmentCompose.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + $h.Item=function(data) + { + this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1); + this.$$d__getAttachments$p$1=Function.createDelegate(this,this._getAttachments$p$1); + this.$$d__getItemClass$p$1=Function.createDelegate(this,this._getItemClass$p$1); + this.$$d__getItemId$p$1=Function.createDelegate(this,this._getItemId$p$1); + this.$$d__getDateTimeModified$p$1=Function.createDelegate(this,this._getDateTimeModified$p$1); + this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this,this._getDateTimeCreated$p$1); + $h.Item.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeCreated",this.$$d__getDateTimeCreated$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeModified",this.$$d__getDateTimeModified$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"itemId",this.$$d__getItemId$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"itemClass",this.$$d__getItemClass$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"attachments",this.$$d__getAttachments$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1) + }; + $h.Item.prototype={ + _body$p$1: null, + _getItemId$p$1: function() + { + return this._data$p$0.get__itemId$i$0() + }, + _getItemClass$p$1: function() + { + return this._data$p$0.get__itemClass$i$0() + }, + _getDateTimeCreated$p$1: function() + { + return this._data$p$0.get__dateTimeCreated$i$0() + }, + _getDateTimeModified$p$1: function() + { + return this._data$p$0.get__dateTimeModified$i$0() + }, + _getAttachments$p$1: function() + { + return this._data$p$0.get__attachments$i$0() + }, + _getBody$p$1: function() + { + if(!this._body$p$1) + this._body$p$1=new $h.Body; + return this._body$p$1 + } + }; + $h.ItemBase=function(data) + { + this.$$d__createCustomProperties$i$0=Function.createDelegate(this,this._createCustomProperties$i$0); + this.$$d__getNotificationMessages$p$0=Function.createDelegate(this,this._getNotificationMessages$p$0); + this.$$d_getItemType=Function.createDelegate(this,this.getItemType); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"itemType",this.$$d_getItemType); + $h.InitialData._defineReadOnlyProperty$i(this,"notificationMessages",this.$$d__getNotificationMessages$p$0) + }; + $h.ItemBase.prototype={ + _data$p$0: null, + _notificationMessages$p$0: null, + get_data: function() + { + return this._data$p$0 + }, + loadCustomPropertiesAsync: function() + { + var args=[]; + for(var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3]=arguments[$$pai_3]; + var parameters=$h.CommonParameters.parse(args,true,true); + var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0,"customProperties",parameters._callback$p$0,parameters._asyncContext$p$0); + loadCustomProperties._sendRequest$i$0(3,"LoadCustomProperties",{}) + }, + _createCustomProperties$i$0: function(data) + { + return new $h.CustomProperties(data) + }, + _getNotificationMessages$p$0: function() + { + if(!this._notificationMessages$p$0) + this._notificationMessages$p$0=new $h.NotificationMessages; + return this._notificationMessages$p$0 + } + }; + $h.MeetingRequest=function(data) + { + this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this,this._getRequiredAttendees$p$3); + this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this,this._getOptionalAttendees$p$3); + this.$$d__getLocation$p$3=Function.createDelegate(this,this._getLocation$p$3); + this.$$d__getEnd$p$3=Function.createDelegate(this,this._getEnd$p$3); + this.$$d__getStart$p$3=Function.createDelegate(this,this._getStart$p$3); + $h.MeetingRequest.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$3) + }; + $h.MeetingRequest.prototype={ + _getStart$p$3: function() + { + return this._data$p$0.get__start$i$0() + }, + _getEnd$p$3: function() + { + return this._data$p$0.get__end$i$0() + }, + _getLocation$p$3: function() + { + return this._data$p$0.get__location$i$0() + }, + _getOptionalAttendees$p$3: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getRequiredAttendees$p$3: function() + { + return this._data$p$0.get__to$i$0() + } + }; + $h.MeetingSuggestion=function(data, dateTimeSent) + { + this.$$d__getEndTime$p$0=Function.createDelegate(this,this._getEndTime$p$0); + this.$$d__getStartTime$p$0=Function.createDelegate(this,this._getStartTime$p$0); + this.$$d__getSubject$p$0=Function.createDelegate(this,this._getSubject$p$0); + this.$$d__getLocation$p$0=Function.createDelegate(this,this._getLocation$p$0); + this.$$d__getAttendees$p$0=Function.createDelegate(this,this._getAttendees$p$0); + this.$$d__getMeetingString$p$0=Function.createDelegate(this,this._getMeetingString$p$0); + this._data$p$0=data; + this._dateTimeSent$p$0=dateTimeSent; + $h.InitialData._defineReadOnlyProperty$i(this,"meetingString",this.$$d__getMeetingString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"attendees",this.$$d__getAttendees$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStartTime$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEndTime$p$0) + }; + $h.MeetingSuggestion.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _attendees$p$0: null, + _getMeetingString$p$0: function() + { + return this._data$p$0["MeetingString"] + }, + _getLocation$p$0: function() + { + return this._data$p$0["Location"] + }, + _getSubject$p$0: function() + { + return this._data$p$0["Subject"] + }, + _getStartTime$p$0: function() + { + var time=this._createDateTimeFromParameter$p$0("StartTime"); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0); + if(resolvedTime.getTime() !==time.getTime()) + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + return time + }, + _getEndTime$p$0: function() + { + var time=this._createDateTimeFromParameter$p$0("EndTime"); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0); + if(resolvedTime.getTime() !==time.getTime()) + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + return time + }, + _createDateTimeFromParameter$p$0: function(keyName) + { + var dateTimeString=this._data$p$0[keyName]; + if(!dateTimeString) + return null; + return new Date(dateTimeString) + }, + _getAttendees$p$0: function() + { + if(!this._attendees$p$0) + { + var $$t_1=this; + this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Attendees",function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._attendees$p$0 + } + }; + $h.MeetingSuggestionTimeDecoder=function(){}; + $h.MeetingSuggestionTimeDecoder.resolve=function(inTime, sentTime) + { + if(!sentTime) + return inTime; + try + { + var tod; + var outDate; + var extractedDate; + var sentDate=new Date(sentTime.getFullYear(),sentTime.getMonth(),sentTime.getDate(),0,0,0,0); + var $$t_7, + $$t_8, + $$t_9; + if(!($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime,$$t_7={val: extractedDate},$$t_8={val: tod}),extractedDate=$$t_7.val,tod=$$t_8.val,$$t_9)) + return inTime; + else + { + if($h._preciseDate.isInstanceOfType(extractedDate)) + outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate,extractedDate); + else if($h._relativeDate.isInstanceOfType(extractedDate)) + outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate,extractedDate); + else + outDate=sentDate; + if(isNaN(outDate.getTime())) + return sentTime; + outDate.setMilliseconds(outDate.getMilliseconds()+tod); + return outDate + } + } + catch($$e_6) + { + return sentTime + } + }; + $h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function(value) + { + return null===value || value===undefined + }; + $h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function(sentDate, precise) + { + var year=precise._year$i$1; + var month=!precise._month$i$1 ? sentDate.getMonth() : precise._month$i$1 - 1; + var day=precise._day$i$1; + if(!day) + return sentDate; + var candidate; + if($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + candidate=new Date(sentDate.getFullYear(),month,day); + if(candidate.getTime() < sentDate.getTime()) + candidate=new Date(sentDate.getFullYear()+1,month,day) + } + else + candidate=new Date(year < 50 ? 2e3+year : 1900+year,month,day); + if(candidate.getMonth() !==month) + return sentDate; + return candidate + }; + $h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function(sentDate, relative) + { + var date; + switch(relative._unit$i$1) + { + case 0: + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate()); + date.setDate(date.getDate()+relative._offset$i$1); + return date; + case 5: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate,relative._offset$i$1,relative._tag$i$1); + case 2: + var days=1; + switch(relative._modifier$i$1) + { + case 1: + break; + case 2: + days=16; + break; + default: + if(!relative._offset$i$1) + days=sentDate.getDate(); + break + } + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),days); + date.setMonth(date.getMonth()+relative._offset$i$1); + if(date.getTime() < sentDate.getTime()) + date.setDate(date.getDate()+sentDate.getDate() - 1); + return date; + case 1: + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate()); + date.setDate(sentDate.getDate()+7 * relative._offset$i$1); + if(relative._modifier$i$1===1 || !relative._modifier$i$1) + { + date.setDate(date.getDate()+1 - date.getDay()); + if(date.getTime() < sentDate.getTime()) + return sentDate; + return date + } + else if(relative._modifier$i$1===2) + { + date.setDate(date.getDate()+5 - date.getDay()); + return date + } + break; + case 4: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate,relative); + case 3: + if(relative._offset$i$1 > 0) + return new Date(sentDate.getFullYear()+relative._offset$i$1,0,1); + break; + default: + break + } + return sentDate + }; + $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function(sentDate, offset, tag) + { + if(offset > -5 && offset < 5) + { + var dayOfWeek; + var days; + dayOfWeek=(tag+6) % 7+1; + days=7 * offset+(dayOfWeek - sentDate.getDay()); + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } + else + { + var days=(tag - sentDate.getDay()) % 7; + if(days < 0) + days+=7; + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } + }; + $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function(sentDate, relative) + { + var date; + var firstDay; + var newDate; + date=sentDate; + if(relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) + return sentDate; + var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12; + firstDay=new Date(date.getFullYear(),date.getMonth()+monthOffset,1); + if(relative._modifier$i$1===1) + if(relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay()) + return firstDay; + else + { + newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),firstDay.getDate()); + newDate.setDate(newDate.getDate()+(7+(1 - firstDay.getDay())) % 7); + if(firstDay.getDay() !==6 && firstDay.getDay() && firstDay.getDay() !==1) + newDate.setDate(newDate.getDate() - 7); + newDate.setDate(newDate.getDate()+7 * (relative._offset$i$1 - 1)); + if(newDate.getMonth()+1 !==relative._tag$i$1) + return sentDate; + return newDate + } + else + { + newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),$h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(),firstDay.getFullYear())); + var offset=1 - newDate.getDay(); + if(offset > 0) + offset=offset - 7; + newDate.setDate(newDate.getDate()+offset); + newDate.setDate(newDate.getDate()+7 * (1 - relative._offset$i$1)); + if(newDate.getMonth()+1 !==relative._tag$i$1) + if(firstDay.getDay() !==6 && firstDay.getDay()) + return firstDay; + else + return sentDate; + else + return newDate + } + }; + $h.MeetingSuggestionTimeDecoder._decode$p=function(inDate, date, time) + { + var DateValueMask=32767; + date.val=null; + time.val=0; + if(!inDate) + return false; + time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate); + var inDateAtMidnight=inDate.getTime() - time.val; + var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 864e5; + if(value < 0) + return false; + else if(value >=262144) + return false; + else + { + var type=value >> 15; + value=value & DateValueMask; + switch(type) + { + case 0: + return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value,date); + case 1: + return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value,date); + default: + return false + } + } + }; + $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function(value, date) + { + var c_SubTypeMask=7; + var c_MonthMask=15; + var c_DayMask=31; + var c_YearMask=127; + var year=null; + var month=0; + var day=0; + date.val=null; + var subType=value >> 12 & c_SubTypeMask; + if((subType & 4)===4) + { + year=value >> 5 & c_YearMask; + if((subType & 2)===2) + { + if((subType & 1)===1) + return false; + month=value >> 1 & c_MonthMask + } + } + else + { + if((subType & 2)===2) + month=value >> 8 & c_MonthMask; + if((subType & 1)===1) + day=value >> 3 & c_DayMask + } + date.val=new $h._preciseDate(day,month,year); + return true + }; + $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function(value, date) + { + var TagMask=15; + var OffsetMask=63; + var UnitMask=7; + var ModifierMask=3; + var tag=value & TagMask; + value >>=4; + var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask,6); + value >>=6; + var unit=value & UnitMask; + value >>=3; + var modifier=value & ModifierMask; + try + { + date.val=new $h._relativeDate(modifier,offset,unit,tag); + return true + } + catch($$e_A) + { + date.val=null; + return false + } + }; + $h.MeetingSuggestionTimeDecoder._fromComplement$p=function(value, n) + { + var signed=1 << n - 1; + var mask=(1 << n) - 1; + if((value & signed)===signed) + return-((value ^ mask)+1); + else + return value + }; + $h.MeetingSuggestionTimeDecoder._daysInMonth$p=function(month, year) + { + return 32 - new Date(year,month,32).getDate() + }; + $h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function(inputTime) + { + var timeOfDay=0; + timeOfDay+=inputTime.getUTCHours() * 3600; + timeOfDay+=inputTime.getUTCMinutes() * 60; + timeOfDay+=inputTime.getUTCSeconds(); + timeOfDay *=1e3; + timeOfDay+=inputTime.getUTCMilliseconds(); + return timeOfDay + }; + $h._extractedDate=function(){}; + $h._preciseDate=function(day, month, year) + { + $h._preciseDate.initializeBase(this); + if(day < 0 || day > 31) + throw Error.argumentOutOfRange("day"); + if(month < 0 || month > 12) + throw Error.argumentOutOfRange("month"); + this._day$i$1=day; + this._month$i$1=month; + if(!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + if(!month && day) + throw Error.argument("Invalid arguments"); + if(year < 0 || year > 2099) + throw Error.argumentOutOfRange("year"); + this._year$i$1=year % 100 + } + else if(!this._month$i$1 && !this._day$i$1) + throw Error.argument("Invalid datetime"); + }; + $h._preciseDate.prototype={ + _day$i$1: 0, + _month$i$1: 0, + _year$i$1: null + }; + $h._relativeDate=function(modifier, offset, unit, tag) + { + $h._relativeDate.initializeBase(this); + if(offset < -32 || offset > 31) + throw Error.argumentOutOfRange("offset"); + if(tag < 0 || tag > 15) + throw Error.argumentOutOfRange("tag"); + if(!unit && offset < 0) + throw Error.argument("unit & offset do not form a valid date"); + this._modifier$i$1=modifier; + this._offset$i$1=offset; + this._unit$i$1=unit; + this._tag$i$1=tag + }; + $h._relativeDate.prototype={ + _modifier$i$1: 0, + _offset$i$1: 0, + _unit$i$1: 0, + _tag$i$1: 0 + }; + $h.Message=function(dataDictionary) + { + this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2); + this.$$d__getInternetMessageId$p$2=Function.createDelegate(this,this._getInternetMessageId$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2); + this.$$d__getFrom$p$2=Function.createDelegate(this,this._getFrom$p$2); + this.$$d__getSender$p$2=Function.createDelegate(this,this._getSender$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2); + $h.Message.initializeBase(this,[dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"sender",this.$$d__getSender$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"from",this.$$d__getFrom$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"internetMessageId",this.$$d__getInternetMessageId$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2) + }; + $h.Message.prototype={ + getEntities: function() + { + return this._data$p$0._getEntities$i$0() + }, + getEntitiesByType: function(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, + getFilteredEntitiesByName: function(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, + getRegExMatches: function() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches"); + return this._data$p$0._getRegExMatches$i$0() + }, + getRegExMatchesByName: function(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName"); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, + displayReplyForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj) + }, + displayReplyAllForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj) + }, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, + _getSubject$p$2: function() + { + return this._data$p$0.get__subject$i$0() + }, + _getNormalizedSubject$p$2: function() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, + _getSender$p$2: function() + { + return this._data$p$0.get__sender$i$0() + }, + _getFrom$p$2: function() + { + return this._data$p$0.get__from$i$0() + }, + _getTo$p$2: function() + { + return this._data$p$0.get__to$i$0() + }, + _getCc$p$2: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getInternetMessageId$p$2: function() + { + return this._data$p$0.get__internetMessageId$i$0() + }, + _getConversationId$p$2: function() + { + return this._data$p$0.get__conversationId$i$0() + } + }; + $h.MessageCompose=function(data) + { + this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2); + this.$$d__getBcc$p$2=Function.createDelegate(this,this._getBcc$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2); + $h.MessageCompose.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"bcc",this.$$d__getBcc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2) + }; + $h.MessageCompose.prototype={ + _to$p$2: null, + _cc$p$2: null, + _bcc$p$2: null, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, + _getTo$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._to$p$2) + this._to$p$2=new $h.ComposeRecipient(0,"to"); + return this._to$p$2 + }, + _getCc$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._cc$p$2) + this._cc$p$2=new $h.ComposeRecipient(1,"cc"); + return this._cc$p$2 + }, + _getBcc$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._bcc$p$2) + this._bcc$p$2=new $h.ComposeRecipient(2,"bcc"); + return this._bcc$p$2 + }, + _getConversationId$p$2: function() + { + return this._data$p$0.get__conversationId$i$0() + } + }; + $h.NotificationMessages=function(){}; + $h.NotificationMessages._mapToHostItemNotificationMessageType$p=function(dataToHost) + { + var notificationType; + var hostItemNotificationMessageType; + notificationType=dataToHost["type"]; + if(notificationType===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.ProgressIndicator) + hostItemNotificationMessageType=1; + else if(notificationType===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.InformationalMessage) + hostItemNotificationMessageType=0; + else if(notificationType===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.ErrorMessage) + hostItemNotificationMessageType=2; + else + throw Error.argument("type"); + dataToHost["type"]=hostItemNotificationMessageType + }; + $h.NotificationMessages._validateKey$p=function(key) + { + if(!$h.ScriptHelpers.isNonEmptyString(key)) + throw Error.argument("key"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(key.length,0,32,"key") + }; + $h.NotificationMessages._validateDictionary$p=function(dictionary) + { + if(!$h.ScriptHelpers.isNonEmptyString(dictionary["type"])) + throw Error.argument("type"); + if(dictionary["type"]===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.InformationalMessage) + { + if(!$h.ScriptHelpers.isNonEmptyString(dictionary["icon"])) + throw Error.argument("icon"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(dictionary["icon"].length,0,32,"icon"); + if($h.ScriptHelpers.isUndefined(dictionary["persistent"])) + throw Error.argument("persistent"); + if(!Boolean.isInstanceOfType(dictionary["persistent"])) + throw Error.argumentType("persistent",Object.getType(dictionary["persistent"]),Boolean); + } + else + { + if(!$h.ScriptHelpers.isUndefined(dictionary["icon"])) + throw Error.argument("icon"); + if(!$h.ScriptHelpers.isUndefined(dictionary["persistent"])) + throw Error.argument("persistent"); + } + if(!$h.ScriptHelpers.isNonEmptyString(dictionary["message"])) + throw Error.argument("message"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(dictionary["message"].length,0,150,"message") + }; + $h.NotificationMessages.prototype={ + addAsync: function(key, dictionary) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.addAsync"); + var commonParameters=$h.CommonParameters.parse(args,false); + $h.NotificationMessages._validateKey$p(key); + $h.NotificationMessages._validateDictionary$p(dictionary); + var dataToHost={}; + dataToHost=$.extend(true,dataToHost,dictionary); + dataToHost["key"]=key; + $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(33,"AddNotificationMessageAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + getAllAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.getAllAsync"); + var commonParameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(34,"GetAllNotificationMessagesAsync",null,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + replaceAsync: function(key, dictionary) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.replaceAsync"); + var commonParameters=$h.CommonParameters.parse(args,false); + $h.NotificationMessages._validateKey$p(key); + $h.NotificationMessages._validateDictionary$p(dictionary); + var dataToHost={}; + dataToHost=$.extend(true,dataToHost,dictionary); + dataToHost["key"]=key; + $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(35,"ReplaceNotificationMessageAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + removeAsync: function(key) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.removeAsync"); + var commonParameters=$h.CommonParameters.parse(args,false); + $h.NotificationMessages._validateKey$p(key); + var dataToHost={key: key}; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(36,"RemoveNotificationMessageAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + } + }; + $h.OutlookErrorManager=function(){}; + $h.OutlookErrorManager.getErrorArgs=function(errorCode) + { + if(!$h.OutlookErrorManager._isInitialized$p) + $h.OutlookErrorManager._initialize$p(); + return OSF.DDA.ErrorCodeManager.getErrorArgs(errorCode) + }; + $h.OutlookErrorManager._initialize$p=function() + { + $h.OutlookErrorManager._addErrorMessage$p(9e3,"AttachmentSizeExceeded",_u.ExtensibilityStrings.l_AttachmentExceededSize_Text); + $h.OutlookErrorManager._addErrorMessage$p(9001,"NumberOfAttachmentsExceeded",_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text); + $h.OutlookErrorManager._addErrorMessage$p(9002,"InternalFormatError",_u.ExtensibilityStrings.l_InternalFormatError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9003,"InvalidAttachmentId",_u.ExtensibilityStrings.l_InvalidAttachmentId_Text); + $h.OutlookErrorManager._addErrorMessage$p(9004,"InvalidAttachmentPath",_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text); + $h.OutlookErrorManager._addErrorMessage$p(9005,"CannotAddAttachmentBeforeUpgrade",_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text); + $h.OutlookErrorManager._addErrorMessage$p(9006,"AttachmentDeletedBeforeUploadCompletes",_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text); + $h.OutlookErrorManager._addErrorMessage$p(9007,"AttachmentUploadGeneralFailure",_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9008,"AttachmentToDeleteDoesNotExist",_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text); + $h.OutlookErrorManager._addErrorMessage$p(9009,"AttachmentDeleteGeneralFailure",_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9010,"InvalidEndTime",_u.ExtensibilityStrings.l_InvalidEndTime_Text); + $h.OutlookErrorManager._addErrorMessage$p(9011,"HtmlSanitizationFailure",_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9012,"NumberOfRecipientsExceeded",String.format(_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text,500)); + $h.OutlookErrorManager._addErrorMessage$p(9013,"NoValidRecipientsProvided",_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text); + $h.OutlookErrorManager._addErrorMessage$p(9014,"CursorPositionChanged",_u.ExtensibilityStrings.l_CursorPositionChanged_Text); + $h.OutlookErrorManager._addErrorMessage$p(9016,"InvalidSelection",_u.ExtensibilityStrings.l_InvalidSelection_Text); + $h.OutlookErrorManager._addErrorMessage$p(9017,"AccessRestricted",""); + $h.OutlookErrorManager._addErrorMessage$p(9018,"GenericTokenError",""); + $h.OutlookErrorManager._addErrorMessage$p(9019,"GenericSettingsError",""); + $h.OutlookErrorManager._addErrorMessage$p(9020,"GenericResponseError",""); + $h.OutlookErrorManager._addErrorMessage$p(9021,"SaveError",_u.ExtensibilityStrings.l_SaveError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9022,"MessageInDifferentStoreError",_u.ExtensibilityStrings.l_MessageInDifferentStoreError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9023,"DuplicateNotificationKey",_u.ExtensibilityStrings.l_DuplicateNotificationKey_Text); + $h.OutlookErrorManager._addErrorMessage$p(9024,"NotificationKeyNotFound",_u.ExtensibilityStrings.l_NotificationKeyNotFound_Text); + $h.OutlookErrorManager._addErrorMessage$p(9025,"NumberOfNotificationsExceeded",_u.ExtensibilityStrings.l_NumberOfNotificationsExceeded_Text); + $h.OutlookErrorManager._isInitialized$p=true + }; + $h.OutlookErrorManager._addErrorMessage$p=function(errorCode, errorName, errorMessage) + { + OSF.DDA.ErrorCodeManager.addErrorMessage(errorCode,{ + name: errorName, + message: errorMessage + }) + }; + $h.OutlookErrorManager.OutlookErrorCodes=function(){}; + $h.OutlookErrorManager.OsfDdaErrorCodes=function(){}; + $h.PhoneNumber=function(data) + { + this.$$d__getPhoneType$p$0=Function.createDelegate(this,this._getPhoneType$p$0); + this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this,this._getOriginalPhoneString$p$0); + this.$$d__getPhoneString$p$0=Function.createDelegate(this,this._getPhoneString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"phoneString",this.$$d__getPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"originalPhoneString",this.$$d__getOriginalPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getPhoneType$p$0) + }; + $h.PhoneNumber.prototype={ + _data$p$0: null, + _getPhoneString$p$0: function() + { + return this._data$p$0["PhoneString"] + }, + _getOriginalPhoneString$p$0: function() + { + return this._data$p$0["OriginalPhoneString"] + }, + _getPhoneType$p$0: function() + { + return this._data$p$0["Type"] + } + }; + $h.TaskSuggestion=function(data) + { + this.$$d__getAssignees$p$0=Function.createDelegate(this,this._getAssignees$p$0); + this.$$d__getTaskString$p$0=Function.createDelegate(this,this._getTaskString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"taskString",this.$$d__getTaskString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"assignees",this.$$d__getAssignees$p$0) + }; + $h.TaskSuggestion.prototype={ + _data$p$0: null, + _assignees$p$0: null, + _getTaskString$p$0: function() + { + return this._data$p$0["TaskString"] + }, + _getAssignees$p$0: function() + { + if(!this._assignees$p$0) + { + var $$t_1=this; + this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Assignees",function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._assignees$p$0 + } + }; + $h.UserProfile=function(data) + { + this.$$d__getTimeZone$p$0=Function.createDelegate(this,this._getTimeZone$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"timeZone",this.$$d__getTimeZone$p$0) + }; + $h.UserProfile.prototype={ + _data$p$0: null, + _getDisplayName$p$0: function() + { + return this._data$p$0.get__userDisplayName$i$0() + }, + _getEmailAddress$p$0: function() + { + return this._data$p$0.get__userEmailAddress$i$0() + }, + _getTimeZone$p$0: function() + { + return this._data$p$0.get__userTimeZone$i$0() + } + }; + $h.RequestState=function(){}; + $h.RequestState.prototype={ + unsent: 0, + opened: 1, + headersReceived: 2, + loading: 3, + done: 4 + }; + $h.RequestState.registerEnum("$h.RequestState",false); + $h.CommonParameters=function(options, callback, asyncContext) + { + this._options$p$0=options; + this._callback$p$0=callback; + this._asyncContext$p$0=asyncContext + }; + $h.CommonParameters.parse=function(args, isCallbackRequired, tryLegacy) + { + var legacyParameters; + var $$t_8, + $$t_9; + if(tryLegacy && ($$t_9=$h.CommonParameters._tryParseLegacy$p(args,$$t_8={val: legacyParameters}),legacyParameters=$$t_8.val,$$t_9)) + return legacyParameters; + var argsLength=args.length; + var options=null; + var callback=null; + var asyncContext=null; + if(argsLength===1) + if(Function.isInstanceOfType(args[0])) + callback=args[0]; + else if(Object.isInstanceOfType(args[0])) + options=args[0]; + else + throw Error.argumentType(); + else if(argsLength===2) + { + if(!Object.isInstanceOfType(args[0])) + throw Error.argument("options"); + if(!Function.isInstanceOfType(args[1])) + throw Error.argument("callback"); + options=args[0]; + callback=args[1] + } + else if(argsLength) + throw Error.parameterCount(_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text); + if(isCallbackRequired && !callback) + throw Error.argumentNull("callback"); + if(options && !$h.ScriptHelpers.isNullOrUndefined(options["asyncContext"])) + asyncContext=options["asyncContext"]; + return new $h.CommonParameters(options,callback,asyncContext) + }; + $h.CommonParameters._tryParseLegacy$p=function(args, commonParameters) + { + commonParameters.val=null; + var argsLength=args.length; + var callback=null; + var userContext=null; + if(!argsLength || argsLength > 2) + return false; + if(!Function.isInstanceOfType(args[0])) + return false; + callback=args[0]; + if(argsLength > 1) + userContext=args[1]; + commonParameters.val=new $h.CommonParameters(null,callback,userContext); + return true + }; + $h.CommonParameters.prototype={ + _options$p$0: null, + _callback$p$0: null, + _asyncContext$p$0: null, + get_options: function() + { + return this._options$p$0 + }, + get_callback: function() + { + return this._callback$p$0 + }, + get_asyncContext: function() + { + return this._asyncContext$p$0 + } + }; + $h.EwsRequest=function(userContext) + { + $h.EwsRequest.initializeBase(this,[userContext]) + }; + $h.EwsRequest.prototype={ + readyState: 1, + status: 0, + statusText: null, + onreadystatechange: null, + responseText: null, + get__statusCode$i$1: function() + { + return this.status + }, + set__statusCode$i$1: function(value) + { + this.status=value; + return value + }, + get__statusDescription$i$1: function() + { + return this.statusText + }, + set__statusDescription$i$1: function(value) + { + this.statusText=value; + return value + }, + get__requestState$i$1: function() + { + return this.readyState + }, + set__requestState$i$1: function(value) + { + this.readyState=value; + return value + }, + get_hasOnReadyStateChangeCallback: function() + { + return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange) + }, + get__response$i$1: function() + { + return this.responseText + }, + set__response$i$1: function(value) + { + this.responseText=value; + return value + }, + send: function(data) + { + this._checkSendConditions$i$1(); + if($h.ScriptHelpers.isNullOrUndefined(data)) + this._throwInvalidStateException$i$1(); + this._sendRequest$i$0(5,"EwsRequest",{body: data}) + }, + _callOnReadyStateChangeCallback$i$1: function() + { + if(!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) + this.onreadystatechange() + }, + _parseExtraResponseData$i$1: function(response){}, + executeExtraFailedResponseSteps: function(){} + }; + $h.InitialData=function(data) + { + this._data$p$0=data; + this._permissionLevel$p$0=this._calculatePermissionLevel$p$0() + }; + $h.InitialData._defineReadOnlyProperty$i=function(o, methodName, getter) + { + var propertyDescriptor={ + get: getter, + configurable: false + }; + Object.defineProperty(o,methodName,propertyDescriptor) + }; + $h.InitialData.prototype={ + _toRecipients$p$0: null, + _ccRecipients$p$0: null, + _attachments$p$0: null, + _resources$p$0: null, + _entities$p$0: null, + _data$p$0: null, + _permissionLevel$p$0: 0, + get__itemId$i$0: function() + { + return this._data$p$0["id"] + }, + get__itemClass$i$0: function() + { + return this._data$p$0["itemClass"] + }, + get__dateTimeCreated$i$0: function() + { + return new Date(this._data$p$0["dateTimeCreated"]) + }, + get__dateTimeModified$i$0: function() + { + return new Date(this._data$p$0["dateTimeModified"]) + }, + get__dateTimeSent$i$0: function() + { + return new Date(this._data$p$0["dateTimeSent"]) + }, + get__subject$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0["subject"] + }, + get__normalizedSubject$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0["normalizedSubject"] + }, + get__internetMessageId$i$0: function() + { + return this._data$p$0["internetMessageId"] + }, + get__conversationId$i$0: function() + { + return this._data$p$0["conversationId"] + }, + get__sender$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var sender=this._data$p$0["sender"]; + return $h.ScriptHelpers.isNullOrUndefined(sender) ? null : new $h.EmailAddressDetails(sender) + }, + get__from$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var from=this._data$p$0["from"]; + return $h.ScriptHelpers.isNullOrUndefined(from) ? null : new $h.EmailAddressDetails(from) + }, + get__to$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._toRecipients$p$0) + this._toRecipients$p$0=this._createEmailAddressDetails$p$0("to"); + return this._toRecipients$p$0 + }, + get__cc$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._ccRecipients$p$0) + this._ccRecipients$p$0=this._createEmailAddressDetails$p$0("cc"); + return this._ccRecipients$p$0 + }, + get__attachments$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._attachments$p$0) + this._attachments$p$0=this._createAttachmentDetails$p$0(); + return this._attachments$p$0 + }, + get__ewsUrl$i$0: function() + { + return this._data$p$0["ewsUrl"] + }, + get__marketplaceAssetId$i$0: function() + { + return this._data$p$0["marketplaceAssetId"] + }, + get__marketplaceContentMarket$i$0: function() + { + return this._data$p$0["marketplaceContentMarket"] + }, + get__consentMetadata$i$0: function() + { + return this._data$p$0["consentMetadata"] + }, + get__isRead$i$0: function() + { + return this._data$p$0["isRead"] + }, + get__entryPointUrl$i$0: function() + { + return this._data$p$0["entryPointUrl"] + }, + get__start$i$0: function() + { + return new Date(this._data$p$0["start"]) + }, + get__end$i$0: function() + { + return new Date(this._data$p$0["end"]) + }, + get__location$i$0: function() + { + return this._data$p$0["location"] + }, + get__resources$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._resources$p$0) + this._resources$p$0=this._createEmailAddressDetails$p$0("resources"); + return this._resources$p$0 + }, + get__organizer$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var organizer=this._data$p$0["organizer"]; + return $h.ScriptHelpers.isNullOrUndefined(organizer) ? null : new $h.EmailAddressDetails(organizer) + }, + get__userDisplayName$i$0: function() + { + return this._data$p$0["userDisplayName"] + }, + get__userEmailAddress$i$0: function() + { + return this._data$p$0["userEmailAddress"] + }, + get__userTimeZone$i$0: function() + { + return this._data$p$0["userTimeZone"] + }, + get__timeZoneOffsets$i$0: function() + { + return this._data$p$0["timeZoneOffsets"] + }, + get__hostVersion$i$0: function() + { + return this._data$p$0["hostVersion"] + }, + get__owaView$i$0: function() + { + return this._data$p$0["owaView"] + }, + get__overrideWindowOpen$i$0: function() + { + return this._data$p$0["overrideWindowOpen"] + }, + _getEntities$i$0: function() + { + if(!this._entities$p$0) + this._entities$p$0=new $h.Entities(this._data$p$0["entities"],this._data$p$0["filteredEntities"],this.get__dateTimeSent$i$0(),this._permissionLevel$p$0); + return this._entities$p$0 + }, + _getEntitiesByType$i$0: function(entityType) + { + var entites=this._getEntities$i$0(); + return entites._getByType$i$0(entityType) + }, + _getFilteredEntitiesByName$i$0: function(name) + { + var entities=this._getEntities$i$0(); + return entities._getFilteredEntitiesByName$i$0(name) + }, + _getRegExMatches$i$0: function() + { + if(!this._data$p$0["regExMatches"]) + return null; + return this._data$p$0["regExMatches"] + }, + _getRegExMatchesByName$i$0: function(regexName) + { + var regexMatches=this._getRegExMatches$i$0(); + if(!regexMatches || !regexMatches[regexName]) + return null; + return regexMatches[regexName] + }, + _throwOnRestrictedPermissionLevel$i$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0) + }, + _createEmailAddressDetails$p$0: function(key) + { + var to=this._data$p$0[key]; + if($h.ScriptHelpers.isNullOrUndefined(to)) + return[]; + var recipients=[]; + for(var i=0; i < to.length; i++) + if(!$h.ScriptHelpers.isNullOrUndefined(to[i])) + recipients[i]=new $h.EmailAddressDetails(to[i]); + return recipients + }, + _createAttachmentDetails$p$0: function() + { + var attachments=this._data$p$0["attachments"]; + if($h.ScriptHelpers.isNullOrUndefined(attachments)) + return[]; + var attachmentDetails=[]; + for(var i=0; i < attachments.length; i++) + if(!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) + attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]); + return attachmentDetails + }, + _calculatePermissionLevel$p$0: function() + { + var HostReadItem=1; + var HostReadWriteMailbox=2; + var HostReadWriteItem=3; + var permissionLevelFromHost=this._data$p$0["permissionLevel"]; + if($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0)) + return 0; + switch(permissionLevelFromHost) + { + case HostReadItem: + return 1; + case HostReadWriteItem: + return 2; + case HostReadWriteMailbox: + return 3; + default: + return 0 + } + } + }; + $h._loadDictionaryRequest=function(createResultObject, dictionaryName, callback, userContext) + { + $h._loadDictionaryRequest.initializeBase(this,[userContext]); + this._createResultObject$p$1=createResultObject; + this._dictionaryName$p$1=dictionaryName; + this._callback$p$1=callback + }; + $h._loadDictionaryRequest.prototype={ + _dictionaryName$p$1: null, + _createResultObject$p$1: null, + _callback$p$1: null, + handleResponse: function(response) + { + if(response["wasSuccessful"]) + { + var value=response[this._dictionaryName$p$1]; + var responseData=JSON.parse(value); + this.createAsyncResult(this._createResultObject$p$1(responseData),0,0,null) + } + else + this.createAsyncResult(null,1,9020,response["errorMessage"]); + this._callback$p$1(this._asyncResult$p$0) + } + }; + $h.ProxyRequestBase=function(userContext) + { + $h.ProxyRequestBase.initializeBase(this,[userContext]) + }; + $h.ProxyRequestBase.prototype={ + handleResponse: function(response) + { + if(!response["wasProxySuccessful"]) + { + this.set__statusCode$i$1(500); + this.set__statusDescription$i$1("Error"); + var errorMessage=response["errorMessage"]; + this.set__response$i$1(errorMessage); + this.createAsyncResult(null,1,9020,errorMessage) + } + else + { + this.set__statusCode$i$1(response["statusCode"]); + this.set__statusDescription$i$1(response["statusDescription"]); + this.set__response$i$1(response["body"]); + this.createAsyncResult(this.get__response$i$1(),0,0,null) + } + this._parseExtraResponseData$i$1(response); + this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() + }, + _throwInvalidStateException$i$1: function() + { + throw Error.create("DOMException",{ + code: 11, + message: "INVALID_STATE_ERR" + }); + }, + _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function() + { + var $$t_0=this; + this._changeReadyState$i$1(2,function() + { + $$t_0._changeReadyState$i$1(3,function() + { + $$t_0._changeReadyState$i$1(4,null) + }) + }) + }, + _changeReadyState$i$1: function(state, nextStep) + { + this.set__requestState$i$1(state); + var $$t_2=this; + window.setTimeout(function() + { + try + { + $$t_2._callOnReadyStateChangeCallback$i$1() + } + finally + { + if(!$h.ScriptHelpers.isNullOrUndefined(nextStep)) + nextStep() + } + },0) + }, + _checkSendConditions$i$1: function() + { + if(this.get__requestState$i$1() !==1) + this._throwInvalidStateException$i$1(); + if(this._isSent$p$0) + this._throwInvalidStateException$i$1() + } + }; + $h.RequestBase=function(userContext) + { + this._userContext$p$0=userContext + }; + $h.RequestBase.prototype={ + _isSent$p$0: false, + _asyncResult$p$0: null, + _userContext$p$0: null, + get_asyncResult: function() + { + return this._asyncResult$p$0 + }, + _sendRequest$i$0: function(dispid, methodName, dataToSend) + { + this._isSent$p$0=true; + var $$t_5=this; + OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid,methodName,dataToSend,function(resultCode, response) + { + if(resultCode) + $$t_5.createAsyncResult(null,1,9017,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode)); + else + $$t_5.handleResponse(response) + }) + }, + createAsyncResult: function(value, errorCode, detailedErrorCode, errorDescription) + { + this._asyncResult$p$0=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(value,errorCode,detailedErrorCode,this._userContext$p$0,errorDescription) + } + }; + $h.SaveDictionaryRequest=function(callback, userContext) + { + $h.SaveDictionaryRequest.initializeBase(this,[userContext]); + if(!$h.ScriptHelpers.isNullOrUndefined(callback)) + this._callback$p$1=callback + }; + $h.SaveDictionaryRequest.prototype={ + _callback$p$1: null, + handleResponse: function(response) + { + if(response["wasSuccessful"]) + this.createAsyncResult(null,0,0,null); + else + this.createAsyncResult(null,1,9020,response["errorMessage"]); + if(!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) + this._callback$p$1(this._asyncResult$p$0) + } + }; + $h.ScriptHelpers=function(){}; + $h.ScriptHelpers.isNull=function(value) + { + return null===value + }; + $h.ScriptHelpers.isNullOrUndefined=function(value) + { + return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value) + }; + $h.ScriptHelpers.isUndefined=function(value) + { + return value===undefined + }; + $h.ScriptHelpers.dictionaryContainsKey=function(obj, keyName) + { + return Object.isInstanceOfType(obj) ? keyName in obj : false + }; + $h.ScriptHelpers.isNonEmptyString=function(value) + { + if(!value) + return false; + return String.isInstanceOfType(value) + }; + OSF.DDA.OutlookAppOm.registerClass("OSF.DDA.OutlookAppOm"); + OSF.DDA.Settings.registerClass("OSF.DDA.Settings"); + $h.ItemBase.registerClass("$h.ItemBase"); + $h.Item.registerClass("$h.Item",$h.ItemBase); + $h.Appointment.registerClass("$h.Appointment",$h.Item); + $h.ComposeItem.registerClass("$h.ComposeItem",$h.ItemBase); + $h.AppointmentCompose.registerClass("$h.AppointmentCompose",$h.ComposeItem); + $h.AttachmentConstants.registerClass("$h.AttachmentConstants"); + $h.AttachmentDetails.registerClass("$h.AttachmentDetails"); + $h.Body.registerClass("$h.Body"); + $h.ComposeBody.registerClass("$h.ComposeBody",$h.Body); + $h.ComposeRecipient.registerClass("$h.ComposeRecipient"); + $h.ComposeLocation.registerClass("$h.ComposeLocation"); + $h.ComposeSubject.registerClass("$h.ComposeSubject"); + $h.ComposeTime.registerClass("$h.ComposeTime"); + $h.Contact.registerClass("$h.Contact"); + $h.CustomProperties.registerClass("$h.CustomProperties"); + $h.Diagnostics.registerClass("$h.Diagnostics"); + $h.EmailAddressDetails.registerClass("$h.EmailAddressDetails"); + $h.Entities.registerClass("$h.Entities"); + $h.ReplyConstants.registerClass("$h.ReplyConstants"); + $h.AsyncConstants.registerClass("$h.AsyncConstants"); + Office.cast.item.registerClass("Office.cast.item"); + $h.Message.registerClass("$h.Message",$h.Item); + $h.MeetingRequest.registerClass("$h.MeetingRequest",$h.Message); + $h.MeetingSuggestion.registerClass("$h.MeetingSuggestion"); + $h.MeetingSuggestionTimeDecoder.registerClass("$h.MeetingSuggestionTimeDecoder"); + $h._extractedDate.registerClass("$h._extractedDate"); + $h._preciseDate.registerClass("$h._preciseDate",$h._extractedDate); + $h._relativeDate.registerClass("$h._relativeDate",$h._extractedDate); + $h.MessageCompose.registerClass("$h.MessageCompose",$h.ComposeItem); + $h.NotificationMessages.registerClass("$h.NotificationMessages"); + $h.OutlookErrorManager.registerClass("$h.OutlookErrorManager"); + $h.OutlookErrorManager.OutlookErrorCodes.registerClass("$h.OutlookErrorManager.OutlookErrorCodes"); + $h.OutlookErrorManager.OsfDdaErrorCodes.registerClass("$h.OutlookErrorManager.OsfDdaErrorCodes"); + $h.PhoneNumber.registerClass("$h.PhoneNumber"); + $h.TaskSuggestion.registerClass("$h.TaskSuggestion"); + $h.UserProfile.registerClass("$h.UserProfile"); + $h.CommonParameters.registerClass("$h.CommonParameters"); + $h.RequestBase.registerClass("$h.RequestBase"); + $h.ProxyRequestBase.registerClass("$h.ProxyRequestBase",$h.RequestBase); + $h.EwsRequest.registerClass("$h.EwsRequest",$h.ProxyRequestBase); + $h.InitialData.registerClass("$h.InitialData"); + $h._loadDictionaryRequest.registerClass("$h._loadDictionaryRequest",$h.RequestBase); + $h.SaveDictionaryRequest.registerClass("$h.SaveDictionaryRequest",$h.RequestBase); + $h.ScriptHelpers.registerClass("$h.ScriptHelpers"); + OSF.DDA.OutlookAppOm.asyncMethodTimeoutKeyName="__timeout__"; + OSF.DDA.OutlookAppOm._maxRecipients$p=100; + OSF.DDA.OutlookAppOm._maxSubjectLength$p=255; + OSF.DDA.OutlookAppOm.maxBodyLength=32768; + OSF.DDA.OutlookAppOm._maxLocationLength$p=255; + OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1e6; + OSF.DDA.OutlookAppOm._instance$p=null; + $h.AttachmentConstants.maxAttachmentNameLength=255; + $h.AttachmentConstants.maxUrlLength=2048; + $h.AttachmentConstants.maxItemIdLength=200; + $h.AttachmentConstants.maxRemoveIdLength=200; + $h.AttachmentConstants.attachmentParameterName="attachments"; + $h.AttachmentConstants.attachmentTypeParameterName="type"; + $h.AttachmentConstants.attachmentUrlParameterName="url"; + $h.AttachmentConstants.attachmentItemIdParameterName="itemId"; + $h.AttachmentConstants.attachmentNameParameterName="name"; + $h.AttachmentConstants.attachmentTypeFileName="file"; + $h.AttachmentConstants.attachmentTypeItemName="item"; + $h.AttachmentDetails._attachmentTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File,Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item]; + $h.Body.coercionTypeParameterName="coercionType"; + $h.ComposeRecipient.displayNameLengthLimit=255; + $h.ComposeRecipient.maxSmtpLength=571; + $h.ComposeRecipient.recipientsLimit=100; + $h.ComposeRecipient.totalRecipientsLimit=500; + $h.ComposeRecipient.addressParameterName="address"; + $h.ComposeRecipient.nameParameterName="name"; + $h.ComposeLocation.locationKey="location"; + $h.ComposeLocation.maximumLocationLength=255; + $h.ComposeSubject.maximumSubjectLength=255; + $h.ComposeTime.timeTypeName="TimeProperty"; + $h.ComposeTime.timeDataName="time"; + $h.Diagnostics.outlookAppName="Outlook"; + $h.Diagnostics.outlookWebAppName="OutlookWebApp"; + $h.EmailAddressDetails._emptyString$p=""; + $h.EmailAddressDetails._responseTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined]; + $h.EmailAddressDetails._recipientTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser]; + $h.Entities._allEntityKeys$p=["Addresses","EmailAddresses","Urls","PhoneNumbers","TaskSuggestions","MeetingSuggestions","Contacts","FlightReservations","ParcelDeliveries"]; + $h.ReplyConstants.htmlBodyKeyName="htmlBody"; + $h.AsyncConstants.optionsKeyName="options"; + $h.AsyncConstants.callbackKeyName="callback"; + $h.AsyncConstants.asyncResultKeyName="asyncResult"; + $h.MeetingSuggestionTimeDecoder._baseDate$p=new Date("0001-01-01T00:00:00Z"); + $h.NotificationMessages.maximumKeyLength=32; + $h.NotificationMessages.maximumIconLength=32; + $h.NotificationMessages.maximumMessageLength=150; + $h.NotificationMessages.notificationsKeyParameterName="key"; + $h.NotificationMessages.notificationsTypeParameterName="type"; + $h.NotificationMessages.notificationsIconParameterName="icon"; + $h.NotificationMessages.notificationsMessageParameterName="message"; + $h.NotificationMessages.notificationsPersistentParameterName="persistent"; + $h.OutlookErrorManager.errorNameKey="name"; + $h.OutlookErrorManager.errorMessageKey="message"; + $h.OutlookErrorManager._isInitialized$p=false; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9e3; + $h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001; + $h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002; + $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003; + $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004; + $h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009; + $h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010; + $h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011; + $h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012; + $h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013; + $h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014; + $h.OutlookErrorManager.OutlookErrorCodes.invalidSelection=9016; + $h.OutlookErrorManager.OutlookErrorCodes.accessRestricted=9017; + $h.OutlookErrorManager.OutlookErrorCodes.genericTokenError=9018; + $h.OutlookErrorManager.OutlookErrorCodes.genericSettingsError=9019; + $h.OutlookErrorManager.OutlookErrorCodes.genericResponseError=9020; + $h.OutlookErrorManager.OutlookErrorCodes.saveError=9021; + $h.OutlookErrorManager.OutlookErrorCodes.messageInDifferentStoreError=9022; + $h.OutlookErrorManager.OutlookErrorCodes.duplicateNotificationKey=9023; + $h.OutlookErrorManager.OutlookErrorCodes.notificationKeyNotFound=9024; + $h.OutlookErrorManager.OutlookErrorCodes.numberOfNotificationsExceeded=9025; + $h.OutlookErrorManager.OutlookErrorCodes.ooeInvalidDataFormat=2006; + $h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1e3; + $h.CommonParameters.asyncContextKeyName="asyncContext"; + $h.ScriptHelpers.emptyString=""; + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + if(appContext.get_appName()==OSF.AppName.OutlookWebApp) + this._settings=this._initializeSettings(appContext,false); + else + this._settings=this._initializeSettings(false); + appContext.appOM=new OSF.DDA.OutlookAppOm(appContext,this._webAppState.wnd,appReady) +} + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-web-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-web-16.00.js new file mode 100644 index 000000000..f4687005e --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-web-16.00.js @@ -0,0 +1,17 @@ +/* Outlook web application specific API library */ +/* Version: 16.0.4017.3000 Build Time: 07/15/2015 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/*! +Copyright (c) Microsoft Corporation. All rights reserved. +*/ +/*! +Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ +var OSF=OSF||{},OfficeExt;(function(n){var t=function(){function n(n){this._internalStorage=n}n.prototype.getItem=function(n){try{return this._internalStorage&&this._internalStorage.getItem(n)}catch(t){return null}};n.prototype.setItem=function(n,t){try{this._internalStorage&&this._internalStorage.setItem(n,t)}catch(i){}};n.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(n){}};n.prototype.removeItem=function(n){try{this._internalStorage&&this._internalStorage.removeItem(n)}catch(t){}};n.prototype.getKeysWithPrefix=function(n){var i=[];try{for(var u=this._internalStorage&&this._internalStorage.length||0,t=0;t1?e[e.length-1]:t,o=p();if(!n&&o){var u=window.name.indexOf(k);if(u>-1){var f=window.name.indexOf(";",u);f==-1&&(f=window.name.length);var s=window.name.substring(u,f);r?o.setItem(s,r):r=o.getItem(s)}}return r},getConversationId:function(){var i=window.location.search,n=t;if(i){var r=i.indexOf("&");n=r>0?i.substring(1,r):i.substr(1);if(n&&n.charAt(n.length-1)==="="){n=n.substring(0,n.length-1);n&&(n=decodeURIComponent(n))}}return n},getInfoItems:function(n){var t=n.split("$");typeof t[1]==e&&(t=n.split("|"));return t},getConversationUrl:function(){var t="",r=OSF.OUtil.parseXdmInfo(i);if(r){var n=OSF.OUtil.getInfoItems(r);n!=undefined&&n.length>=3&&(t=n[2])}return t},validateParamObject:function(t,r){var u=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:n},{name:"expectedProperties",type:Object,mayBeNull:n},{name:"callback",type:Function,mayBeNull:i}]);if(u)throw u;for(var f in r){u=Function._validateParameter(t[f],r[f],f);if(u)throw u;}},writeProfilerMark:function(n){if(window.msWriteProfilerMark){window.msWriteProfilerMark(n);typeof Sys!==e&&Sys&&Sys.Debug&&Sys.Debug.trace(n)}},outputDebug:function(n){typeof Sys!==e&&Sys&&Sys.Debug&&Sys.Debug.trace(n)},defineNondefaultProperty:function(n,t,r,u){r=r||{};for(var e in u){var f=u[e];r[f]==undefined&&(r[f]=i)}Object.defineProperty(n,t,r);return n},defineNondefaultProperties:function(n,t,i){t=t||{};for(var r in t)OSF.OUtil.defineNondefaultProperty(n,r,t[r],i);return n},defineEnumerableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[f])},defineEnumerableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[f])},defineMutableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[w,f,v])},defineMutableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[w,f,v])},finalizeProperties:function(t,r){r=r||{};for(var o=Object.getOwnPropertyNames(t),s=o.length,f=0;f>8;f=e&255;i[t++]=r>>2;i[t++]=(r&3)<<4|u>>4;i[t++]=(u&15)<<2|f>>6;i[t++]=f&63;if(!isNaN(e)){r=e>>8;u=s&255;f=s>>8;i[t++]=r>>2;i[t++]=(r&3)<<4|u>>4;i[t++]=(u&15)<<2|f>>6;i[t++]=f&63}if(isNaN(e))i[t-1]=64;else if(isNaN(s)){i[t-2]=64;i[t-1]=64}for(var h=0;h0;t++){(t==8||t==12||t==16||t==20)&&(i+="-");i+=n[r%16];r=Math.floor(r/16)}for(;t<32;t++){(t==8||t==12||t==16||t==20)&&(i+="-");i+=n[Math.floor(Math.random()*16)]}return i}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(n,t,i,r,u,f,e,o,s,h,c,l,a){var v=this;v._id=n;v._appName=t;v._appVersion=i;v._appUILocale=r;v._dataLocale=u;v._docUrl=f;v._clientMode=e;v._settings=o;v._reason=s;v._osfControlType=h;v._eToken=c;v._correlationId=l;v._appInstanceId=a;v.get_id=function(){return this._id};v.get_appName=function(){return this._appName};v.get_appVersion=function(){return this._appVersion};v.get_appUILocale=function(){return this._appUILocale};v.get_dataLocale=function(){return this._dataLocale};v.get_docUrl=function(){return this._docUrl};v.get_clientMode=function(){return this._clientMode};v.get_bindings=function(){return this._bindings};v.get_settings=function(){return this._settings};v.get_reason=function(){return this._reason};v.get_osfControlType=function(){return this._osfControlType};v.get_eToken=function(){return this._eToken};v.get_correlationId=function(){return this._correlationId};v.get_appInstanceId=function(){return this._appInstanceId}};OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(n,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged?n+"_"+t:t};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var n={};return{getErrorArgs:function(t){return n[t]||n[this.errorCodes.ooeInternalError]},addErrorMessage:function(t,i){n[t]=i},errorCodes:{ooeSuccess:0,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(t){n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported}}}}();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var t,n=!1;return{enableShortcut:function(){if(!n){window.Office?t=window.Office:OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;n=!0}},disableShortcut:function(){if(n){t?window.Office=t:OSF.OUtil.unsetNamespace("Office",window);n=!1}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(n){n?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(n,t){var i;if(n&&typeof n=="string"){var r=n.indexOf("#");if(r!=-1){var o=n.substring(0,r),e=n.substring(r+1);switch(o){case"binding":case"bindings":e&&(i=new OSF.DDA.BindingPromise(e))}}}if(i){i.onFail=t;return i}else if(t){var u=typeof t;if(u=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=t;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,u);}};OSF.DDA.Context=function(n,t,i,r,u){var f=this;OSF.OUtil.defineEnumerableProperties(f,{contentLanguage:{value:n.get_dataLocale()},displayLanguage:{value:n.get_appUILocale()}});t&&OSF.OUtil.defineEnumerableProperty(f,"document",{value:t});i&&OSF.OUtil.defineEnumerableProperty(f,"license",{value:i});if(r){var e=r.displayName||"appOM";delete r.displayName;OSF.OUtil.defineEnumerableProperty(f,e,{value:r})}u&&OSF.OUtil.defineEnumerableProperty(f,"officeTheme",{get:function(){return u()}})};OSF.DDA.OutlookContext=function(n,t,i,r,u){OSF.DDA.OutlookContext.uber.constructor.call(this,n,null,i,r,u);t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(n,t){var i;switch(n.get_clientMode()){case OSF.ClientMode.ReadOnly:i=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:i=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t});OSF.OUtil.defineMutableProperties(this,{mode:{value:i},url:{value:n.get_docUrl()}})};OSF.DDA.JsomDocument=function(n,t,i){var r=this;OSF.DDA.JsomDocument.uber.constructor.call(r,n,i);t&&OSF.OUtil.defineEnumerableProperty(r,"bindings",{get:function(){return t}});var u=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(r,[u.GetSelectedDataAsync,u.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(r,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var n;OSF&&OSF._OfficeAppFactory&&(n=OSF._OfficeAppFactory.getContext());return n}});OSF.DDA.License=function(n){OSF.OUtil.defineEnumerableProperty(this,"value",{value:n})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(n){for(var t in n){var i={};OSF.OUtil.defineEnumerableProperties(i,{id:{value:t},displayName:{value:n[t]}});OSF.DDA.AsyncMethodNames[t]=i}};OSF.DDA.AsyncMethodCall=function(n,t,i,r,u,f,e){var c="function",o=n.length,s=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,e)});function h(n,t){for(var u in n){var i=n[u],r=t[u];if(i["enum"])switch(typeof r){case"string":if(OSF.OUtil.listContainsValue(i["enum"],r))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw s();}if(i.types&&!OSF.OUtil.listContainsValue(i.types,typeof r))throw s();}}function a(t,i,r){if(t.lengtho+2)throw Error.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var f,l,v=n.length-1;v>=o;v--){var a=n[v];switch(typeof a){case"object":if(f)throw Error.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else f=a;break;case c:if(l)throw Error.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else l=a;break;default:throw Error.argument(Strings.OfficeOM.L_InValidOptionalArgument);}}f=f||{};for(var y in t)if(!OSF.OUtil.listContainsKey(f,y)){var e=undefined,s=t[y];s.calculate&&i&&(e=s.calculate(i,r,u));e||s.defaultValue===undefined||(e=s.defaultValue);f[y]=e}if(l)if(f[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else f[Microsoft.Office.WebExtension.Parameters.Callback]=l;h(t,f);return f}this.verifyAndExtractCall=function(n,t,r){var e=a(n,t,r),h=l(n,e,t,r),u={};for(var c in e)u[c]=e[c];for(var o in h)u[o]=h[o];for(var s in i)u[s]=i[s](t,r);f&&(u=f(u,t,r));return u};this.processResponse=function(n,t,i,f){var e;e=n==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?r?r(t,i,f):t:u?u(n,t):OSF.DDA.ErrorCodeManager.getErrorArgs(n);return e};this.getCallArgs=function(n){for(var t,u,r=n.length-1;r>=o;r--){var i=n[r];switch(typeof i){case"object":t=i;break;case c:u=i}}t=t||{};u&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=u);return t}};OSF.DDA.AsyncMethodCallFactory=function(){function n(n){var i=null;if(n){i={};for(var r=n.length,t=0;t=1)return!0;t=n.deserialize;n.deserialize=function(n){return e(n,!0,t)};n.__patchVersion=1;return!0}i()||u(n,"load",function(){i()})})(window);Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5};Microsoft.Office.Common.InvokeResultCode={noError:0,errorInRequest:-1,errorHandlingRequest:-2,errorInResponse:-3,errorHandlingResponse:-4,errorHandlingRequestAccessDenied:-5,errorHandlingMethodCallTimedout:-6};Microsoft.Office.Common.MessageType={request:0,response:1};Microsoft.Office.Common.ActionType={invoke:0,registerEvent:1,unregisterEvent:2};Microsoft.Office.Common.ResponseType={forCalling:0,forEventing:1};Microsoft.Office.Common.MethodObject=function(n,t,i){this._method=n;this._invokeType=t;this._blockingOthers=i};Microsoft.Office.Common.MethodObject.prototype={getMethod:function(){return this._method},getInvokeType:function(){return this._invokeType},getBlockingFlag:function(){return this._blockingOthers}};Microsoft.Office.Common.EventMethodObject=function(n,t){this._registerMethodObject=n;this._unregisterMethodObject=t};Microsoft.Office.Common.EventMethodObject.prototype={getRegisterMethodObject:function(){return this._registerMethodObject},getUnregisterMethodObject:function(){return this._unregisterMethodObject}};Microsoft.Office.Common.ServiceEndPoint=function(n){var t=this,i=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(i)throw i;t._methodObjectList={};t._eventHandlerProxyList={};t._Id=n;t._conversations={};t._policyManager=null};Microsoft.Office.Common.ServiceEndPoint.prototype={registerMethod:function(n,t,i,r){var e="invokeType",u=!1,f=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:u},{name:"method",type:Function,mayBeNull:u},{name:e,type:Number,mayBeNull:u},{name:"blockingOthers",type:Boolean,mayBeNull:u}]);if(f)throw f;if(i!==Microsoft.Office.Common.InvokeType.async&&i!==Microsoft.Office.Common.InvokeType.sync)throw Error.argument(e);var o=new Microsoft.Office.Common.MethodObject(t,i,r);this._methodObjectList[n]=o},unregisterMethod:function(n){var t=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:!1}]);if(t)throw t;delete this._methodObjectList[n]},registerEvent:function(n,t,i){var r=!1,u=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:r},{name:"registerMethod",type:Function,mayBeNull:r},{name:"unregisterMethod",type:Function,mayBeNull:r}]);if(u)throw u;var f=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(t,Microsoft.Office.Common.InvokeType.syncRegisterEvent,r),new Microsoft.Office.Common.MethodObject(i,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,r));this._methodObjectList[n]=f},registerEventEx:function(n,t,i,r,u){var f=!1,e=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:f},{name:"registerMethod",type:Function,mayBeNull:f},{name:"registerMethodInvokeType",type:Number,mayBeNull:f},{name:"unregisterMethod",type:Function,mayBeNull:f},{name:"unregisterMethodInvokeType",type:Number,mayBeNull:f}]);if(e)throw e;var o=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(t,i,f),new Microsoft.Office.Common.MethodObject(r,u,f));this._methodObjectList[n]=o},unregisterEvent:function(n){var t=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:!1}]);if(t)throw t;this.unregisterMethod(n)},registerConversation:function(n,t){var i=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1},{name:"conversationUrl",type:String,mayBeNull:!1,optional:!0}]);if(i)throw i;this._conversations[n]=t?t:!0},unregisterConversation:function(n){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;delete this._conversations[n]},setPolicyManager:function(n){var i="policyManager",t=Function._validateParams(arguments,[{name:i,type:Object,mayBeNull:!1}]);if(t)throw t;if(!n.checkPermission)throw Error.argument(i);this._policyManager=n},getPolicyManager:function(){return this._policyManager}};Microsoft.Office.Common.ClientEndPoint=function(n,t,i){var f="targetWindow",r=this,u=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1},{name:f,mayBeNull:!1},{name:"targetUrl",type:String,mayBeNull:!1}]);if(u)throw u;if(!t.postMessage)throw Error.argument(f);r._conversationId=n;r._targetWindow=t;r._targetUrl=i;r._callingIndex=0;r._callbackList={};r._eventHandlerList={}};Microsoft.Office.Common.ClientEndPoint.prototype={invoke:function(n,t,i){var r=this,e=Function._validateParams(arguments,[{name:"targetMethodName",type:String,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"param",mayBeNull:!0}]);if(e)throw e;var u=r._callingIndex++,h=new Date,f={callback:t,createdOn:h.getTime()};if(i&&typeof i=="object"&&typeof i.__timeout__=="number"){f.timeout=i.__timeout__;delete i.__timeout__}r._callbackList[u]=f;try{var s=new Microsoft.Office.Common.Request(n,Microsoft.Office.Common.ActionType.invoke,r._conversationId,u,i),o=Microsoft.Office.Common.MessagePackager.envelope(s);r._targetWindow.postMessage(o,r._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(c){try{t!==null&&t(Microsoft.Office.Common.InvokeResultCode.errorInRequest,c)}finally{delete r._callbackList[u]}}},registerForEvent:function(n,t,i,r){var u=this,e=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:!1},{name:"eventHandler",type:Function,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"data",mayBeNull:!0,optional:!0}]);if(e)throw e;var f=u._callingIndex++,h=new Date;u._callbackList[f]={callback:i,createdOn:h.getTime()};try{var s=new Microsoft.Office.Common.Request(n,Microsoft.Office.Common.ActionType.registerEvent,u._conversationId,f,r),o=Microsoft.Office.Common.MessagePackager.envelope(s);u._targetWindow.postMessage(o,u._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();u._eventHandlerList[n]=t}catch(c){try{i!==null&&i(Microsoft.Office.Common.InvokeResultCode.errorInRequest,c)}finally{delete u._callbackList[f]}}},unregisterForEvent:function(n,t,i){var r=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"data",mayBeNull:!0,optional:!0}]);if(f)throw f;var u=r._callingIndex++,s=new Date;r._callbackList[u]={callback:t,createdOn:s.getTime()};try{var o=new Microsoft.Office.Common.Request(n,Microsoft.Office.Common.ActionType.unregisterEvent,r._conversationId,u,i),e=Microsoft.Office.Common.MessagePackager.envelope(o);r._targetWindow.postMessage(e,r._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(h){try{t!==null&&t(Microsoft.Office.Common.InvokeResultCode.errorInRequest,h)}finally{delete r._callbackList[u]}}finally{delete r._eventHandlerList[n]}}};Microsoft.Office.Common.XdmCommunicationManager=function(){var h="channel is not ready.",e="conversationId",v="Unknown conversation Id.",t=!1,n=null,s=[],r=n,g=10,o=t,u=n,it=2e3,y=65e3,p=y,f={},i={},c=t;function tt(n){for(var t in f)if(f[t]._conversations[n])return f[t];Sys.Debug.trace(v);throw Error.argument(e);}function rt(n){var t=i[n];if(!t){Sys.Debug.trace(v);throw Error.argument(e);}return t}function ft(t,i){var u=t._methodObjectList[i._actionName];if(!u){Sys.Debug.trace("The specified method is not registered on service endpoint:"+i._actionName);throw Error.argument("messageObject");}var r=n;r=i._actionType===Microsoft.Office.Common.ActionType.invoke?u:i._actionType===Microsoft.Office.Common.ActionType.registerEvent?u.getRegisterMethodObject():u.getUnregisterMethodObject();return r}function k(n){s.push(n)}function ut(){if(r!==n){if(!o)if(s.length>0){var t=s.shift();o=t.getInvokeBlockingFlag();t.invoke()}else{clearInterval(r);r=n}}else Sys.Debug.trace(h)}function nt(){if(u){var r,o=0,s=new Date,f;for(var c in i){r=i[c];for(var e in r._callbackList){var t=r._callbackList[e];f=t.timeout?t.timeout:p;if(f>=0&&Math.abs(s.getTime()-t.createdOn)>=f)try{t.callback&&t.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,n)}finally{delete r._callbackList[e]}else o++}}if(o===0){clearInterval(u);u=n}}else Sys.Debug.trace(h)}function b(){o=t}function w(n){if(window.addEventListener)window.addEventListener("message",n,t);else if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&window.attachEvent)window.attachEvent("onmessage",n);else{Sys.Debug.trace("Browser doesn't support the required API.");throw Error.argument("Browser");}}function l(n,i){var f=t;if(n===!0)return!0;if(!n||!i||!n.length||!i.length)return f;var r,u;r=document.createElement("a");u=document.createElement("a");r.href=n;u.href=i;f=r.hostname==u.hostname&&r.protocol==u.protocol&&r.port==u.port;delete r,u;return f}function d(t){var h="Access Denied";if(t.data!=""){var i;try{i=Microsoft.Office.Common.MessagePackager.unenvelope(t.data)}catch(nt){return}if(typeof i._messageType=="undefined")return;if(i._messageType===Microsoft.Office.Common.MessageType.request){var c=t.origin==n||t.origin=="null"?i._origin:t.origin;try{var u=tt(i._conversationId);if(!l(u._conversations[i._conversationId],t.origin))throw"Failed origin check";var a=u.getPolicyManager();if(a&&!a.checkPermission(i._conversationId,i._actionName,i._data))throw h;var p=ft(u,i),y=new Microsoft.Office.Common.InvokeCompleteCallback(t.source,c,i._actionName,i._conversationId,i._correlationId,b),d=new Microsoft.Office.Common.Invoker(p,i._data,y,u._eventHandlerProxyList,i._conversationId,i._actionName);r==n&&(r=setInterval(ut,g));k(d)}catch(nt){var s=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;nt==h&&(s=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied);var w=new Microsoft.Office.Common.Response(i._actionName,i._conversationId,i._correlationId,s,Microsoft.Office.Common.ResponseType.forCalling,nt),v=Microsoft.Office.Common.MessagePackager.envelope(w);t.source&&t.source.postMessage&&t.source.postMessage(v,c)}}else if(i._messageType===Microsoft.Office.Common.MessageType.response){var f=rt(i._conversationId);if(!l(f._targetUrl,t.origin))throw"Failed orgin check";if(i._responseType===Microsoft.Office.Common.ResponseType.forCalling){var o=f._callbackList[i._correlationId];if(o)try{o.callback&&o.callback(i._errorCode,i._data)}finally{delete f._callbackList[i._correlationId]}}else{var e=f._eventHandlerList[i._actionName];e!==undefined&&e!==n&&e(i._data)}}else return}}function a(){if(!c){w(d);c=!0}}return{connect:function(n,t,r){var u=i[n];if(!u){a();u=new Microsoft.Office.Common.ClientEndPoint(n,t,r);i[n]=u}return u},getClientEndPoint:function(n){var r=Function._validateParams(arguments,[{name:e,type:String,mayBeNull:t}]);if(r)throw r;return i[n]},createServiceEndPoint:function(n){a();var t=new Microsoft.Office.Common.ServiceEndPoint(n);f[n]=t;return t},getServiceEndPoint:function(n){var i=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:t}]);if(i)throw i;return f[n]},deleteClientEndPoint:function(n){var r=Function._validateParams(arguments,[{name:e,type:String,mayBeNull:t}]);if(r)throw r;delete i[n]},_setMethodTimeout:function(n){var i=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:t}]);if(i)throw i;p=n<=0?y:n},_startMethodTimeoutTimer:function(){u||(u=setInterval(nt,it))}}}();Microsoft.Office.Common.Message=function(n,t,i,r,u){var e=!1,f=this,o=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:e},{name:"actionName",type:String,mayBeNull:e},{name:"conversationId",type:String,mayBeNull:e},{name:"correlationId",mayBeNull:e},{name:"data",mayBeNull:!0,optional:!0}]);if(o)throw o;f._messageType=n;f._actionName=t;f._conversationId=i;f._correlationId=r;f._origin=window.location.href;f._data=typeof u=="undefined"?null:u};Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}};Microsoft.Office.Common.Request=function(n,t,i,r,u){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,n,i,r,u);this._actionType=t};OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message);Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType};Microsoft.Office.Common.Response=function(n,t,i,r,u,f){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,n,t,i,f);this._errorCode=r;this._responseType=u};OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message);Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode};Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType};Microsoft.Office.Common.MessagePackager={envelope:function(n){return Sys.Serialization.JavaScriptSerializer.serialize(n)},unenvelope:function(n){return Sys.Serialization.JavaScriptSerializer.deserialize(n,!0)}};Microsoft.Office.Common.ResponseSender=function(n,t,i,r,u,f){var s=!1,e=this,h=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:s},{name:"requesterUrl",type:String,mayBeNull:s},{name:"actionName",type:String,mayBeNull:s},{name:"conversationId",type:String,mayBeNull:s},{name:"correlationId",mayBeNull:s},{name:"responsetype",type:Number,maybeNull:s}]);if(h)throw h;e._requesterWindow=n;e._requesterUrl=t;e._actionName=i;e._conversationId=r;e._correlationId=u;e._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;e._responseType=f;var o=e;e._send=function(n){try{var i=new Microsoft.Office.Common.Response(o._actionName,o._conversationId,o._correlationId,o._invokeResultCode,o._responseType,n),t=Microsoft.Office.Common.MessagePackager.envelope(i);o._requesterWindow.postMessage(t,o._requesterUrl)}catch(r){Sys.Debug.trace("ResponseSender._send error:"+r.message)}}};Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(n){this._invokeResultCode=n}};Microsoft.Office.Common.InvokeCompleteCallback=function(n,t,i,r,u,f){var o=this;Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(o,n,t,i,r,u,Microsoft.Office.Common.ResponseType.forCalling);o._postCallbackHandler=f;var e=o;o._send=function(n){try{var i=new Microsoft.Office.Common.Response(e._actionName,e._conversationId,e._correlationId,e._invokeResultCode,e._responseType,n),t=Microsoft.Office.Common.MessagePackager.envelope(i);e._requesterWindow.postMessage(t,e._requesterUrl);e._postCallbackHandler()}catch(r){Sys.Debug.trace("InvokeCompleteCallback._send error:"+r.message)}}};OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender);Microsoft.Office.Common.Invoker=function(n,t,i,r,u,f){var o=!1,e=this,s=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:o},{name:"paramValue",mayBeNull:!0},{name:"invokeCompleteCallback",mayBeNull:o},{name:"eventHandlerProxyList",mayBeNull:!0},{name:"conversationId",type:String,mayBeNull:o},{name:"eventName",type:String,mayBeNull:o}]);if(s)throw s;e._methodObject=n;e._param=t;e._invokeCompleteCallback=i;e._eventHandlerProxyList=r;e._conversationId=u;e._eventName=f};Microsoft.Office.Common.Invoker.prototype={invoke:function(){var n=this;try{var t;switch(n._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:n._methodObject.getMethod()(n._param,n._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:t=n._methodObject.getMethod()(n._param);n._invokeCompleteCallback.getSend()(t);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent:var r=n._createEventHandlerProxyObject(n._invokeCompleteCallback);t=n._methodObject.getMethod()(r.getSend(),n._param);n._eventHandlerProxyList[n._conversationId+n._eventName]=r.getSend();n._invokeCompleteCallback.getSend()(t);break;case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:var f=n._eventHandlerProxyList[n._conversationId+n._eventName];t=n._methodObject.getMethod()(f,n._param);delete n._eventHandlerProxyList[n._conversationId+n._eventName];n._invokeCompleteCallback.getSend()(t);break;case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:var i=n._createEventHandlerProxyObject(n._invokeCompleteCallback);n._methodObject.getMethod()(i.getSend(),n._invokeCompleteCallback.getSend(),n._param);n._eventHandlerProxyList[n._callerId+n._eventName]=i.getSend();break;case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:var u=n._eventHandlerProxyList[n._callerId+n._eventName];n._methodObject.getMethod()(u,n._invokeCompleteCallback.getSend(),n._param);delete n._eventHandlerProxyList[n._callerId+n._eventName]}}catch(e){n._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);n._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(n){return new Microsoft.Office.Common.ResponseSender(n.getRequesterWindow(),n.getRequesterUrl(),n.getActionName(),n.getConversationId(),n.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing)}};OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"};OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var t=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource],n={};OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,t,n)};OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]);OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.getDelegateMethods=function(){var n={};n[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync;n[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync;n[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync;return n};OSF.DDA.WAC.Delegate.version=1;OSF.DDA.WAC.Delegate.executeAsync=function(n){n.hostCallArgs||(n.hostCallArgs={});n.hostCallArgs.DdaMethod={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:n.dispId};n.hostCallArgs.__timeout__=-1;n.onCalling&&n.onCalling();var t=+new Date;OSF.getClientEndPoint().invoke("executeMethod",function(i,r){n.onReceiving&&n.onReceiving();var u;if(i==Microsoft.Office.Common.InvokeResultCode.noError){OSF.DDA.WAC.Delegate.version=r.Version;u=r.Error}else switch(i){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:u=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:u=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}n.onComplete&&n.onComplete(u,r);OSF.AppTelemetry&&OSF.AppTelemetry.onMethodDone(n.dispId,null,Math.abs(+new Date-t),u)},n.hostCallArgs)};OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(n,t){var i=+new Date;return function(r,u){t.onReceiving&&t.onReceiving();var f;if(r!=Microsoft.Office.Common.InvokeResultCode.noError)switch(r){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:f=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:f=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else f=u?u.Error?u.Error:OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess:OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;t.onComplete&&t.onComplete(f);OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(n,t.dispId,Math.abs(+new Date-i),f)}};OSF.DDA.WAC.Delegate.registerEventAsync=function(n){n.onCalling&&n.onCalling();OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(n.targetId,n.eventType),function(t){n.onEvent&&n.onEvent(t);OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(n.dispId)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,n),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:n.dispId,targetId:n.targetId})};OSF.DDA.WAC.Delegate.unregisterEventAsync=function(n){n.onCalling&&n.onCalling();OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(n.targetId,n.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,n),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:n.dispId,targetId:n.targetId})};(function(){var n="undefined",r=function(){var o=function(n){n&&OSF.OUtil.loadScript(n,function(){Sys.Debug.trace("loaded customized script:"+n)})},f,e,t,i=null,u=OSF.OUtil.parseXdmInfo();if(u){t=OSF.OUtil.getInfoItems(u);if(t&&t.length>=3){f=t[0];e=t[2];i=Microsoft.Office.Common.XdmCommunicationManager.connect(f,window.parent,e)}}var r=null;if(i)try{i.invoke("getCustomizedScriptPathAsync",function(n,t){o(n===0?t:null)},{__timeout__:1e3})}catch(s){Sys.Debug.trace("no script override through cross frame communication.")}else{try{typeof window.external.getCustomizedScriptPath!==n&&(r=window.external.getCustomizedScriptPath())}catch(s){Sys.Debug.trace("no script override through window.external.")}o(r)}},i=function(){var t="function";return typeof Sys!==n&&typeof Type!==n&&Sys.StringBuilder&&typeof Sys.StringBuilder===t&&Type.registerNamespace&&typeof Type.registerNamespace===t&&Type.registerClass&&typeof Type.registerClass===t?!0:!1};if(i())r();else if(typeof Function!==n){var u=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js",t=function(){if(i())r();else if(typeof Function!==n)throw"Not able to load MicrosoftAjax.js.";};OSF._OfficeAppFactory&&OSF._OfficeAppFactory&&OSF._OfficeAppFactory.getLoadScriptHelper&&OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId)?OSF._OfficeAppFactory.getLoadScriptHelper().waitForScripts([OSF.ConstantNames.MicrosoftAjaxId],t):OSF.OUtil.loadScript(u,t)}})();OSF.InitializationHelper=function(n,t,i,r,u){var f=this;f._hostInfo=n;f._webAppState=t;f._context=i;f._settings=r;f._hostFacade=u;f._initializeSettings=function(n,t){var u,r=n.get_settings(),f=OSF.OUtil.getSessionStorage();if(f){var i=f.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());if(i)r=JSON?JSON.parse(i):Sys.Serialization.JavaScriptSerializer.deserialize(i,!0);else{i=JSON?JSON.stringify(r):Sys.Serialization.JavaScriptSerializer.serialize(r);f.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),i)}}var e=OSF.DDA.SettingsManager.deserializeSettings(r);u=t?new OSF.DDA.RefreshableSettings(e):new OSF.DDA.Settings(e);return u};var e=function(n){var t=window.open;n.open=function(n,i,r){var u=null;try{u=t(n,i,r)}catch(e){}if(!u){var f={strUrl:n,strWindowName:i,strWindowFeatures:r};OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,f)}return u}};e(window)};OSF.InitializationHelper.prototype.getAppContext=function(n,t){var i=function(n,i){var r;if(i._appName===OSF.AppName.ExcelWebApp){var e=i._settings;r={};for(var o in e){var u=e[o];r[u[0]]=u[1]}}else r=i._settings;if(n===0&&i._id!=undefined&&i._appName!=undefined&&i._appVersion!=undefined&&i._appUILocale!=undefined&&i._dataLocale!=undefined&&i._docUrl!=undefined&&i._clientMode!=undefined&&i._settings!=undefined&&i._reason!=undefined){var f=new OSF.OfficeAppContext(i._id,i._appName,i._appVersion,i._appUILocale,i._dataLocale,i._docUrl,i._clientMode,r,i._reason,i._osfControlType,i._eToken,i._correlationId,i._id);OSF.AppTelemetry&&OSF.AppTelemetry.initialize(f);t(f)}else throw"Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+n;};this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",i,this._webAppState.id)};OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){var r="ContextActivationManager_notifyHost",t=!1,n=this,u=OSF.OUtil.parseXdmInfoWithGivenFragment(t,OSF._OfficeAppFactory.getWindowLocationHash());if(u){var i=OSF.OUtil.getInfoItems(u);if(i!=undefined&&i.length===3){n._webAppState.conversationID=i[0];n._webAppState.id=i[1];n._webAppState.webAppUrl=i[2]}}n._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(n._webAppState.conversationID,n._webAppState.wnd,n._webAppState.webAppUrl);n._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(n._webAppState.id);var o=n._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;n._webAppState.serviceEndPoint.registerConversation(o,n._webAppState.webAppUrl);var e=function(){if(!n._webAppState.focused){n._webAppState.focused=!0;for(var r=document.querySelectorAll("input,a,button"),t=0;t6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){i=new Date(parseInt(t.slice(5,-1)));if(i)return i}return t}):Sys.Serialization.JavaScriptSerializer.deserialize(t,!0);r[i]=t}catch(u){}}return r}};OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(n,t,i){Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact",FlightReservations:"flightReservations",ParcelDeliveries:"parcelDeliveries"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item"};Microsoft.Office.WebExtension.MailboxEnums.BodyType={Text:"text",Html:"html"};Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType={ProgressIndicator:"progressIndicator",InformationalMessage:"informationalMessage",ErrorMessage:"errorMessage"};Microsoft.Office.WebExtension.CoercionType={Text:"text",Html:"html"};Type.registerNamespace("OSF.DDA");OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d_$2r_0=Function.createDelegate(this,this.$2r_0);this.$$d_$3E_0=Function.createDelegate(this,this.$3E_0);this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);this.$$d_$3z_0=Function.createDelegate(this,this.$3z_0);this.$$d_$3x_0=Function.createDelegate(this,this.$3x_0);this.$$d_$4S_0=Function.createDelegate(this,this.$4S_0);this.$$d_$48_0=Function.createDelegate(this,this.$48_0);this.$$d_$45_0=Function.createDelegate(this,this.$45_0);OSF.DDA.OutlookAppOm.$2=this;this.$X_0=n;this.$18_0=i;var u=this;var r=function(){i&&u.$E_0(1,"GetInitialData",null,u.$$d_$45_0)};this.$1t_0()?r():this.$4a_0(r)};OSF.DDA.OutlookAppOm.$G=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};OSF.DDA.OutlookAppOm.$9=function(n,t,i,r){if(ni)throw Error.argumentOutOfRange(r);};OSF.DDA.OutlookAppOm.$43=function(n){var t="";if("htmlBody"in n){OSF.DDA.OutlookAppOm.$4t(n.htmlBody);t=n.htmlBody}return t};OSF.DDA.OutlookAppOm.$2F=function(n){var t=[];if("attachments"in n){t=n.attachments;OSF.DDA.OutlookAppOm.$4r(t)}return t};OSF.DDA.OutlookAppOm.$4E=function(n){var t=[];"options"in n&&(t[0]=n.options);"callback"in n&&(t[t.length]=n.callback);return t};OSF.DDA.OutlookAppOm.$30=function(n){var r=new Array(0);if(Array.isInstanceOfType(n))for(var t=0;t2048)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text);OSF.DDA.OutlookAppOm.$2l(t)};OSF.DDA.OutlookAppOm.$4q=function(n,t){if(!String.isInstanceOfType(n)||!String.isInstanceOfType(t))throw Error.argument("attachments");if(n.length>200)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text);OSF.DDA.OutlookAppOm.$2l(t)};OSF.DDA.OutlookAppOm.$2l=function(n){if(n.length>255)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text);};OSF.DDA.OutlookAppOm.$T=function(n,t,i){if(Object.getType(n)!==t)throw Error.argumentType(i);};OSF.DDA.OutlookAppOm.$1r=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm.$T(n,String,r);var u=n;OSF.DDA.OutlookAppOm.$9(u.length,t,i,r)}};OSF.DDA.OutlookAppOm.$2x=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:case 14:case 18:case 26:case 32:case 41:case 34:break;case 4:var r=JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm.$1C(t.requiredAttendees),OSF.DDA.OutlookAppOm.$1C(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm.$1C(t.resources),t.subject,t.body];break;case 40:i=[t.marketplaceAssetId,t.consentState];break;case 11:case 10:i=[t.htmlBody];break;case 31:case 30:i=[t.htmlBody,t.attachments];break;case 23:case 13:case 38:case 29:i=[t.data,t.coercionType];break;case 37:case 28:i=[t.coercionType];break;case 17:i=[t.subject];break;case 15:i=[t.recipientField];break;case 22:case 21:i=[t.recipientField,OSF.DDA.OutlookAppOm.$2v(t.recipientArray)];break;case 19:i=[t.itemId,t.name];break;case 16:i=[t.uri,t.name];break;case 20:i=[t.attachmentIndex];break;case 25:i=[t.TimeProperty,t.time];break;case 24:i=[t.TimeProperty];break;case 27:i=[t.location];break;case 33:case 35:i=[t.key,t.type,t.persistent,t.message,t.icon];break;case 36:i=[t.key];break;default:break}return i};OSF.DDA.OutlookAppOm.$1C=function(n){return n?n.join(";"):null};OSF.DDA.OutlookAppOm.$2v=function(n){if(!n)return null;for(var i=new Array(n.length),t=0;tOSF.DDA.OutlookAppOm.$2Y)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);this.$5_0(3,"makeEwsRequestAsync");var u=$h.CommonParameters.parse(r,!0,!0);var t=new $h.EwsRequest(u.$4_0);var f=this;t.onreadystatechange=function(){4===t.get_$1f_1()&&u.$3_0(t.$P_0)};t.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$E_0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$E_0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$E_0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this.$7_0&&this.$7_0.get_$1l_0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this.$26_0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this.$1G_0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this.$3D_0(n);if(this.$7_0&&this.$7_0.get_$1l_0()){var i=this.$26_0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},getUserIdentityTokenAsync:function(){for(var i=[],n=0;n1&&f[1]){i.error=!0;i.errorCode=f[1]}else i.error=!1;r(t,i)}else if(Number.isInstanceOfType(u)){var e={};e.error=!0;e.errorCode=u;r(t,e)}else throw Error.notImplemented("Return data type from host must be Dictionary or int");}})}else r&&r(-2,null)},$3D_0:function(n){var t=new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds?n.milliseconds:0);if(isNaN(t.getTime()))throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);return t},$1G_0:function(n){var t={};t.month=n.getMonth();t.date=n.getDate();t.year=n.getFullYear();t.hours=n.getHours();t.minutes=n.getMinutes();t.seconds=n.getSeconds();t.milliseconds=n.getMilliseconds();return t},$3E_0:function(n){var u=OSF.DDA.OutlookAppOm.$2n(n.requiredAttendees,"requiredAttendees");var r=OSF.DDA.OutlookAppOm.$2n(n.optionalAttendees,"optionalAttendees");OSF.DDA.OutlookAppOm.$1r(n.location,0,OSF.DDA.OutlookAppOm.$2Z,"location");OSF.DDA.OutlookAppOm.$1r(n.body,0,OSF.DDA.OutlookAppOm.maxBodyLength,"body");OSF.DDA.OutlookAppOm.$1r(n.subject,0,OSF.DDA.OutlookAppOm.$2b,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){OSF.DDA.OutlookAppOm.$T(n.start,Date,"start");var o=n.start;n.start=o.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){OSF.DDA.OutlookAppOm.$T(n.end,Date,"end");var i=n.end;if(i=0&&n.getTime()-u<0)return parseInt(t.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},$1t_0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},$4a_0:function(n){for(var s=null,l="",a=document.getElementsByTagName("script"),o=a.length-1;o>=0;o--){var i=null;var v=a[o].attributes;if(v){var p=v.getNamedItem("src");p&&(i=p.value);if(i){var y=!1;i=i.toLowerCase();var f=i.indexOf("office_strings.js");if(f<0){f=i.indexOf("office_strings.debug.js");y=!0}if(f>0&&fu+1&&(l=r.substring(0,u+1));break}}}}if(s){var h=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var c=this;var w=function(){if(!c.$1t_0()){var n=l+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=c.$20_0(n);t.onload=e;t.onreadystatechange=e;h.appendChild(t)}};t=this.$20_0(s);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);h.appendChild(t)}},$20_0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};OSF.DDA.Settings=function(n){this.$v_0=n};OSF.DDA.Settings.$2w=function(n){if(!n)return{};if(OSF.DDA.OutlookAppOm.$2.get_$17_0()===8){var t=n.SettingsKey;if(t)return OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={$v_0:null,$y_0:null,get_$Q_0:function(){if(!this.$y_0){this.$y_0=OSF.DDA.Settings.$2w(this.$v_0);this.$v_0=null}return this.$y_0},get:function(n){return this.get_$Q_0()[n]},set:function(n,t){this.get_$Q_0()[n]=t},remove:function(n){delete this.get_$Q_0()[n]},saveAsync:function(){for(var i=[],t=0;t32768){var r=OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9019,n.$4_0,"");var u=this;window.setTimeout(function(){n.$3_0(r)},0);return}OSF.DDA.OutlookAppOm.$2.get_$17_0()===64?this.$4l_0(n.$3_0,n.$4_0):this.$4k_0(n.$3_0,n.$4_0)},$4k_0:function(n,t){var r=null;try{var f=OSF.DDA.SettingsManager.serializeSettings(this.get_$Q_0());var e=JSON.stringify(f);var u={SettingsKey:e};OSF.DDA.ClientSettingsManager.write(u)}catch(o){r=o}if(n){var i;i=r?OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9019,t,r.message):OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,0,0,t,null);n(i)}},$4l_0:function(n,t){var i=OSF.DDA.SettingsManager.serializeSettings(this.get_$Q_0());var r=this;OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(i,r){if(n){var u;if(i)u=OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9017,t,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,i));else{var f=r;u=f.error?OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9019,t,f.errorMessage):OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,0,0,t,null)}n(u)}},[i])}};Type.registerNamespace("$h");Type.registerNamespace("Office.cast");$h.Appointment=function(n){this.$$d_$4F_2=Function.createDelegate(this,this.$4F_2);this.$$d_$2N_2=Function.createDelegate(this,this.$2N_2);this.$$d_$o_2=Function.createDelegate(this,this.$o_2);this.$$d_$4L_2=Function.createDelegate(this,this.$4L_2);this.$$d_$1Z_2=Function.createDelegate(this,this.$1Z_2);this.$$d_$1W_2=Function.createDelegate(this,this.$1W_2);this.$$d_$n_2=Function.createDelegate(this,this.$n_2);this.$$d_$1U_2=Function.createDelegate(this,this.$1U_2);this.$$d_$1a_2=Function.createDelegate(this,this.$1a_2);$h.Appointment.initializeBase(this,[n]);$h.InitialData.$1(this,"start",this.$$d_$1a_2);$h.InitialData.$1(this,"end",this.$$d_$1U_2);$h.InitialData.$1(this,"location",this.$$d_$n_2);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1W_2);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_2);$h.InitialData.$1(this,"resources",this.$$d_$4L_2);$h.InitialData.$1(this,"subject",this.$$d_$o_2);$h.InitialData.$1(this,"normalizedSubject",this.$$d_$2N_2);$h.InitialData.$1(this,"organizer",this.$$d_$4F_2)};$h.Appointment.prototype={getEntities:function(){return this.$0_0.$m_0()},getEntitiesByType:function(n){return this.$0_0.$2K_0(n)},getRegExMatches:function(){OSF.DDA.OutlookAppOm.$2.$5_0(1,"getRegExMatches");return this.$0_0.$1Y_0()},getFilteredEntitiesByName:function(n){return this.$0_0.$1V_0(n)},getRegExMatchesByName:function(n){OSF.DDA.OutlookAppOm.$2.$5_0(1,"getRegExMatchesByName");return this.$0_0.$2R_0(n)},displayReplyForm:function(n){OSF.DDA.OutlookAppOm.$2.$23_0(n)},displayReplyAllForm:function(n){OSF.DDA.OutlookAppOm.$2.$22_0(n)},getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},$1a_2:function(){return this.$0_0.get_$2h_0()},$1U_2:function(){return this.$0_0.get_$25_0()},$n_2:function(){return this.$0_0.get_$2W_0()},$1W_2:function(){return this.$0_0.get_$1A_0()},$1Z_2:function(){return this.$0_0.get_$1m_0()},$4L_2:function(){return this.$0_0.get_$4j_0()},$o_2:function(){return this.$0_0.get_$2k_0()},$2N_2:function(){return this.$0_0.get_$2c_0()},$4F_2:function(){return this.$0_0.get_$4d_0()}};$h.AppointmentCompose=function(n){this.$$d_$n_2=Function.createDelegate(this,this.$n_2);this.$$d_$1U_2=Function.createDelegate(this,this.$1U_2);this.$$d_$1a_2=Function.createDelegate(this,this.$1a_2);this.$$d_$1W_2=Function.createDelegate(this,this.$1W_2);this.$$d_$1Z_2=Function.createDelegate(this,this.$1Z_2);$h.AppointmentCompose.initializeBase(this,[n]);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_2);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1W_2);$h.InitialData.$1(this,"start",this.$$d_$1a_2);$h.InitialData.$1(this,"end",this.$$d_$1U_2);$h.InitialData.$1(this,"location",this.$$d_$n_2)};$h.AppointmentCompose.prototype={$w_2:null,$t_2:null,$z_2:null,$j_2:null,$p_2:null,getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},$1Z_2:function(){this.$0_0.$A_0();this.$w_2||(this.$w_2=new $h.ComposeRecipient(0,"requiredAttendees"));return this.$w_2},$1W_2:function(){this.$0_0.$A_0();this.$t_2||(this.$t_2=new $h.ComposeRecipient(1,"optionalAttendees"));return this.$t_2},$1a_2:function(){this.$0_0.$A_0();this.$z_2||(this.$z_2=new $h.ComposeTime(1));return this.$z_2},$1U_2:function(){this.$0_0.$A_0();this.$j_2||(this.$j_2=new $h.ComposeTime(2));return this.$j_2},$n_2:function(){this.$0_0.$A_0();this.$p_2||(this.$p_2=new $h.ComposeLocation);return this.$p_2}};$h.AttachmentConstants=function(){};$h.AttachmentDetails=function(n){this.$$d_$47_0=Function.createDelegate(this,this.$47_0);this.$$d_$3o_0=Function.createDelegate(this,this.$3o_0);this.$$d_$4N_0=Function.createDelegate(this,this.$4N_0);this.$$d_$3u_0=Function.createDelegate(this,this.$3u_0);this.$$d_$4C_0=Function.createDelegate(this,this.$4C_0);this.$$d_$44_0=Function.createDelegate(this,this.$44_0);this.$0_0=n;$h.InitialData.$1(this,"id",this.$$d_$44_0);$h.InitialData.$1(this,"name",this.$$d_$4C_0);$h.InitialData.$1(this,"contentType",this.$$d_$3u_0);$h.InitialData.$1(this,"size",this.$$d_$4N_0);$h.InitialData.$1(this,"attachmentType",this.$$d_$3o_0);$h.InitialData.$1(this,"isInline",this.$$d_$47_0)};$h.AttachmentDetails.prototype={$0_0:null,$44_0:function(){return this.$0_0.id},$4C_0:function(){return this.$0_0.name},$3u_0:function(){return this.$0_0.contentType},$4N_0:function(){return this.$0_0.size},$3o_0:function(){var n=this.$0_0.attachmentType;return n<$h.AttachmentDetails.$19.length?$h.AttachmentDetails.$19[n]:Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File},$47_0:function(){return this.$0_0.isInline}};$h.Body=function(){};$h.Body.$W=function(n,t){var r={data:n};if(t.$S_0&&!$h.ScriptHelpers.isNull(t.$S_0.coercionType)){var i;var f,u;if(!(u=$h.Body.$2m(t.$S_0.coercionType,f={val:i}),i=f.val,u)){t.$3_0&&t.$3_0(OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,1e3,t.$4_0,null));return null}r.coercionType=i}else r.coercionType=0;return r};$h.Body.$2m=function(n,t){t.val=undefined;if(n===Microsoft.Office.WebExtension.CoercionType.Html)t.val=3;else if(n===Microsoft.Office.WebExtension.CoercionType.Text)t.val=0;else return!1;return!0};$h.Body.prototype={getAsync:function(){for(var r=[],n=0;n255)throw Error.argumentOutOfRange("recipients",n.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text);if(t&&t.length>571)throw Error.argumentOutOfRange("recipients",t.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text);};$h.ComposeRecipient.$3n=function(n){for(var r=n,i=[],t=0;t864e13)throw Error.argumentOutOfRange("dateTime");var i=$h.CommonParameters.parse(r,!1);OSF.DDA.OutlookAppOm.$2.$8_0(25,"SetTimeAsync",{TimeProperty:this.$Z_0,time:n.getTime()},null,i.$4_0,i.$3_0)},$4u_0:function(n){var t=n;return new Date(t)},$2P_0:function(){return this.$Z_0===1?"start":"end"}};$h.ComposeTime.TimeType=function(){};$h.ComposeTime.TimeType.prototype={start:1,end:2};$h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",!1);$h.Contact=function(n){this.$$d_$3t_0=Function.createDelegate(this,this.$3t_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$$d_$1b_0=Function.createDelegate(this,this.$1b_0);this.$$d_$1T_0=Function.createDelegate(this,this.$1T_0);this.$$d_$1X_0=Function.createDelegate(this,this.$1X_0);this.$$d_$3r_0=Function.createDelegate(this,this.$3r_0);this.$$d_$4I_0=Function.createDelegate(this,this.$4I_0);this.$0_0=n;$h.InitialData.$1(this,"personName",this.$$d_$4I_0);$h.InitialData.$1(this,"businessName",this.$$d_$3r_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$1X_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$1T_0);$h.InitialData.$1(this,"urls",this.$$d_$1b_0);$h.InitialData.$1(this,"addresses",this.$$d_$1Q_0);$h.InitialData.$1(this,"contactString",this.$$d_$3t_0)};$h.Contact.prototype={$0_0:null,$K_0:null,$4I_0:function(){return this.$0_0.PersonName},$3r_0:function(){return this.$0_0.BusinessName},$1Q_0:function(){return $h.Entities.$I(this.$0_0,"Addresses")},$1T_0:function(){return $h.Entities.$I(this.$0_0,"EmailAddresses")},$1b_0:function(){return $h.Entities.$I(this.$0_0,"Urls")},$1X_0:function(){if(!this.$K_0){var n=this;this.$K_0=$h.Entities.$D($h.PhoneNumber,this.$0_0,"PhoneNumbers",function(n){return new $h.PhoneNumber(n)})}return this.$K_0},$3t_0:function(){return this.$0_0.ContactString}};$h.CustomProperties=function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");if(Array.isInstanceOfType(n)){var t=n;if(t.length>0)this.$0_0=t[0];else throw Error.argument("data");}else this.$0_0=n};$h.CustomProperties.prototype={$0_0:null,get:function(n){var i=this.$0_0[n];if(typeof i=="string"){var t=i;if(t.length>6&&t.startsWith("Date(")&&t.endsWith(")")){var f=t.substring(5,t.length-1);var r=parseInt(f);if(!isNaN(r)){var u=new Date(r);u&&(i=u)}}}return i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")");this.$0_0[n]=t},remove:function(n){delete this.$0_0[n]},saveAsync:function(){for(var i=[],n=0;nu)throw Error.argument();var t=$h.CommonParameters.parse(i,!1,!0);var r=new $h.SaveDictionaryRequest(t.$3_0,t.$4_0);r.$1i_0(4,"SaveCustomProperties",{customProperties:this.$0_0})}};$h.Diagnostics=function(n,t){this.$$d_$4H_0=Function.createDelegate(this,this.$4H_0);this.$$d_$42_0=Function.createDelegate(this,this.$42_0);this.$$d_$41_0=Function.createDelegate(this,this.$41_0);this.$0_0=n;this.$U_0=t;$h.InitialData.$1(this,"hostName",this.$$d_$41_0);$h.InitialData.$1(this,"hostVersion",this.$$d_$42_0);64===this.$U_0&&$h.InitialData.$1(this,"OWAView",this.$$d_$4H_0)};$h.Diagnostics.prototype={$0_0:null,$U_0:0,$41_0:function(){if(8===this.$U_0)return"Outlook";else if(64===this.$U_0)return"OutlookWebApp";return null},$42_0:function(){return this.$0_0.get_$4T_0()},$4H_0:function(){return this.$0_0.get_$4f_0()}};$h.EmailAddressDetails=function(n){this.$$d_$2Q_0=Function.createDelegate(this,this.$2Q_0);this.$$d_$2E_0=Function.createDelegate(this,this.$2E_0);this.$$d_$1R_0=Function.createDelegate(this,this.$1R_0);this.$$d_$1S_0=Function.createDelegate(this,this.$1S_0);this.$0_0=n;$h.InitialData.$1(this,"emailAddress",this.$$d_$1S_0);$h.InitialData.$1(this,"displayName",this.$$d_$1R_0);$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData.$1(this,"appointmentResponse",this.$$d_$2E_0);$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData.$1(this,"recipientType",this.$$d_$2Q_0)};$h.EmailAddressDetails.$1y=function(n){var t={};var r=n.Name;var i=n.UserId;t.name=r||$h.EmailAddressDetails.$1K;t.address=i||$h.EmailAddressDetails.$1K;return new $h.EmailAddressDetails(t)};$h.EmailAddressDetails.prototype={$0_0:null,toJSON:function(){var n={};n.emailAddress=this.$1S_0();n.displayName=this.$1R_0();$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"appointmentResponse")&&(n.appointmentResponse=this.$2E_0());$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"recipientType")&&(n.recipientType=this.$2Q_0());return n},$1S_0:function(){return this.$0_0.address},$1R_0:function(){return this.$0_0.name},$2E_0:function(){var n=this.$0_0.appointmentResponse;return n<$h.EmailAddressDetails.$1h.length?$h.EmailAddressDetails.$1h[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},$2Q_0:function(){var n=this.$0_0.recipientType;return n<$h.EmailAddressDetails.$1e.length?$h.EmailAddressDetails.$1e[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}};$h.Entities=function(n,t,i,r){this.$$d_$34_0=Function.createDelegate(this,this.$34_0);this.$$d_$2O_0=Function.createDelegate(this,this.$2O_0);this.$$d_$2L_0=Function.createDelegate(this,this.$2L_0);this.$$d_$2I_0=Function.createDelegate(this,this.$2I_0);this.$$d_$1X_0=Function.createDelegate(this,this.$1X_0);this.$$d_$1b_0=Function.createDelegate(this,this.$1b_0);this.$$d_$1T_0=Function.createDelegate(this,this.$1T_0);this.$$d_$2M_0=Function.createDelegate(this,this.$2M_0);this.$$d_$2S_0=Function.createDelegate(this,this.$2S_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$0_0=n||{};this.$1L_0=t||{};this.$N_0=i;$h.InitialData.$1(this,"addresses",this.$$d_$1Q_0);$h.InitialData.$1(this,"taskSuggestions",this.$$d_$2S_0);$h.InitialData.$1(this,"meetingSuggestions",this.$$d_$2M_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$1T_0);$h.InitialData.$1(this,"urls",this.$$d_$1b_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$1X_0);$h.InitialData.$1(this,"contacts",this.$$d_$2I_0);$h.InitialData.$1(this,"flightReservations",this.$$d_$2L_0);$h.InitialData.$1(this,"parcelDeliveries",this.$$d_$2O_0);this.$B_0=r};$h.Entities.$D=function(n,t,i,r,u,f){var o=null;var e=t[i];if(!e)return new Array(0);u&&(e=$h.Entities.$2d(Object,e,$h.Entities.$3H,f));o=new Array(e.length);for(var c=0,l=e,a=l.length,s=0;s=0;u--){for(var e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t};$h.Entities.prototype={$N_0:null,$0_0:null,$1L_0:null,$F_0:null,$B_0:0,$11_0:null,$q_0:null,$K_0:null,$h_0:null,$a_0:null,$i_0:null,$15_0:null,$l_0:null,$u_0:null,$3s_0:function(n){if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)return this.$2M_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)return this.$2S_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)return this.$1Q_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)return this.$1X_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)return this.$1T_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)return this.$1b_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)return this.$2I_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.FlightReservations)return this.$2L_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.ParcelDeliveries)return this.$2O_0();return null},$1V_0:function(n){this.$F_0||(this.$F_0={});if(!$h.ScriptHelpers.dictionaryContainsKey(this.$F_0,n)){for(var r=!1,i=0;i<$h.Entities.$16.length;i++){var u=$h.Entities.$16[i];var t=this.$1L_0[u];if(t&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this.$F_0[n]=$h.Entities.$I(t,n);break;case"Addresses":this.$F_0[n]=$h.Entities.$I(t,n,!0);break;case"PhoneNumbers":this.$F_0[n]=$h.Entities.$D($h.PhoneNumber,t,n,$h.Entities.$1z,!1,null);break;case"TaskSuggestions":this.$F_0[n]=$h.Entities.$D($h.TaskSuggestion,t,n,$h.Entities.$21,!0,"TaskString");break;case"MeetingSuggestions":this.$F_0[n]=$h.Entities.$D($h.MeetingSuggestion,t,n,this.$$d_$34_0,!0,"MeetingString");break;case"Contacts":this.$F_0[n]=$h.Entities.$D($h.Contact,t,n,$h.Entities.$1w,!0,"ContactString");break}r=!0;break}}r||(this.$F_0[n]=null)}return this.$F_0[n]},$34_0:function(n){return new $h.MeetingSuggestion(n,this.$N_0)},$1Q_0:function(){this.$a_0||(this.$a_0=$h.Entities.$I(this.$0_0,"Addresses",!0));return this.$a_0},$1T_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$i_0||(this.$i_0=$h.Entities.$I(this.$0_0,"EmailAddresses",!1));return this.$i_0},$1b_0:function(){this.$15_0||(this.$15_0=$h.Entities.$I(this.$0_0,"Urls",!1));return this.$15_0},$1X_0:function(){this.$K_0||(this.$K_0=$h.Entities.$D($h.PhoneNumber,this.$0_0,"PhoneNumbers",$h.Entities.$1z));return this.$K_0},$2S_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$11_0||(this.$11_0=$h.Entities.$D($h.TaskSuggestion,this.$0_0,"TaskSuggestions",$h.Entities.$21,!0,"TaskString"));return this.$11_0},$2M_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$q_0||(this.$q_0=$h.Entities.$D($h.MeetingSuggestion,this.$0_0,"MeetingSuggestions",this.$$d_$34_0,!0,"MeetingString"));return this.$q_0},$2I_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$h_0||(this.$h_0=$h.Entities.$D($h.Contact,this.$0_0,"Contacts",$h.Entities.$1w,!0,"ContactString"));return this.$h_0},$2O_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$u_0||(this.$u_0=$h.Entities.$D(Object,this.$0_0,"ParcelDeliveries",null));return this.$u_0},$2L_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$l_0||(this.$l_0=$h.Entities.$D(Object,this.$0_0,"FlightReservations",null));return this.$l_0}};$h.ReplyConstants=function(){};$h.AsyncConstants=function(){};Office.cast.item=function(){};Office.cast.item.toItemRead=function(n){if($h.Item.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toItemCompose=function(n){if($h.ComposeItem.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessage=function(n){return Office.cast.item.toMessageRead(n)};Office.cast.item.toMessageRead=function(n){if($h.Message.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessageCompose=function(n){if($h.MessageCompose.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMeetingRequest=function(n){if($h.MeetingRequest.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointment=function(n){return Office.cast.item.toAppointmentRead(n)};Office.cast.item.toAppointmentRead=function(n){if($h.Appointment.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointmentCompose=function(n){if($h.AppointmentCompose.isInstanceOfType(n))return n;throw Error.argumentType();};$h.Item=function(n){this.$$d_$2G_1=Function.createDelegate(this,this.$2G_1);this.$$d_$2F_1=Function.createDelegate(this,this.$2F_1);this.$$d_$49_1=Function.createDelegate(this,this.$49_1);this.$$d_$4A_1=Function.createDelegate(this,this.$4A_1);this.$$d_$3w_1=Function.createDelegate(this,this.$3w_1);this.$$d_$3v_1=Function.createDelegate(this,this.$3v_1);$h.Item.initializeBase(this,[n]);$h.InitialData.$1(this,"dateTimeCreated",this.$$d_$3v_1);$h.InitialData.$1(this,"dateTimeModified",this.$$d_$3w_1);$h.InitialData.$1(this,"itemId",this.$$d_$4A_1);$h.InitialData.$1(this,"itemClass",this.$$d_$49_1);$h.InitialData.$1(this,"attachments",this.$$d_$2F_1);$h.InitialData.$1(this,"body",this.$$d_$2G_1)};$h.Item.prototype={$H_1:null,$4A_1:function(){return this.$0_0.get_$4Z_0()},$49_1:function(){return this.$0_0.get_$4Y_0()},$3v_1:function(){return this.$0_0.get_$36_0()},$3w_1:function(){return this.$0_0.get_$37_0()},$2F_1:function(){return this.$0_0.get_$2p_0()},$2G_1:function(){this.$H_1||(this.$H_1=new $h.Body);return this.$H_1}};$h.ItemBase=function(n){this.$$d_$31_0=Function.createDelegate(this,this.$31_0);this.$$d_$4D_0=Function.createDelegate(this,this.$4D_0);this.$$d_getItemType=Function.createDelegate(this,this.getItemType);this.$0_0=n;$h.InitialData.$1(this,"itemType",this.$$d_getItemType);$h.InitialData.$1(this,"notificationMessages",this.$$d_$4D_0)};$h.ItemBase.prototype={$0_0:null,$s_0:null,get_data:function(){return this.$0_0},loadCustomPropertiesAsync:function(){for(var i=[],n=0;n0)return new Date(n.getFullYear()+t.$C_1,0,1);break;default:break}return n};$h.MeetingSuggestionTimeDecoder.$3K=function(n,t,i){if(t>-5&&t<5){var u;var f;u=(i+6)%7+1;f=7*t+(u-n.getDay());n.setDate(n.getDate()+f);return n}else{var r=(i-n.getDay())%7;r<0&&(r+=7);n.setDate(n.getDate()+r);return n}};$h.MeetingSuggestionTimeDecoder.$3L=function(n,t){var f;var i;var r;f=n;if(t.$L_1<=0||t.$L_1>12||t.$C_1<=0||t.$C_1>5)return n;var e=(12+t.$L_1-f.getMonth()-1)%12;i=new Date(f.getFullYear(),f.getMonth()+e,1);if(t.$O_1===1)if(t.$C_1===1&&i.getDay()!==6&&i.getDay())return i;else{r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()+(8-i.getDay())%7);i.getDay()!==6&&i.getDay()&&i.getDay()!==1&&r.setDate(r.getDate()-7);r.setDate(r.getDate()+7*(t.$C_1-1));return r.getMonth()+1!==t.$L_1?n:r}else{r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder.$39(i.getMonth(),i.getFullYear()));var u=1-r.getDay();u>0&&(u=u-7);r.setDate(r.getDate()+u);r.setDate(r.getDate()+7*(1-t.$C_1));return r.getMonth()+1!==t.$L_1?i.getDay()!==6&&i.getDay()?i:n:r}};$h.MeetingSuggestionTimeDecoder.$3A=function(n,t,i){var f=32767;t.val=null;i.val=0;if(!n)return!1;i.val=$h.MeetingSuggestionTimeDecoder.$4Q(n);var e=n.getTime()-i.val;var r=(e-$h.MeetingSuggestionTimeDecoder.$1u.getTime())/864e5;if(r<0)return!1;else if(r>=262144)return!1;else{var u=r>>15;r=r&f;switch(u){case 0:return $h.MeetingSuggestionTimeDecoder.$3B(r,t);case 1:return $h.MeetingSuggestionTimeDecoder.$3C(r,t);default:return!1}}};$h.MeetingSuggestionTimeDecoder.$3B=function(n,t){var h=7;var e=15;var o=31;var s=127;var u=null;var r=0;var f=0;t.val=null;var i=n>>12&h;if((i&4)==4){u=n>>5&s;if((i&2)==2){if((i&1)==1)return!1;r=n>>1&e}}else{(i&2)==2&&(r=n>>8&e);(i&1)==1&&(f=n>>3&o)}t.val=new $h.PreciseDate(f,r,u);return!0};$h.MeetingSuggestionTimeDecoder.$3C=function(n,t){var o=15;var e=63;var h=7;var s=3;var r=n&o;n>>=4;var i=$h.MeetingSuggestionTimeDecoder.$3N(n&e,6);n>>=6;var f=n&h;n>>=3;var u=n&s;try{t.val=new $h.RelativeDate(u,i,f,r);return!0}catch(c){t.val=null;return!1}};$h.MeetingSuggestionTimeDecoder.$3N=function(n,t){var i=1<2||!Function.isInstanceOfType(n[0]))return!1;u=n[0];i>1&&(r=n[1]);t.val=new $h.CommonParameters(null,u,r);return!0};$h.CommonParameters.prototype={$S_0:null,$3_0:null,$4_0:null,get_options:function(){return this.$S_0},get_callback:function(){return this.$3_0},get_asyncContext:function(){return this.$4_0}};$h.EwsRequest=function(n){$h.EwsRequest.initializeBase(this,[n])};$h.EwsRequest.prototype={readyState:1,status:0,statusText:null,onreadystatechange:null,responseText:null,get_$2i_1:function(){return this.status},set_$2i_1:function(n){this.status=n;return n},get_$2j_1:function(){return this.statusText},set_$2j_1:function(n){this.statusText=n;return n},get_$1f_1:function(){return this.readyState},set_$1f_1:function(n){this.readyState=n;return n},get_hasOnReadyStateChangeCallback:function(){return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)},get_$1g_1:function(){return this.responseText},set_$1g_1:function(n){this.responseText=n;return n},send:function(n){this.$2t_1();$h.ScriptHelpers.isNullOrUndefined(n)&&this.$1j_1();this.$1i_0(5,"EwsRequest",{body:n})},$2s_1:function(){$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)||this.onreadystatechange()},$4g_1:function(n){},executeExtraFailedResponseSteps:function(){}};$h.InitialData=function(n){this.$0_0=n;this.$B_0=this.$2q_0()};$h.InitialData.$1=function(n,t,i){var r={get:i,configurable:!1};Object.defineProperty(n,t,r)};$h.InitialData.prototype={$13_0:null,$g_0:null,$c_0:null,$x_0:null,$k_0:null,$0_0:null,$B_0:0,get_$4Z_0:function(){return this.$0_0.id},get_$4Y_0:function(){return this.$0_0.itemClass},get_$36_0:function(){return new Date(this.$0_0.dateTimeCreated)},get_$37_0:function(){return new Date(this.$0_0.dateTimeModified)},get_$38_0:function(){return new Date(this.$0_0.dateTimeSent)},get_$2k_0:function(){this.$A_0();return this.$0_0.subject},get_$2c_0:function(){this.$A_0();return this.$0_0.normalizedSubject},get_$4W_0:function(){return this.$0_0.internetMessageId},get_$1v_0:function(){return this.$0_0.conversationId},get_$4m_0:function(){this.$A_0();var n=this.$0_0.sender;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$3M_0:function(){this.$A_0();var n=this.$0_0.from;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$1m_0:function(){this.$A_0();null===this.$13_0&&(this.$13_0=this.$1D_0("to"));return this.$13_0},get_$1A_0:function(){this.$A_0();null===this.$g_0&&(this.$g_0=this.$1D_0("cc"));return this.$g_0},get_$2p_0:function(){this.$A_0();null===this.$c_0&&(this.$c_0=this.$2z_0());return this.$c_0},get_$3J_0:function(){return this.$0_0.ewsUrl},get_$4b_0:function(){return this.$0_0.marketplaceAssetId},get_$4c_0:function(){return this.$0_0.marketplaceContentMarket},get_$2u_0:function(){return this.$0_0.consentMetadata},get_$4X_0:function(){return this.$0_0.isRead},get_$3I_0:function(){return this.$0_0.entryPointUrl},get_$2h_0:function(){return new Date(this.$0_0.start)},get_$25_0:function(){return new Date(this.$0_0.end)},get_$2W_0:function(){return this.$0_0.location},get_$4j_0:function(){this.$A_0();null===this.$x_0&&(this.$x_0=this.$1D_0("resources"));return this.$x_0},get_$4d_0:function(){this.$A_0();var n=this.$0_0.organizer;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$4w_0:function(){return this.$0_0.userDisplayName},get_$4x_0:function(){return this.$0_0.userEmailAddress},get_$4y_0:function(){return this.$0_0.userTimeZone},get_$1l_0:function(){return this.$0_0.timeZoneOffsets},get_$4T_0:function(){return this.$0_0.hostVersion},get_$4f_0:function(){return this.$0_0.owaView},get_$4e_0:function(){return this.$0_0.overrideWindowOpen},$m_0:function(){this.$k_0||(this.$k_0=new $h.Entities(this.$0_0.entities,this.$0_0.filteredEntities,this.get_$38_0(),this.$B_0));return this.$k_0},$2K_0:function(n){var t=this.$m_0();return t.$3s_0(n)},$1V_0:function(n){var t=this.$m_0();return t.$1V_0(n)},$1Y_0:function(){return this.$0_0.regExMatches?this.$0_0.regExMatches:null},$2R_0:function(n){var t=this.$1Y_0();return!t||!t[n]?null:t[n]},$A_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0)},$1D_0:function(n){var i=this.$0_0[n];if($h.ScriptHelpers.isNullOrUndefined(i))return[];for(var r=[],t=0;t 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage=_getSessionStorage(); + if(!skipSessionStorage && osfSessionStorage) + { + var sessionKeyStart=window.name.indexOf(infoKeyPrefix); + if(sessionKeyStart > -1) + { + var sessionKeyEnd=window.name.indexOf(";",sessionKeyStart); + if(sessionKeyEnd==-1) + sessionKeyEnd=window.name.length; + var sessionKey=window.name.substring(sessionKeyStart,sessionKeyEnd); + if(xdmInfoValue) + osfSessionStorage.setItem(sessionKey,xdmInfoValue); + else + xdmInfoValue=osfSessionStorage.getItem(sessionKey) + } + } + return xdmInfoValue + }, + getConversationId: function OSF_OUtil$getConversationId() + { + var searchString=window.location.search; + var conversationId=null; + if(searchString) + { + var index=searchString.indexOf("&"); + conversationId=index > 0 ? searchString.substring(1,index) : searchString.substr(1); + if(conversationId && conversationId.charAt(conversationId.length - 1)==="=") + { + conversationId=conversationId.substring(0,conversationId.length - 1); + if(conversationId) + conversationId=decodeURIComponent(conversationId) + } + } + return conversationId + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) + { + var items=strInfo.split("$"); + if(typeof items[1]=="undefined") + items=strInfo.split("|"); + return items + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() + { + var conversationUrl=""; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(true); + if(xdmInfoValue) + { + var items=OSF.OUtil.getInfoItems(xdmInfoValue); + if(items !=undefined && items.length >=3) + conversationUrl=items[2] + } + return conversationUrl + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) + { + var e=Function._validateParams(arguments,[{ + name: "params", + type: Object, + mayBeNull: false + },{ + name: "expectedProperties", + type: Object, + mayBeNull: false + },{ + name: "callback", + type: Function, + mayBeNull: true + }]); + if(e) + throw e; + for(var p in expectedProperties) + { + e=Function._validateParameter(params[p],expectedProperties[p],p); + if(e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) + { + if(window.msWriteProfilerMark) + { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text) + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) + { + if(typeof Sys !=="undefined" && Sys && Sys.Debug) + OsfMsAjaxFactory.msAjaxDebug.trace(text) + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) + { + descriptor=descriptor || {}; + for(var nd in attributes) + { + var attribute=attributes[nd]; + if(descriptor[attribute]==undefined) + descriptor[attribute]=true + } + Object.defineProperty(obj,prop,descriptor); + return obj + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) + { + descriptors=descriptors || {}; + for(var prop in descriptors) + OSF.OUtil.defineNondefaultProperty(obj,prop,descriptors[prop],attributes); + return obj + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) + { + return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["enumerable"]) + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) + { + return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["enumerable"]) + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) + { + return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["writable","enumerable","configurable"]) + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) + { + return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["writable","enumerable","configurable"]) + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) + { + descriptor=descriptor || {}; + var props=Object.getOwnPropertyNames(obj); + var propsLength=props.length; + for(var i=0; i < propsLength; i++) + { + var prop=props[i]; + var desc=Object.getOwnPropertyDescriptor(obj,prop); + if(!desc.get && !desc.set) + desc.writable=descriptor.writable || false; + desc.configurable=descriptor.configurable || false; + desc.enumerable=descriptor.enumerable || true; + Object.defineProperty(obj,prop,desc) + } + return obj + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) + { + var ret=[]; + if(list) + for(var item in list) + ret.push(mapFunction(list[item])); + return ret + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) + { + for(var item in list) + if(key==item) + return true; + return false + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) + { + for(var item in list) + if(value==list[item]) + return true; + return false + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) + { + var add=list.push ? function(key, value) + { + list.push(value) + } : function(key, value) + { + list[key]=value + }; + for(var key in addenda) + add(key,addenda[key]) + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) + { + for(var key1 in oldList) + delete oldList[key1]; + for(var key2 in newList) + oldList[key2]=newList[key2] + }, + isArray: function OSF_OUtil$isArray(obj) + { + return Object.prototype.toString.apply(obj)==="[object Array]" + }, + isFunction: function OSF_OUtil$isFunction(obj) + { + return Object.prototype.toString.apply(obj)==="[object Function]" + }, + isDate: function OSF_OUtil$isDate(obj) + { + return Object.prototype.toString.apply(obj)==="[object Date]" + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) + { + if(element.addEventListener) + element.addEventListener(eventName,listener,false); + else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.attachEvent) + element.attachEvent("on"+eventName,listener); + else + element["on"+eventName]=listener + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) + { + if(element.removeEventListener) + element.removeEventListener(eventName,listener,false); + else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.detachEvent) + element.detachEvent("on"+eventName,listener); + else + element["on"+eventName]=null + }, + encodeBase64: function OSF_Outil$encodeBase64(input) + { + if(!input) + return input; + var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/="; + var output=[]; + var temp=[]; + var index=0; + var c1, + c2, + c3, + a, + b, + c; + var i; + var length=input.length; + do + { + c1=input.charCodeAt(index++); + c2=input.charCodeAt(index++); + c3=input.charCodeAt(index++); + i=0; + a=c1 & 255; + b=c1 >> 8; + c=c2 & 255; + temp[i++]=a >> 2; + temp[i++]=(a & 3) << 4 | b >> 4; + temp[i++]=(b & 15) << 2 | c >> 6; + temp[i++]=c & 63; + if(!isNaN(c2)) + { + a=c2 >> 8; + b=c3 & 255; + c=c3 >> 8; + temp[i++]=a >> 2; + temp[i++]=(a & 3) << 4 | b >> 4; + temp[i++]=(b & 15) << 2 | c >> 6; + temp[i++]=c & 63 + } + if(isNaN(c2)) + temp[i - 1]=64; + else if(isNaN(c3)) + { + temp[i - 2]=64; + temp[i - 1]=64 + } + for(var t=0; t < i; t++) + output.push(codex.charAt(temp[t])) + } while(index < length); + return output.join("") + }, + getSessionStorage: function OSF_Outil$getSessionStorage() + { + return _getSessionStorage() + }, + getLocalStorage: function OSF_Outil$getLocalStorage() + { + if(!_safeLocalStorage) + { + try + { + var localStorage=window.localStorage + } + catch(ex) + { + localStorage=null + } + _safeLocalStorage=new OfficeExt.SafeStorage(localStorage) + } + return _safeLocalStorage + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) + { + var hex="#"+(Number(val)+16777216).toString(16).slice(-6); + return hex + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) + { + element.onclick=function(e) + { + handler() + }; + element.ontouchend=function(e) + { + handler(); + e.preventDefault() + } + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) + { + var e=Function._validateParams(arguments,[{ + name: "queryString", + type: String, + mayBeNull: false + },{ + name: "paramName", + type: String, + mayBeNull: false + }]); + if(e) + { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return"" + } + var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)","i"); + if(!queryExp.test(queryString)) + { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return"" + } + return queryExp.exec(queryString)[1] + }, + isiOS: function OSF_Outil$isiOS() + { + return window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) + { + var copyObj=sourceObj.constructor(); + for(var property in sourceObj) + if(sourceObj.hasOwnProperty(property)) + copyObj[property]=sourceObj[property]; + return copyObj + } + } +}(); +OSF.OUtil.Guid=function() +{ + var hexCode=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; + return{generateNewGuid: function OSF_Outil_Guid$generateNewGuid() + { + var result=""; + var tick=(new Date).getTime(); + var index=0; + for(; index < 32 && tick > 0; index++) + { + if(index==8 || index==12 || index==16 || index==20) + result+="-"; + result+=hexCode[tick % 16]; + tick=Math.floor(tick / 16) + } + for(; index < 32; index++) + { + if(index==8 || index==12 || index==16 || index==20) + result+="-"; + result+=hexCode[Math.floor(Math.random() * 16)] + } + return result + }} +}(); +window.OSF=OSF; +OSF.OUtil.setNamespace("OSF",window); +OSF.AppName={ + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536 +}; +OSF.InternalPerfMarker={ + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker={ + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; +OSF.AgaveHostAction={ + Select: 0, + UnSelect: 1, + CancelDialog: 2, + InsertAgave: 3, + CtrlF6In: 4, + CtrlF6Exit: 5, + CtrlF6ExitShift: 6, + SelectWithError: 7 +}; +OSF.SharedConstants={NotificationConversationIdSuffix: "_ntf"}; +OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed) +{ + this._id=id; + this._appName=appName; + this._appVersion=appVersion; + this._appUILocale=appUILocale; + this._dataLocale=dataLocale; + this._docUrl=docUrl; + this._clientMode=clientMode; + this._settings=settings; + this._reason=reason; + this._osfControlType=osfControlType; + this._eToken=eToken; + this._correlationId=correlationId; + this._appInstanceId=appInstanceId; + this._touchEnabled=touchEnabled; + this._commerceAllowed=commerceAllowed; + this.get_id=function get_id() + { + return this._id + }; + this.get_appName=function get_appName() + { + return this._appName + }; + this.get_appVersion=function get_appVersion() + { + return this._appVersion + }; + this.get_appUILocale=function get_appUILocale() + { + return this._appUILocale + }; + this.get_dataLocale=function get_dataLocale() + { + return this._dataLocale + }; + this.get_docUrl=function get_docUrl() + { + return this._docUrl + }; + this.get_clientMode=function get_clientMode() + { + return this._clientMode + }; + this.get_bindings=function get_bindings() + { + return this._bindings + }; + this.get_settings=function get_settings() + { + return this._settings + }; + this.get_reason=function get_reason() + { + return this._reason + }; + this.get_osfControlType=function get_osfControlType() + { + return this._osfControlType + }; + this.get_eToken=function get_eToken() + { + return this._eToken + }; + this.get_correlationId=function get_correlationId() + { + return this._correlationId + }; + this.get_appInstanceId=function get_appInstanceId() + { + return this._appInstanceId + }; + this.get_touchEnabled=function get_touchEnabled() + { + return this._touchEnabled + }; + this.get_commerceAllowed=function get_commerceAllowed() + { + return this._commerceAllowed + } +}; +OSF.OsfControlType={ + DocumentLevel: 0, + ContainerLevel: 1 +}; +OSF.ClientMode={ + ReadOnly: 0, + ReadWrite: 1 +}; +OSF.OUtil.setNamespace("Microsoft",window); +OSF.OUtil.setNamespace("Office",Microsoft); +OSF.OUtil.setNamespace("Client",Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension",Microsoft.Office); +Microsoft.Office.WebExtension.InitializationReason={ + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; +Microsoft.Office.WebExtension.ValueFormat={ + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType={All: "all"}; +Microsoft.Office.WebExtension.Parameters={ + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA",OSF); +OSF.DDA.DocumentMode={ + ReadOnly: 1, + ReadWrite: 0 +}; +OSF.DDA.PropertyDescriptors={AsyncResultStatus: "AsyncResultStatus"}; +OSF.DDA.EventDescriptors={}; +OSF.DDA.ListDescriptors={}; +OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) +{ + if(eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) + return bindingId+"_"+eventType; + else + return eventType +}; +OSF.DDA.MethodDispId={ + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId={ + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager=function() +{ + var _errorMappings={}; + return{ + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) + { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError] + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) + { + _errorMappings[errorCode]=errorNameMessage + }, + errorCodes: { + ooeSuccess: 0, + ooeCoercionTypeNotSupported: 1e3, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2e3, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3e3, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4e3, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5e3, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeCustomXmlNodeNotFound: 6e3, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7e3, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8e3, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11e3, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) + { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ + name: stringNS.L_InvalidCoercion, + message: stringNS.L_CoercionTypeNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ + name: stringNS.L_DataReadError, + message: stringNS.L_GetSelectionNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ + name: stringNS.L_InvalidCoercion, + message: stringNS.L_CoercionTypeNotMatchBinding + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetRowColumnCounts + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ + name: stringNS.L_DataReadError, + message: stringNS.L_SelectionNotSupportCoercionType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetStartRowColumn + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ + name: stringNS.L_DataReadError, + message: stringNS.L_NonUniformPartialGetNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ + name: stringNS.L_DataReadError, + message: stringNS.L_GetDataIsTooLarge + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ + name: stringNS.L_DataReadError, + message: stringNS.L_FileTypeNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ + name: stringNS.L_DataReadError, + message: stringNS.L_GetDataParametersConflict + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetColumns + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidGetRows + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ + name: stringNS.L_DataReadError, + message: stringNS.L_InvalidReadForBlankRow + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_UnsupportedDataObject + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_CannotWriteToSelection + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_DataNotMatchSelection + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_OverwriteWorksheetData + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_DataNotMatchBindingSize + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_InvalidSetStartRowColumn + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ + name: stringNS.L_InvalidFormat, + message: stringNS.L_InvalidDataFormat + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ + name: stringNS.L_InvalidDataObject, + message: stringNS.L_DataNotMatchCoercionType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ + name: stringNS.L_InvalidDataObject, + message: stringNS.L_DataNotMatchBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_SetDataIsTooLarge + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_NonUniformPartialSetNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_InvalidSetColumns + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_InvalidSetRows + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ + name: stringNS.L_DataWriteError, + message: stringNS.L_SetDataParametersConflict + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_SelectionCannotBound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ + name: stringNS.L_InvalidBindingError, + message: stringNS.L_BindingNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_BindingToMultipleSelection + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_InvalidSelectionForBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ + name: stringNS.L_InvalidBindingOperation, + message: stringNS.L_OperationNotSupportedOnThisBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_NamedItemNotFound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_MultipleNamedItemFound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ + name: stringNS.L_BindingCreationError, + message: stringNS.L_InvalidNamedItemForBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ + name: stringNS.L_InvalidBinding, + message: stringNS.L_UnknownBindingType + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ + name: stringNS.L_InvalidBindingOperation, + message: stringNS.L_OperationNotSupportedOnMatrixData + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ + name: stringNS.L_InvalidBinding, + message: stringNS.L_InvalidColumnsForBinding + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ + name: stringNS.L_ReadSettingsError, + message: stringNS.L_SettingNameNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ + name: stringNS.L_SaveSettingsError, + message: stringNS.L_SettingsCannotSave + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ + name: stringNS.L_SettingsStaleError, + message: stringNS.L_SettingsAreStale + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ + name: stringNS.L_HostError, + message: stringNS.L_OperationNotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ + name: stringNS.L_InternalError, + message: stringNS.L_InternalErrorDescription + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ + name: stringNS.L_PermissionDenied, + message: stringNS.L_DocumentReadOnly + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ + name: stringNS.L_EventRegistrationError, + message: stringNS.L_EventHandlerNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ + name: stringNS.L_InvalidAPICall, + message: stringNS.L_InvalidApiCallInContext + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ + name: stringNS.L_ShuttingDown, + message: stringNS.L_ShuttingDown + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ + name: stringNS.L_UnsupportedEnumeration, + message: stringNS.L_UnsupportedEnumerationMessage + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ + name: stringNS.L_IndexOutOfRange, + message: stringNS.L_IndexOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ + name: stringNS.L_APINotSupported, + message: stringNS.L_BrowserAPINotSupported + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ + name: stringNS.L_APICallFailed, + message: stringNS.L_RequestTimeout + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ + name: stringNS.L_APICallFailed, + message: stringNS.L_TooManyIncompleteRequests + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ + name: stringNS.L_APICallFailed, + message: stringNS.L_RequestTokenUnavailable + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ + name: stringNS.L_InvalidNode, + message: stringNS.L_CustomXmlNodeNotFound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ + name: stringNS.L_CustomXmlError, + message: stringNS.L_CustomXmlError + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ + name: stringNS.L_CustomXmlError, + message: stringNS.L_CustomXmlError + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ + name: stringNS.L_CustomXmlError, + message: stringNS.L_CustomXmlError + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ + name: stringNS.L_PermissionDenied, + message: stringNS.L_NoCapability + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ + name: stringNS.L_CannotNavigateTo, + message: stringNS.L_CannotNavigateTo + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ + name: stringNS.L_SpecifiedIdNotExist, + message: stringNS.L_SpecifiedIdNotExist + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ + name: stringNS.L_NavOutOfBound, + message: stringNS.L_NavOutOfBound + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ + name: stringNS.L_DataWriteReminder, + message: stringNS.L_CellDataAmountBeyondLimits + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ + name: stringNS.L_MissingParameter, + message: stringNS.L_ElementMissing + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ + name: stringNS.L_PermissionDenied, + message: stringNS.L_NoCapability + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_InvalidCellsValue + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_InvalidTableOptionValue + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_InvalidFormatValue + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ + name: stringNS.L_OutOfRange, + message: stringNS.L_RowIndexOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ + name: stringNS.L_OutOfRange, + message: stringNS.L_ColIndexOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ + name: stringNS.L_OutOfRange, + message: stringNS.L_FormatValueOutOfRange + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ + name: stringNS.L_FormattingReminder, + message: stringNS.L_CellFormatAmountBeyondLimits + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ + name: stringNS.L_MemoryLimit, + message: stringNS.L_CloseFileBeforeRetrieve + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ + name: stringNS.L_NetworkProblem, + message: stringNS.L_NetworkProblemRetrieveFile + }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ + name: stringNS.L_InvalidValue, + message: stringNS.L_SliceSizeNotSupported + } + } + } +}(); +Microsoft.Office.WebExtension.ApplicationMode={ + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; +Microsoft.Office.WebExtension.DocumentMode={ + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; +OSF.NamespaceManager=function OSF_NamespaceManager() +{ + var _userOffice; + var _useShortcut=false; + return{ + enableShortcut: function OSF_NamespaceManager$enableShortcut() + { + if(!_useShortcut) + { + if(window.Office) + _userOffice=window.Office; + else + OSF.OUtil.setNamespace("Office",window); + window.Office=Microsoft.Office.WebExtension; + _useShortcut=true + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() + { + if(_useShortcut) + { + if(_userOffice) + window.Office=_userOffice; + else + OSF.OUtil.unsetNamespace("Office",window); + _useShortcut=false + } + } + } +}(); +OSF.NamespaceManager.enableShortcut(); +Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) +{ + if(useShortcut) + OSF.NamespaceManager.enableShortcut(); + else + OSF.NamespaceManager.disableShortcut() +}; +Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) +{ + var promise; + if(str && typeof str=="string") + { + var index=str.indexOf("#"); + if(index !=-1) + { + var op=str.substring(0,index); + var target=str.substring(index+1); + switch(op) + { + case"binding": + case"bindings": + if(target) + promise=new OSF.DDA.BindingPromise(target); + break + } + } + } + if(!promise) + { + if(errorCallback) + { + var callbackType=typeof errorCallback; + if(callbackType=="function") + { + var callArgs={}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback; + OSF.DDA.issueAsyncResult(callArgs,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)) + } + else + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,callbackType); + } + } + else + { + promise.onFail=errorCallback; + return promise + } +}; +OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + contentLanguage: {value: officeAppContext.get_dataLocale()}, + displayLanguage: {value: officeAppContext.get_appUILocale()}, + touchEnabled: {value: officeAppContext.get_touchEnabled()}, + commerceAllowed: {value: officeAppContext.get_commerceAllowed()} + }); + if(document) + OSF.OUtil.defineEnumerableProperty(this,"document",{value: document}); + if(license) + OSF.OUtil.defineEnumerableProperty(this,"license",{value: license}); + if(appOM) + { + var displayName=appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this,displayName,{value: appOM}) + } + if(getOfficeTheme) + OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get: function() + { + return getOfficeTheme() + }}) +}; +OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) +{ + OSF.DDA.OutlookContext.uber.constructor.call(this,appContext,null,license,appOM,getOfficeTheme); + if(settings) + OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value: settings}) +}; +OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context); +OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady){}; +OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) +{ + var mode; + switch(officeAppContext.get_clientMode()) + { + case OSF.ClientMode.ReadOnly: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break + } + if(settings) + OSF.OUtil.defineEnumerableProperty(this,"settings",{value: settings}); + OSF.OUtil.defineMutableProperties(this,{ + mode: {value: mode}, + url: {value: officeAppContext.get_docUrl()} + }) +}; +OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) +{ + OSF.DDA.JsomDocument.uber.constructor.call(this,officeAppContext,settings); + if(bindingFacade) + OSF.OUtil.defineEnumerableProperty(this,"bindings",{get: function OSF_DDA_Document$GetBindings() + { + return bindingFacade + }}); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetSelectedDataAsync,am.SetSelectedDataAsync]); + OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])) +}; +OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document); +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get: function Microsoft_Office_WebExtension$GetContext() + { + var context; + if(OSF && OSF._OfficeAppFactory) + context=OSF._OfficeAppFactory.getContext(); + return context + }}); +OSF.DDA.License=function OSF_DDA_License(eToken) +{ + OSF.OUtil.defineEnumerableProperty(this,"value",{value: eToken}) +}; +OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties={ + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus={ + Succeeded: "succeeded", + Failed: "failed" +}; +OSF.DDA.AsyncResultEnum.ErrorCode={ + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties={ + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames={}; +OSF.DDA.AsyncMethodNames.addNames=function(methodNames) +{ + for(var entry in methodNames) + { + var am={}; + OSF.OUtil.defineEnumerableProperties(am,{ + id: {value: entry}, + displayName: {value: methodNames[entry]} + }); + OSF.DDA.AsyncMethodNames[entry]=am + } +}; +OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) +{ + var requiredCount=requiredParameters.length; + var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function() + { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,displayName) + }); + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) + { + for(var name in params) + { + var param=params[name]; + var arg=args[name]; + if(param["enum"]) + switch(typeof arg) + { + case"string": + if(OSF.OUtil.listContainsValue(param["enum"],arg)) + break; + case"undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + if(param["types"]) + if(!OSF.OUtil.listContainsValue(param["types"],typeof arg)) + throw getInvalidParameterString(); + } + } + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) + { + if(userArgs.length < requiredCount) + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + var requiredArgs=[]; + var index; + for(index=0; index < requiredCount; index++) + requiredArgs.push(userArgs[index]); + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters,requiredArgs); + var ret={}; + for(index=0; index < requiredCount; index++) + { + var param=requiredParameters[index]; + var arg=requiredArgs[index]; + if(param.verify) + { + var isValid=param.verify(arg,caller,stateInfo); + if(!isValid) + throw getInvalidParameterString(); + } + ret[param.name]=arg + } + return ret + } + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) + { + if(userArgs.length > requiredCount+2) + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + var options, + parameterCallback; + for(var i=userArgs.length - 1; i >=requiredCount; i--) + { + var argument=userArgs[i]; + switch(typeof argument) + { + case"object": + if(options) + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + else + options=argument; + break; + case"function": + if(parameterCallback) + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + else + parameterCallback=argument; + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break + } + } + options=options || {}; + for(var optionName in supportedOptions) + if(!OSF.OUtil.listContainsKey(options,optionName)) + { + var value=undefined; + var option=supportedOptions[optionName]; + if(option.calculate && requiredArgs) + value=option.calculate(requiredArgs,caller,stateInfo); + if(!value && option.defaultValue !==undefined) + value=option.defaultValue; + options[optionName]=value + } + if(parameterCallback) + if(options[Microsoft.Office.WebExtension.Parameters.Callback]) + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + else + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions,options); + return options + } + this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) + { + var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs,caller,stateInfo); + var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs,required,caller,stateInfo); + var callArgs={}; + for(var r in required) + callArgs[r]=required[r]; + for(var o in options) + callArgs[o]=options[o]; + for(var s in privateStateCallbacks) + callArgs[s]=privateStateCallbacks[s](caller,stateInfo); + if(checkCallArgs) + callArgs=checkCallArgs(callArgs,caller,stateInfo); + return callArgs + }; + this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) + { + var payload; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + if(onSucceeded) + payload=onSucceeded(response,caller,callArgs); + else + payload=response; + else if(onFailed) + payload=onFailed(status,response); + else + payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + return payload + }; + this.getCallArgs=function(suppliedArgs) + { + var options, + parameterCallback; + for(var i=suppliedArgs.length - 1; i >=requiredCount; i--) + { + var argument=suppliedArgs[i]; + switch(typeof argument) + { + case"object": + options=argument; + break; + case"function": + parameterCallback=argument; + break + } + } + options=options || {}; + if(parameterCallback) + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + return options + } +}; +OSF.DDA.AsyncMethodCallFactory=function() +{ + function createObject(properties) + { + var obj=null; + if(properties) + { + obj={}; + var len=properties.length; + for(var i=0; i < len; i++) + obj[properties[i].name]=properties[i].value + } + return obj + } + return{manufacture: function(params) + { + var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [],supportedOptions,privateStateCallbacks,params.onSucceeded,params.onFailed,params.checkCallArgs,params.method.displayName) + }} +}(); +OSF.DDA.AsyncMethodCalls={}; +OSF.DDA.AsyncMethodCalls.define=function(callDefinition) +{ + OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition) +}; +OSF.DDA.Error=function OSF_DDA_Error(name, message, code) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + name: {value: name}, + message: {value: message}, + code: {value: code} + }) +}; +OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) +{ + OSF.OUtil.defineEnumerableProperties(this,{ + value: {value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]}, + status: {value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded} + }); + if(initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) + OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]}); + if(errorArgs) + OSF.OUtil.defineEnumerableProperty(this,"error",{value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])}) +}; +OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) +{ + var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if(callback) + { + var asyncInitArgs={}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload; + else + { + errorArgs={}; + payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs,errorArgs)) + } +}; +OSF.DDA.ListType=function() +{ + var listTypes={}; + return{ + setListType: function OSF_DDA_ListType$AddListType(t, prop) + { + listTypes[t]=prop + }, + isListType: function OSF_DDA_ListType$IsListType(t) + { + return OSF.OUtil.listContainsKey(listTypes,t) + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) + { + return listTypes[t] + } + } +}(); +OSF.DDA.HostParameterMap=function(specialProcessor, mappings) +{ + var toHostMap="toHost"; + var fromHostMap="fromHost"; + var self="self"; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={ + toHost: function(data) + { + if(data !=null && data.rows !==undefined) + { + var tableData={}; + tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers; + data=tableData + } + return data + }, + fromHost: function(args) + { + return args + } + }; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + function mapValues(preimageSet, mapping) + { + var ret=preimageSet ? {} : undefined; + for(var entry in preimageSet) + { + var preimage=preimageSet[entry]; + var image; + if(OSF.DDA.ListType.isListType(entry)) + { + image=[]; + for(var subEntry in preimage) + image.push(mapValues(preimage[subEntry],mapping)) + } + else if(OSF.OUtil.listContainsKey(dynamicTypes,entry)) + image=dynamicTypes[entry][mapping](preimage); + else if(mapping==fromHostMap && specialProcessor.preserveNesting(entry)) + image=mapValues(preimage,mapping); + else + { + var maps=mappings[entry]; + if(maps) + { + var map=maps[mapping]; + if(map) + { + image=map[preimage]; + if(image===undefined) + image=preimage + } + } + else + image=preimage + } + ret[entry]=image + } + return ret + } + function generateArguments(imageSet, parameters) + { + var ret; + for(var param in parameters) + { + var arg; + if(specialProcessor.isComplexType(param)) + arg=generateArguments(imageSet,mappings[param][toHostMap]); + else + arg=imageSet[param]; + if(arg !=undefined) + { + if(!ret) + ret={}; + var index=parameters[param]; + if(index==self) + index=param; + ret[index]=specialProcessor.pack(param,arg) + } + } + return ret + } + function extractArguments(source, parameters, extracted) + { + if(!extracted) + extracted={}; + for(var param in parameters) + { + var index=parameters[param]; + var value; + if(index==self) + value=source; + else + value=source[index]; + if(value===null || value===undefined) + extracted[param]=undefined; + else + { + value=specialProcessor.unpack(param,value); + var map; + if(specialProcessor.isComplexType(param)) + { + map=mappings[param][fromHostMap]; + if(specialProcessor.preserveNesting(param)) + extracted[param]=extractArguments(value,map); + else + extractArguments(value,map,extracted) + } + else + { + if(OSF.DDA.ListType.isListType(param)) + { + map={}; + var entryDescriptor=OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor]=self; + for(var item in value) + value[item]=extractArguments(value[item],map) + } + extracted[param]=value + } + } + } + return extracted + } + function applyMap(mapName, preimage, mapping) + { + var parameters=mappings[mapName][mapping]; + var image; + if(mapping=="toHost") + { + var imageSet=mapValues(preimage,mapping); + image=generateArguments(imageSet,parameters) + } + else if(mapping=="fromHost") + { + var argumentSet=extractArguments(preimage,parameters); + image=mapValues(argumentSet,mapping) + } + return image + } + if(!mappings) + mappings={}; + this.addMapping=function(mapName, description) + { + var toHost, + fromHost; + if(description.map) + { + toHost=description.map; + fromHost={}; + for(var preimage in toHost) + { + var image=toHost[preimage]; + if(image==self) + image=preimage; + fromHost[image]=preimage + } + } + else + { + toHost=description.toHost; + fromHost=description.fromHost + } + var pair=mappings[mapName]; + if(pair) + { + var currMap=pair[toHostMap]; + for(var th in currMap) + toHost[th]=currMap[th]; + currMap=pair[fromHostMap]; + for(var fh in currMap) + fromHost[fh]=currMap[fh] + } + else + pair=mappings[mapName]={}; + pair[toHostMap]=toHost; + pair[fromHostMap]=fromHost + }; + this.toHost=function(mapName, preimage) + { + return applyMap(mapName,preimage,toHostMap) + }; + this.fromHost=function(mapName, image) + { + return applyMap(mapName,image,fromHostMap) + }; + this.self=self; + this.addComplexType=function(ct) + { + specialProcessor.addComplexType(ct) + }; + this.getDynamicType=function(dt) + { + return specialProcessor.getDynamicType(dt) + }; + this.setDynamicType=function(dt, handler) + { + specialProcessor.setDynamicType(dt,handler) + }; + this.dynamicTypes=dynamicTypes; + this.doMapValues=function(preimageSet, mapping) + { + return mapValues(preimageSet,mapping) + } +}; +OSF.DDA.SpecialProcessor=function(complexTypes, dynamicTypes) +{ + this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) + { + complexTypes.push(ct) + }; + this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) + { + return dynamicTypes[dt] + }; + this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) + { + dynamicTypes[dt]=handler + }; + this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) + { + return OSF.OUtil.listContainsValue(complexTypes,t) + }; + this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) + { + return OSF.OUtil.listContainsKey(dynamicTypes,p) + }; + this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) + { + var pn=[]; + if(OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if(OSF.DDA.DataNodeEventProperties) + pn=pn.concat([OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode]); + return OSF.OUtil.listContainsValue(pn,p) + }; + this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) + { + var value; + if(this.isDynamicType(param)) + value=dynamicTypes[param].toHost(arg); + else + value=arg; + return value + }; + this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) + { + var value; + if(this.isDynamicType(param)) + value=dynamicTypes[param].fromHost(arg); + else + value=arg; + return value + } +}; +OSF.DDA.getDecoratedParameterMap=function(specialProcessor, initialDefs) +{ + var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor); + var self=parameterMap.self; + function createObject(properties) + { + var obj=null; + if(properties) + { + obj={}; + var len=properties.length; + for(var i=0; i < len; i++) + obj[properties[i].name]=properties[i].value + } + return obj + } + parameterMap.define=function define(definition) + { + var args={}; + var toHost=createObject(definition.toHost); + if(definition.invertible) + args.map=toHost; + else if(definition.canonical) + args.toHost=args.fromHost=toHost; + else + { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost) + } + parameterMap.addMapping(definition.type,args); + if(definition.isComplexType) + parameterMap.addComplexType(definition.type) + }; + for(var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap +}; +OSF.OUtil.setNamespace("DispIdHost",OSF.DDA); +OSF.DDA.DispIdHost.Methods={ + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates={ + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) +{ + var dispIdMap={}; + var jsom=OSF.DDA.AsyncMethodNames; + var did=OSF.DDA.MethodDispId; + var methodMap={ + GoToByIdAsync: did.dispidNavigateToMethod, + GetSelectedDataAsync: did.dispidGetSelectedDataMethod, + SetSelectedDataAsync: did.dispidSetSelectedDataMethod, + GetDocumentCopyChunkAsync: did.dispidGetDocumentCopyChunkMethod, + ReleaseDocumentCopyAsync: did.dispidReleaseDocumentCopyMethod, + GetDocumentCopyAsync: did.dispidGetDocumentCopyMethod, + AddFromSelectionAsync: did.dispidAddBindingFromSelectionMethod, + AddFromPromptAsync: did.dispidAddBindingFromPromptMethod, + AddFromNamedItemAsync: did.dispidAddBindingFromNamedItemMethod, + GetAllAsync: did.dispidGetAllBindingsMethod, + GetByIdAsync: did.dispidGetBindingMethod, + ReleaseByIdAsync: did.dispidReleaseBindingMethod, + GetDataAsync: did.dispidGetBindingDataMethod, + SetDataAsync: did.dispidSetBindingDataMethod, + AddRowsAsync: did.dispidAddRowsMethod, + AddColumnsAsync: did.dispidAddColumnsMethod, + DeleteAllDataValuesAsync: did.dispidClearAllRowsMethod, + RefreshAsync: did.dispidLoadSettingsMethod, + SaveAsync: did.dispidSaveSettingsMethod, + GetActiveViewAsync: did.dispidGetActiveViewMethod, + GetFilePropertiesAsync: did.dispidGetFilePropertiesMethod, + GetOfficeThemeAsync: did.dispidGetOfficeThemeMethod, + GetDocumentThemeAsync: did.dispidGetDocumentThemeMethod, + ClearFormatsAsync: did.dispidClearFormatsMethod, + SetTableOptionsAsync: did.dispidSetTableOptionsMethod, + SetFormatsAsync: did.dispidSetFormatsMethod, + ExecuteRichApiRequestAsync: did.dispidExecuteRichApiRequestMethod, + AppCommandInvocationCompletedAsync: did.dispidAppCommandInvocationCompletedMethod, + AddDataPartAsync: did.dispidAddDataPartMethod, + GetDataPartByIdAsync: did.dispidGetDataPartByIdMethod, + GetDataPartsByNameSpaceAsync: did.dispidGetDataPartsByNamespaceMethod, + GetPartXmlAsync: did.dispidGetDataPartXmlMethod, + GetPartNodesAsync: did.dispidGetDataPartNodesMethod, + DeleteDataPartAsync: did.dispidDeleteDataPartMethod, + GetNodeValueAsync: did.dispidGetDataNodeValueMethod, + GetNodeXmlAsync: did.dispidGetDataNodeXmlMethod, + GetRelativeNodesAsync: did.dispidGetDataNodesMethod, + SetNodeValueAsync: did.dispidSetDataNodeValueMethod, + SetNodeXmlAsync: did.dispidSetDataNodeXmlMethod, + AddDataPartNamespaceAsync: did.dispidAddDataNamespaceMethod, + GetDataPartNamespaceAsync: did.dispidGetDataUriByPrefixMethod, + GetDataPartPrefixAsync: did.dispidGetDataPrefixByUriMethod, + GetSelectedTask: did.dispidGetSelectedTaskMethod, + GetTask: did.dispidGetTaskMethod, + GetWSSUrl: did.dispidGetWSSUrlMethod, + GetTaskField: did.dispidGetTaskFieldMethod, + GetSelectedResource: did.dispidGetSelectedResourceMethod, + GetResourceField: did.dispidGetResourceFieldMethod, + GetProjectField: did.dispidGetProjectFieldMethod, + GetSelectedView: did.dispidGetSelectedViewMethod, + GetTaskByIndex: did.dispidGetTaskByIndexMethod, + GetResourceByIndex: did.dispidGetResourceByIndexMethod, + SetTaskField: did.dispidSetTaskFieldMethod, + SetResourceField: did.dispidSetResourceFieldMethod, + GetMaxTaskIndex: did.dispidGetMaxTaskIndexMethod, + GetMaxResourceIndex: did.dispidGetMaxResourceIndexMethod + }; + for(var method in methodMap) + if(jsom[method]) + dispIdMap[jsom[method].id]=methodMap[method]; + jsom=Microsoft.Office.WebExtension.EventType; + did=OSF.DDA.EventDispId; + var eventMap={ + SettingsChanged: did.dispidSettingsChangedEvent, + DocumentSelectionChanged: did.dispidDocumentSelectionChangedEvent, + BindingSelectionChanged: did.dispidBindingSelectionChangedEvent, + BindingDataChanged: did.dispidBindingDataChangedEvent, + ActiveViewChanged: did.dispidActiveViewChangedEvent, + OfficeThemeChanged: did.dispidOfficeThemeChangedEvent, + DocumentThemeChanged: did.dispidDocumentThemeChangedEvent, + AppCommandInvoked: did.dispidAppCommandInvokedEvent, + TaskSelectionChanged: did.dispidTaskSelectionChangedEvent, + ResourceSelectionChanged: did.dispidResourceSelectionChangedEvent, + ViewSelectionChanged: did.dispidViewSelectionChangedEvent, + DataNodeInserted: did.dispidDataNodeAddedEvent, + DataNodeReplaced: did.dispidDataNodeReplacedEvent, + DataNodeDeleted: did.dispidDataNodeDeletedEvent + }; + for(var event in eventMap) + if(jsom[event]) + dispIdMap[jsom[event]]=eventMap[event]; + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) + { + if(typeof ex=="number") + { + if(!callArgs) + callArgs=asyncMethodCall.getCallArgs(suppliedArgs); + OSF.DDA.issueAsyncResult(callArgs,ex,OSF.DDA.ErrorCodeManager.getErrorArgs(ex)) + } + else + throw ex; + } + this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) + { + var callArgs; + try + { + var methodName=method.id; + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,privateState); + var dispId=dispIdMap[methodName]; + var delegate=getDelegateMethods(methodName); + var hostCallArgs; + if(parameterMap.toHost) + hostCallArgs=parameterMap.toHost(dispId,callArgs); + else + hostCallArgs=callArgs; + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + dispId: dispId, + hostCallArgs: hostCallArgs, + onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall) + }, + onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse) + }, + onComplete: function(status, hostResponseArgs) + { + var responseArgs; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + if(parameterMap.fromHost) + responseArgs=parameterMap.fromHost(dispId,hostResponseArgs); + else + responseArgs=hostResponseArgs; + else + responseArgs=hostResponseArgs; + var payload=asyncMethodCall.processResponse(status,responseArgs,caller,callArgs); + OSF.DDA.issueAsyncResult(callArgs,status,payload) + } + }) + } + catch(ex) + { + onException(ex,asyncMethodCall,suppliedArguments,callArgs) + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) + { + var callArgs; + var eventType, + handler; + function onEnsureRegistration(status) + { + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + { + var added=eventDispatch.addEventHandler(eventType,handler); + if(!added) + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed + } + var error; + if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + OSF.DDA.issueAsyncResult(callArgs,status,error) + } + try + { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch); + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if(eventDispatch.getEventHandlerCount(eventType)==0) + { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + eventType: eventType, + dispId: dispId, + targetId: caller.id || "", + onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall) + }, + onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse) + }, + onComplete: onEnsureRegistration, + onEvent: function handleEvent(hostArgs) + { + var args=parameterMap.fromHost(dispId,hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType,caller,args)) + } + }) + } + else + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + } + catch(ex) + { + onException(ex,asyncMethodCall,suppliedArguments,callArgs) + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) + { + var callArgs; + var eventType, + handler; + function onEnsureRegistration(status) + { + var error; + if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + OSF.DDA.issueAsyncResult(callArgs,status,error) + } + try + { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch); + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, + removeSuccess; + if(handler===null) + { + removeSuccess=eventDispatch.clearEventHandlers(eventType); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess + } + else + { + removeSuccess=eventDispatch.removeEventHandler(eventType,handler); + status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist + } + if(removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) + { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + eventType: eventType, + dispId: dispId, + targetId: caller.id || "", + onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall) + }, + onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving() + { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse) + }, + onComplete: onEnsureRegistration + }) + } + else + onEnsureRegistration(status) + } + catch(ex) + { + onException(ex,asyncMethodCall,suppliedArguments,callArgs) + } + } +}; +OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) +{ + for(var entry in asyncMethodNames) + { + var method=asyncMethodNames[entry]; + var name=method.displayName; + if(!target[name]) + OSF.OUtil.defineEnumerableProperty(target,name,{value: function(asyncMethod) + { + return function() + { + var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod,arguments,target,privateState) + } + }(method)}) + } +}; +OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) +{ + var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if(!target[add]) + OSF.OUtil.defineEnumerableProperty(target,add,{value: function() + { + var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments,eventDispatch,target) + }}); + if(!target[remove]) + OSF.OUtil.defineEnumerableProperty(target,remove,{value: function() + { + var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments,eventDispatch,target) + }}) +}; +if(!OsfMsAjaxFactory.isMsAjaxLoaded()) + if(!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) + { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==="https:" ? "https:" : "http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js"; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() + { + if(!OsfMsAjaxFactory.isMsAjaxLoaded()) + throw"Not able to load MicrosoftAjax.js."; + }) + } +OSF.OUtil.setNamespace("SafeArray",OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate",OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) +{ + var status; + var number=ex.number; + if(number) + switch(number) + { + case-2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case-2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break + } + if(args.onComplete) + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError) +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() +{ + function _2DVBArrayToJaggedArray(vbArr) + { + var ret; + try + { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if(rows==1 && cols==1) + ret=[vbArr]; + else + { + ret=[]; + for(var row=0; row < rows; row++) + { + var rowArr=[]; + for(var col=0; col < cols; col++) + { + var datum=vbArr[row * cols+col]; + if(datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) + rowArr.push(datum) + } + if(rowArr.length > 0) + ret.push(rowArr) + } + } + } + catch(ex){} + return ret + } + var complexTypes=[]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=function() + { + var tableRows=0; + var tableHeaders=1; + return{ + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) + { + if(typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) + { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData + } + return data + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) + { + var ret; + if(hostArgs.toArray) + { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) + ret=_2DVBArrayToJaggedArray(hostArgs); + else + { + var array=hostArgs.toArray(); + if(array.length===2 && (array[0] !=null && array[0].toArray || array[1] !=null && array[1].toArray)) + { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]) + } + else + ret=array + } + } + else + ret=hostArgs; + return ret + } + } + }(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,complexTypes,dynamicTypes); + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) + { + var value; + if(this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) + { + var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray; + value=toArraySupported ? arg.toArray() : arg || {} + } + else if(this.isDynamicType(param)) + value=dynamicTypes[param].fromHost(arg); + else + value=arg; + return value + } +}; +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [{ + name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, + value: 0 + },{ + name: Microsoft.Office.WebExtension.ValueFormat.Formatted, + value: 1 + }] + },{ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [{ + name: Microsoft.Office.WebExtension.FilterType.All, + value: 0 + }] + }]); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [{ + name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, + value: 0 + },{ + name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, + value: 1 + }] +}); +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) +{ + function toArray(args) + { + var arrArgs=args; + if(OSF.OUtil.isArray(args)) + { + var len=arrArgs.length; + for(var i=0; i < len; i++) + arrArgs[i]=toArray(arrArgs[i]) + } + else if(OSF.OUtil.isDate(args)) + arrArgs=args.getVarDate(); + else if(typeof args==="object" && !OSF.OUtil.isArray(args)) + { + arrArgs=[]; + for(var index in args) + if(!OSF.OUtil.isFunction(args[index])) + arrArgs[index]=toArray(args[index]) + } + return arrArgs + } + try + { + if(args.onCalling) + args.onCalling(); + var startTime=(new Date).getTime(); + OSF.ClientHostController.execute(args.dispId,toArray(args.hostCallArgs),function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) + { + if(args.onReceiving) + args.onReceiving(); + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if(args.onComplete) + { + var payload; + if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + if(result.length > 2) + { + payload=[]; + for(var i=1; i < result.length; i++) + payload[i - 1]=result[i] + } + else + payload=result[OSF.DDA.SafeArray.Response.Payload]; + else + payload=result[OSF.DDA.SafeArray.Response.Payload]; + args.onComplete(status,payload) + } + if(OSF.AppTelemetry) + OSF.AppTelemetry.onMethodDone(args.dispId,args.hostCallArgs,Math.abs((new Date).getTime() - startTime),status) + }) + } + catch(ex) + { + OSF.DDA.SafeArray.Delegate._onException(ex,args) + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) +{ + var startTime=(new Date).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) + { + if(args.onReceiving) + args.onReceiving(); + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if(args.onComplete) + args.onComplete(status); + if(OSF.AppTelemetry) + OSF.AppTelemetry.onRegisterDone(register,args.dispId,Math.abs((new Date).getTime() - startTime),status) + } +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) +{ + if(args.onCalling) + args.onCalling(); + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true,args); + try + { + OSF.ClientHostController.registerEvent(args.dispId,args.targetId,function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) + { + if(args.onEvent) + args.onEvent(payload); + if(OSF.AppTelemetry) + OSF.AppTelemetry.onEventDone(args.dispId) + },callback) + } + catch(ex) + { + OSF.DDA.SafeArray.Delegate._onException(ex,args) + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) +{ + if(args.onCalling) + args.onCalling(); + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false,args); + try + { + OSF.ClientHostController.unregisterEvent(args.dispId,args.targetId,callback) + } + catch(ex) + { + OSF.DDA.SafeArray.Delegate._onException(ex,args) + } +}; +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) +{ + this._hostInfo=hostInfo; + this._webAppState=webAppState; + this._context=context; + this._settings=settings; + this._hostFacade=hostFacade; + this._initializeSettings=this.initializeSettings +}; +OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) +{ + var settings; + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if(osfSessionStorage) + { + var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if(storageSettings) + serializedSettings=typeof JSON !=="undefined" ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings,true); + else + { + storageSettings=typeof JSON !=="undefined" ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),storageSettings) + } + } + var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if(refreshSupported) + settings=new OSF.DDA.RefreshableSettings(deserializedSettings); + else + settings=new OSF.DDA.Settings(deserializedSettings); + return settings +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication(){}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) +{ + var license=new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler=OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext,appContext.doc,license,null,getOfficeThemeHandler)); + var getDelegateMethods, + parameterMap; + var reason=appContext.get_reason(); + getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap; + reason=OSF.DDA.RichInitializationReason[reason]; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods,parameterMap)); + Microsoft.Office.WebExtension.initialize(reason) +}; +OSF.DDA.DispIdHost.getClientDelegateMethods=function(actionId) +{ + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + if(OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) + { + var readSerializedSettings=function(hostCallArgs, onCalling, onReceiving) + { + return OSF.DDA.ClientSettingsManager.read(onCalling,onReceiving) + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings) + } + if(OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) + { + var writeSerializedSettings=function(hostCallArgs, onCalling, onReceiving) + { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings],hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale],onCalling,onReceiving) + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings) + } + return delegateMethods +}; +var OSFRichclient; +(function(OSFRichclient) +{ + var RichClientHostController=function() + { + function RichClientHostController(){} + RichClientHostController.prototype.execute=function(id, params, callback) + { + window.external.Execute(id,params,callback) + }; + RichClientHostController.prototype.registerEvent=function(id, targetId, handler, callback) + { + window.external.RegisterEvent(id,targetId,handler,callback) + }; + RichClientHostController.prototype.unregisterEvent=function(id, targetId, callback) + { + window.external.UnregisterEvent(id,targetId,callback) + }; + return RichClientHostController + }(); + OSFRichclient.RichClientHostController=RichClientHostController +})(OSFRichclient || (OSFRichclient={})); +OSF.ClientHostController=new OSFRichclient.RichClientHostController; +var OfficeExt; +(function(OfficeExt) +{ + (function(OfficeTheme) + { + var OfficeThemeManager=function() + { + function OfficeThemeManager() + { + this._osfOfficeTheme=null; + this._osfOfficeThemeTimeStamp=null + } + OfficeThemeManager.prototype.getOfficeTheme=function() + { + if(OSF.DDA._OsfControlContext) + { + if(this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && (new Date).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod) + { + if(OSF.AppTelemetry) + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo",0) + } + else + { + var startTime=(new Date).getTime(); + var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo(); + var endTime=(new Date).getTime(); + if(OSF.AppTelemetry) + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo",Math.abs(endTime - startTime)); + this._osfOfficeTheme=JSON.parse(osfOfficeTheme); + for(var color in this._osfOfficeTheme) + this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]); + this._osfOfficeThemeTimeStamp=endTime + } + return this._osfOfficeTheme + } + }; + OfficeThemeManager.instance=function() + { + if(OfficeThemeManager._instance==null) + OfficeThemeManager._instance=new OfficeThemeManager; + return OfficeThemeManager._instance + }; + OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5e3; + OfficeThemeManager._instance=null; + return OfficeThemeManager + }(); + OfficeTheme.OfficeThemeManager=OfficeThemeManager; + OSF.OUtil.setNamespace("OfficeTheme",OSF.DDA); + OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme + })(OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={})); + var OfficeTheme=OfficeExt.OfficeTheme +})(OfficeExt || (OfficeExt={})); +OSF.DDA.ClientSettingsManager={ + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) + { + return function(args) + { + var status, + response; + try + { + response=hostDelegateMethod(args.hostCallArgs,args.onCalling,args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess + } + catch(ex) + { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ + name: Strings.OfficeOM.L_InternalError, + message: ex + } + } + if(args.onComplete) + args.onComplete(status,response) + } + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) + { + var keys=[]; + var values=[]; + if(onCalling) + onCalling(); + OSF.DDA._OsfControlContext.GetSettings().Read(keys,values); + if(onReceiving) + onReceiving(); + var serializedSettings={}; + for(var index=0; index < keys.length; index++) + serializedSettings[keys[index]]=values[index]; + return serializedSettings + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) + { + var keys=[]; + var values=[]; + for(var key in serializedSettings) + { + keys.push(key); + values.push(serializedSettings[key]) + } + if(onCalling) + onCalling(); + OSF.DDA._OsfControlContext.GetSettings().Write(keys,values); + if(onReceiving) + onReceiving() + } +}; +OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported) +{ + var serializedSettings=OSF.DDA.ClientSettingsManager.read(); + var settings=this.deserializeSettings(serializedSettings,refreshSupported); + return settings +}; +OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) +{ + var returnedContext; + var context=OSF.DDA._OsfControlContext=window.external.GetContext(); + var appType=context.GetAppType(); + var appTypeSupported=false; + for(var appEntry in OSF.AppName) + if(OSF.AppName[appEntry]==appType) + { + appTypeSupported=true; + break + } + if(!appTypeSupported) + throw"Unsupported client type "+appType; + var id=context.GetSolutionRef(); + var version=context.GetAppVersionMajor(); + var UILocale=context.GetAppUILocale(); + var dataLocale=context.GetAppDataLocale(); + var docUrl=context.GetDocUrl(); + var clientMode=context.GetAppCapabilities(); + var reason=context.GetActivationMode(); + var osfControlType=context.GetControlIntegrationLevel(); + var settings=[]; + var eToken; + try + { + eToken=context.GetSolutionToken() + } + catch(ex){} + var correlationId; + if(typeof context.GetCorrelationId !=="undefined") + correlationId=context.GetCorrelationId(); + var appInstanceId; + if(typeof context.GetInstanceId !=="undefined") + appInstanceId=context.GetInstanceId(); + var touchEnabled; + if(typeof context.GetTouchEnabled !=="undefined") + touchEnabled=context.GetTouchEnabled(); + var commerceAllowed; + if(typeof context.GetCommerceAllowed !=="undefined") + commerceAllowed=context.GetCommerceAllowed(); + eToken=eToken ? eToken.toString() : ""; + returnedContext=new OSF.OfficeAppContext(id,appType,version,UILocale,dataLocale,docUrl,clientMode,settings,reason,osfControlType,eToken,correlationId,appInstanceId,touchEnabled,commerceAllowed); + if(OSF.AppTelemetry) + OSF.AppTelemetry.initialize(returnedContext); + gotAppContext(returnedContext) +}; +(function() +{ + var checkScriptOverride=function OSF$checkScriptOverride() + { + var postScriptOverrideCheckAction=function OSF$postScriptOverrideCheckAction(customizedScriptPath) + { + if(customizedScriptPath) + OSF.OUtil.loadScript(customizedScriptPath,function() + { + OsfMsAjaxFactory.msAjaxDebug.trace("loaded customized script:"+customizedScriptPath) + }) + }; + var conversationID, + webAppUrl, + items; + var clientEndPoint=null; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(); + if(xdmInfoValue) + { + items=OSF.OUtil.getInfoItems(xdmInfoValue); + if(items && items.length >=3) + { + conversationID=items[0]; + webAppUrl=items[2]; + clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(conversationID,window.parent,webAppUrl) + } + } + var customizedScriptPath=null; + if(!clientEndPoint) + { + try + { + if(typeof window.external.getCustomizedScriptPath !=="undefined") + customizedScriptPath=window.external.getCustomizedScriptPath() + } + catch(ex) + { + OsfMsAjaxFactory.msAjaxDebug.trace("no script override through window.external.") + } + postScriptOverrideCheckAction(customizedScriptPath) + } + else + try + { + clientEndPoint.invoke("getCustomizedScriptPathAsync",function OSF$getCustomizedScriptPathAsyncCallback(errorCode, scriptPath) + { + postScriptOverrideCheckAction(errorCode===0 ? scriptPath : null) + },{__timeout__: 1e3}) + } + catch(ex) + { + OsfMsAjaxFactory.msAjaxDebug.trace("no script override through cross frame communication.") + } + }; + if(OSF._OfficeAppFactory.getLoadScriptHelper) + OSF._OfficeAppFactory.getLoadScriptHelper().waitForScripts([OSF.ConstantNames.MicrosoftAjaxId],checkScriptOverride) +})(); +Microsoft.Office.WebExtension.EventType={}; +OSF.EventDispatch=function OSF_EventDispatch(eventTypes) +{ + this._eventHandlers={}; + for(var entry in eventTypes) + { + var eventType=eventTypes[entry]; + this._eventHandlers[eventType]=[] + } +}; +OSF.EventDispatch.prototype={ + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() + { + var events=[]; + for(var eventName in this._eventHandlers) + events.push(eventName); + return events + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) + { + var isSupported=false; + for(var eventName in this._eventHandlers) + if(event==eventName) + { + isSupported=true; + break + } + return isSupported + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) + { + var handlers=this._eventHandlers[eventType]; + if(handlers && handlers.length > 0) + for(var h in handlers) + if(handlers[h]===handler) + return true; + return false + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) + { + if(typeof handler !="function") + return false; + var handlers=this._eventHandlers[eventType]; + if(handlers && !this.hasEventHandler(eventType,handler)) + { + handlers.push(handler); + return true + } + else + return false + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) + { + var handlers=this._eventHandlers[eventType]; + if(handlers && handlers.length > 0) + for(var index=0; index < handlers.length; index++) + if(handlers[index]===handler) + { + handlers.splice(index,1); + return true + } + return false + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) + { + if(typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) + { + this._eventHandlers[eventType]=[]; + return true + } + return false + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) + { + return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1 + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) + { + if(eventArgs.type==undefined) + return false; + var eventType=eventArgs.type; + if(eventType && this._eventHandlers[eventType]) + { + var eventHandlers=this._eventHandlers[eventType]; + for(var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true + } + else + return false + } +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) +{ + var args; + switch(eventType) + { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args=new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties,target.document),eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties,target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args=new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args=new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args=new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args=new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,eventType)); + } + return args +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [{ + name: Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + verify: function(eventType, caller, eventDispatch) + { + return eventDispatch.supportsEvent(eventType) + } + },{ + name: Microsoft.Office.WebExtension.Parameters.Handler, + types: ["function"] + }], + supportedOptions: [], + privateStateCallbacks: [] +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [{ + name: Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + verify: function(eventType, caller, eventDispatch) + { + return eventDispatch.supportsEvent(eventType) + } + }], + supportedOptions: [{ + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + types: ["function","object"], + defaultValue: null + } + }], + privateStateCallbacks: [] +}); +var OfficeExt; +(function(OfficeExt) +{ + (function(AppCommand) + { + var AppCommandManager=function() + { + function AppCommandManager() + { + var _this=this; + this._pseudoDocument=null; + this._eventDispatch=null; + this._processAppCommandInvocation=function(args) + { + var verifyResult=_this._verifyManifestCallback(args.callbackName); + if(verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) + { + _this._invokeAppCommandCompletedMethod(args.appCommandId,verifyResult.errorCode,""); + return + } + var eventObj=_this._constructEventObjectForCallback(args); + if(eventObj) + window.setTimeout(function() + { + verifyResult.callback(eventObj) + },0); + else + _this._invokeAppCommandCompletedMethod(args.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,"") + } + } + AppCommandManager.initializeOsfDda=function() + { + OSF.DDA.AsyncMethodNames.addNames({AppCommandInvocationCompletedAsync: "appCommandInvocationCompletedAsync"}); + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync, + requiredArguments: [{ + name: Microsoft.Office.WebExtension.Parameters.Id, + types: ["string"] + },{ + name: Microsoft.Office.WebExtension.Parameters.Status, + types: ["number"] + },{ + name: Microsoft.Office.WebExtension.Parameters.Data, + types: ["string"] + }] + }); + OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{AppCommandInvokedEvent: "AppCommandInvokedEvent"}); + OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{AppCommandInvoked: "appCommandInvoked"}); + OSF.OUtil.setNamespace("AppCommand",OSF.DDA); + OSF.DDA.AppCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs + }; + AppCommandManager.prototype.initializeAndChangeOnce=function(callback) + { + AppCommand.registerDdaFacade(); + this._pseudoDocument={}; + OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument,[OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync]); + this._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.AppCommandInvoked]); + var onRegisterCompleted=function(result) + { + if(callback) + if(result.status=="succeeded") + callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + else + callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError) + }; + OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument,this._eventDispatch); + this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked,this._processAppCommandInvocation,onRegisterCompleted) + }; + AppCommandManager.prototype._verifyManifestCallback=function(callbackName) + { + var defaultResult={ + callback: null, + errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback + }; + callbackName=callbackName.trim(); + try + { + var callList=callbackName.split("."); + var parentObject=window; + for(var i=0; i < callList.length - 1; i++) + if(parentObject[callList[i]] && typeof parentObject[callList[i]]=="object") + parentObject=parentObject[callList[i]]; + else + return defaultResult; + var callbackFunc=parentObject[callList[callList.length - 1]]; + if(typeof callbackFunc !="function") + return defaultResult + } + catch(e) + { + return defaultResult + } + return{ + callback: callbackFunc, + errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess + } + }; + AppCommandManager.prototype._invokeAppCommandCompletedMethod=function(appCommandId, resultCode, data) + { + this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId,resultCode,data) + }; + AppCommandManager.prototype._constructEventObjectForCallback=function(args) + { + var _this=this; + var eventObj=new AppCommandCallbackEventArgs; + try + { + var jsonData=JSON.parse(args.eventObjStr); + this._translateEventObjectInternal(jsonData,eventObj); + Object.defineProperty(eventObj,"completed",{ + value: function() + { + var jsonString=JSON.stringify(eventObj); + _this._invokeAppCommandCompletedMethod(args.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,jsonString) + }, + enumerable: true + }) + } + catch(e) + { + eventObj=null + } + return eventObj + }; + AppCommandManager.prototype._translateEventObjectInternal=function(input, output) + { + for(var key in input) + { + if(!input.hasOwnProperty(key)) + continue; + var inputChild=input[key]; + if(typeof inputChild=="object" && inputChild !=null) + { + OSF.OUtil.defineEnumerableProperty(output,key,{value: {}}); + this._translateEventObjectInternal(inputChild,output[key]) + } + else + Object.defineProperty(output,key,{ + value: inputChild, + enumerable: true, + writable: true + }) + } + }; + AppCommandManager.prototype._constructObjectByTemplate=function(template, input) + { + var output={}; + if(!template || !input) + return output; + for(var key in template) + if(template.hasOwnProperty(key)) + { + output[key]=null; + if(input[key] !=null) + { + var templateChild=template[key]; + var inputChild=input[key]; + var inputChildType=typeof inputChild; + if(typeof templateChild=="object" && templateChild !=null) + output[key]=this._constructObjectByTemplate(templateChild,inputChild); + else if(inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean") + output[key]=inputChild + } + } + return output + }; + AppCommandManager.instance=function() + { + if(AppCommandManager._instance==null) + AppCommandManager._instance=new AppCommandManager; + return AppCommandManager._instance + }; + AppCommandManager._instance=null; + return AppCommandManager + }(); + AppCommand.AppCommandManager=AppCommandManager; + var AppCommandInvokedEventArgs=function() + { + function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr) + { + this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked; + this.appCommandId=appCommandId; + this.callbackName=callbackName; + this.eventObjStr=eventObjStr + } + AppCommandInvokedEventArgs.create=function(eventProperties) + { + return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId],eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName],eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr]) + }; + return AppCommandInvokedEventArgs + }(); + AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs; + var AppCommandCallbackEventArgs=function() + { + function AppCommandCallbackEventArgs(){} + return AppCommandCallbackEventArgs + }(); + AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs; + AppCommand.AppCommandInvokedEventEnums={ + AppCommandId: "appCommandId", + CallbackName: "callbackName", + EventObjStr: "eventObjStr" + } + })(OfficeExt.AppCommand || (OfficeExt.AppCommand={})); + var AppCommand=OfficeExt.AppCommand +})(OfficeExt || (OfficeExt={})); +OfficeExt.AppCommand.AppCommandManager.initializeOsfDda(); +var OSFLog; +(function(OSFLog) +{ + var BaseUsageData=function() + { + function BaseUsageData(table) + { + this._table=table; + this._fields={} + } + Object.defineProperty(BaseUsageData.prototype,"Fields",{ + get: function() + { + return this._fields + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype,"Table",{ + get: function() + { + return this._table + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields=function(){}; + BaseUsageData.prototype.SetSerializedField=function(key, value) + { + if(typeof value !=="undefined" && value !==null) + this._serializedFields[key]=value.toString() + }; + BaseUsageData.prototype.SerializeRow=function() + { + this._serializedFields={}; + this.SetSerializedField("Table",this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields) + }; + return BaseUsageData + }(); + OSFLog.BaseUsageData=BaseUsageData; + var AppActivatedUsageData=function(_super) + { + __extends(AppActivatedUsageData,_super); + function AppActivatedUsageData() + { + _super.call(this,"AppActivated") + } + Object.defineProperty(AppActivatedUsageData.prototype,"CorrelationId",{ + get: function() + { + return this.Fields["CorrelationId"] + }, + set: function(value) + { + this.Fields["CorrelationId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"SessionId",{ + get: function() + { + return this.Fields["SessionId"] + }, + set: function(value) + { + this.Fields["SessionId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"AppId",{ + get: function() + { + return this.Fields["AppId"] + }, + set: function(value) + { + this.Fields["AppId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"AppURL",{ + get: function() + { + return this.Fields["AppURL"] + }, + set: function(value) + { + this.Fields["AppURL"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"AssetId",{ + get: function() + { + return this.Fields["AssetId"] + }, + set: function(value) + { + this.Fields["AssetId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"Browser",{ + get: function() + { + return this.Fields["Browser"] + }, + set: function(value) + { + this.Fields["Browser"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"UserId",{ + get: function() + { + return this.Fields["UserId"] + }, + set: function(value) + { + this.Fields["UserId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"Host",{ + get: function() + { + return this.Fields["Host"] + }, + set: function(value) + { + this.Fields["Host"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"HostVersion",{ + get: function() + { + return this.Fields["HostVersion"] + }, + set: function(value) + { + this.Fields["HostVersion"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"ClientId",{ + get: function() + { + return this.Fields["ClientId"] + }, + set: function(value) + { + this.Fields["ClientId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"AppSizeWidth",{ + get: function() + { + return this.Fields["AppSizeWidth"] + }, + set: function(value) + { + this.Fields["AppSizeWidth"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype,"AppSizeHeight",{ + get: function() + { + return this.Fields["AppSizeHeight"] + }, + set: function(value) + { + this.Fields["AppSizeHeight"]=value + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields=function() + { + this.SetSerializedField("CorrelationId",this.CorrelationId); + this.SetSerializedField("SessionId",this.SessionId); + this.SetSerializedField("AppId",this.AppId); + this.SetSerializedField("AppURL",this.AppURL); + this.SetSerializedField("AssetId",this.AssetId); + this.SetSerializedField("Browser",this.Browser); + this.SetSerializedField("UserId",this.UserId); + this.SetSerializedField("Host",this.Host); + this.SetSerializedField("HostVersion",this.HostVersion); + this.SetSerializedField("ClientId",this.ClientId); + this.SetSerializedField("AppSizeWidth",this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight",this.AppSizeHeight) + }; + return AppActivatedUsageData + }(BaseUsageData); + OSFLog.AppActivatedUsageData=AppActivatedUsageData; + var ScriptLoadUsageData=function(_super) + { + __extends(ScriptLoadUsageData,_super); + function ScriptLoadUsageData() + { + _super.call(this,"ScriptLoad") + } + Object.defineProperty(ScriptLoadUsageData.prototype,"SessionId",{ + get: function() + { + return this.Fields["SessionId"] + }, + set: function(value) + { + this.Fields["SessionId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype,"ScriptId",{ + get: function() + { + return this.Fields["ScriptId"] + }, + set: function(value) + { + this.Fields["ScriptId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype,"StartTime",{ + get: function() + { + return this.Fields["StartTime"] + }, + set: function(value) + { + this.Fields["StartTime"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype,"ResponseTime",{ + get: function() + { + return this.Fields["ResponseTime"] + }, + set: function(value) + { + this.Fields["ResponseTime"]=value + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields=function() + { + this.SetSerializedField("SessionId",this.SessionId); + this.SetSerializedField("ScriptId",this.ScriptId); + this.SetSerializedField("StartTime",this.StartTime); + this.SetSerializedField("ResponseTime",this.ResponseTime) + }; + return ScriptLoadUsageData + }(BaseUsageData); + OSFLog.ScriptLoadUsageData=ScriptLoadUsageData; + var AppClosedUsageData=function(_super) + { + __extends(AppClosedUsageData,_super); + function AppClosedUsageData() + { + _super.call(this,"AppClosed") + } + Object.defineProperty(AppClosedUsageData.prototype,"SessionId",{ + get: function() + { + return this.Fields["SessionId"] + }, + set: function(value) + { + this.Fields["SessionId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype,"FocusTime",{ + get: function() + { + return this.Fields["FocusTime"] + }, + set: function(value) + { + this.Fields["FocusTime"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype,"AppSizeFinalWidth",{ + get: function() + { + return this.Fields["AppSizeFinalWidth"] + }, + set: function(value) + { + this.Fields["AppSizeFinalWidth"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype,"AppSizeFinalHeight",{ + get: function() + { + return this.Fields["AppSizeFinalHeight"] + }, + set: function(value) + { + this.Fields["AppSizeFinalHeight"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype,"OpenTime",{ + get: function() + { + return this.Fields["OpenTime"] + }, + set: function(value) + { + this.Fields["OpenTime"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype,"CloseMethod",{ + get: function() + { + return this.Fields["CloseMethod"] + }, + set: function(value) + { + this.Fields["CloseMethod"]=value + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields=function() + { + this.SetSerializedField("SessionId",this.SessionId); + this.SetSerializedField("FocusTime",this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth",this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight",this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime",this.OpenTime); + this.SetSerializedField("CloseMethod",this.CloseMethod) + }; + return AppClosedUsageData + }(BaseUsageData); + OSFLog.AppClosedUsageData=AppClosedUsageData; + var APIUsageUsageData=function(_super) + { + __extends(APIUsageUsageData,_super); + function APIUsageUsageData() + { + _super.call(this,"APIUsage") + } + Object.defineProperty(APIUsageUsageData.prototype,"SessionId",{ + get: function() + { + return this.Fields["SessionId"] + }, + set: function(value) + { + this.Fields["SessionId"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype,"APIType",{ + get: function() + { + return this.Fields["APIType"] + }, + set: function(value) + { + this.Fields["APIType"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype,"APIID",{ + get: function() + { + return this.Fields["APIID"] + }, + set: function(value) + { + this.Fields["APIID"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype,"Parameters",{ + get: function() + { + return this.Fields["Parameters"] + }, + set: function(value) + { + this.Fields["Parameters"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype,"ResponseTime",{ + get: function() + { + return this.Fields["ResponseTime"] + }, + set: function(value) + { + this.Fields["ResponseTime"]=value + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype,"ErrorType",{ + get: function() + { + return this.Fields["ErrorType"] + }, + set: function(value) + { + this.Fields["ErrorType"]=value + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields=function() + { + this.SetSerializedField("SessionId",this.SessionId); + this.SetSerializedField("APIType",this.APIType); + this.SetSerializedField("APIID",this.APIID); + this.SetSerializedField("Parameters",this.Parameters); + this.SetSerializedField("ResponseTime",this.ResponseTime); + this.SetSerializedField("ErrorType",this.ErrorType) + }; + return APIUsageUsageData + }(BaseUsageData); + OSFLog.APIUsageUsageData=APIUsageUsageData +})(OSFLog || (OSFLog={})); +var Logger; +(function(Logger) +{ + "use strict"; + (function(TraceLevel) + { + TraceLevel[TraceLevel["info"]=0]="info"; + TraceLevel[TraceLevel["warning"]=1]="warning"; + TraceLevel[TraceLevel["error"]=2]="error" + })(Logger.TraceLevel || (Logger.TraceLevel={})); + var TraceLevel=Logger.TraceLevel; + (function(SendFlag) + { + SendFlag[SendFlag["none"]=0]="none"; + SendFlag[SendFlag["flush"]=1]="flush" + })(Logger.SendFlag || (Logger.SendFlag={})); + var SendFlag=Logger.SendFlag; + function allowUploadingData() + { + if(OSF.Logger && OSF.Logger.ulsEndpoint) + OSF.Logger.ulsEndpoint.loadProxyFrame() + } + Logger.allowUploadingData=allowUploadingData; + function sendLog(traceLevel, message, flag) + { + if(OSF.Logger && OSF.Logger.ulsEndpoint) + { + var jsonObj={ + traceLevel: traceLevel, + message: message, + flag: flag, + internalLog: true + }; + var logs=JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs) + } + } + Logger.sendLog=sendLog; + function creatULSEndpoint() + { + try + { + return new ULSEndpointProxy + } + catch(e) + { + return null + } + } + var ULSEndpointProxy=function() + { + function ULSEndpointProxy() + { + var _this=this; + this.proxyFrame=null; + this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer=[]; + this.proxyFrameReady=false; + OSF.OUtil.addEventListener(window,"message",function(e) + { + return _this.tellProxyFrameReady(e) + }); + setTimeout(function() + { + _this.loadProxyFrame() + },3e3) + } + ULSEndpointProxy.prototype.writeLog=function(log) + { + if(this.proxyFrameReady===true) + this.proxyFrame.contentWindow.postMessage(log,"*"); + else if(this.buffer.length < 128) + this.buffer.push(log) + }; + ULSEndpointProxy.prototype.loadProxyFrame=function() + { + if(this.proxyFrame==null) + { + this.proxyFrame=document.createElement("iframe"); + this.proxyFrame.setAttribute("style","display:none"); + this.proxyFrame.setAttribute("src",this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame) + } + }; + ULSEndpointProxy.prototype.tellProxyFrameReady=function(e) + { + var _this=this; + if(e.data==="ProxyFrameReadyToLog") + { + this.proxyFrameReady=true; + for(var i=0; i < this.buffer.length; i++) + this.writeLog(this.buffer[i]); + this.buffer.length=0; + OSF.OUtil.removeEventListener(window,"message",function(e) + { + return _this.tellProxyFrameReady(e) + }) + } + else if(e.data==="ProxyFrameReadyToInit") + { + var initJson={ + appName: "Office APPs", + sessionId: OSF.OUtil.Guid.generateNewGuid() + }; + var initStr=JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr,"*") + } + }; + return ULSEndpointProxy + }(); + if(!OSF.Logger) + OSF.Logger=Logger; + Logger.ulsEndpoint=creatULSEndpoint() +})(Logger || (Logger={})); +var OSFAppTelemetry; +(function(OSFAppTelemetry) +{ + "use strict"; + var appInfo; + var sessionId=OSF.OUtil.Guid.generateNewGuid(); + var AppInfo=function() + { + function AppInfo(){} + return AppInfo + }(); + var Event=function() + { + function Event(name, handler) + { + this.name=name; + this.handler=handler + } + return Event + }(); + var AppStorage=function() + { + function AppStorage() + { + this.clientIDKey="Office API client"; + this.logIdSetKey="Office App Log Id Set" + } + AppStorage.prototype.getClientId=function() + { + var clientId=this.getValue(this.clientIDKey); + if(!clientId || clientId.length <=0 || clientId.length > 40) + { + clientId=OSF.OUtil.Guid.generateNewGuid(); + this.setValue(this.clientIDKey,clientId) + } + return clientId + }; + AppStorage.prototype.saveLog=function(logId, log) + { + var logIdSet=this.getValue(this.logIdSetKey); + logIdSet=(logIdSet && logIdSet.length > 0 ? logIdSet+";" : "")+logId; + this.setValue(this.logIdSetKey,logIdSet); + this.setValue(logId,log) + }; + AppStorage.prototype.enumerateLog=function(callback, clean) + { + var logIdSet=this.getValue(this.logIdSetKey); + if(logIdSet) + { + var ids=logIdSet.split(";"); + for(var id in ids) + { + var logId=ids[id]; + var log=this.getValue(logId); + if(log) + { + if(callback) + callback(logId,log); + if(clean) + this.remove(logId) + } + } + if(clean) + this.remove(this.logIdSetKey) + } + }; + AppStorage.prototype.getValue=function(key) + { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + var value=""; + if(osfLocalStorage) + value=osfLocalStorage.getItem(key); + return value + }; + AppStorage.prototype.setValue=function(key, value) + { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if(osfLocalStorage) + osfLocalStorage.setItem(key,value) + }; + AppStorage.prototype.remove=function(key) + { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if(osfLocalStorage) + try + { + osfLocalStorage.removeItem(key) + } + catch(ex){} + }; + return AppStorage + }(); + var AppLogger=function() + { + function AppLogger(){} + AppLogger.prototype.LogData=function(data) + { + if(!OSF.Logger) + return; + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,data.SerializeRow(),OSF.Logger.SendFlag.none) + }; + AppLogger.prototype.LogRawData=function(log) + { + if(!OSF.Logger) + return; + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,log,OSF.Logger.SendFlag.none) + }; + return AppLogger + }(); + function initialize(context) + { + if(!OSF.Logger) + return; + if(appInfo) + return; + appInfo=new AppInfo; + appInfo.hostVersion=context.get_appVersion(); + appInfo.appId=context.get_id(); + appInfo.host=context.get_appName(); + appInfo.browser=window.navigator.userAgent; + appInfo.correlationId=context.get_correlationId(); + appInfo.clientId=(new AppStorage).getClientId(); + var index=location.href.indexOf("?"); + appInfo.appURL=index==-1 ? location.href : location.href.substring(0,index); + (function getUserIdAndAssetIdFromToken(token, appInfo) + { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId=""; + appInfo.userId=""; + try + { + xmlContent=decodeURIComponent(token); + parser=new DOMParser; + xmlDoc=parser.parseFromString(xmlContent,"text/xml"); + appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue + } + catch(e){} + finally + { + xmlContent=null; + xmlDoc=null; + parser=null + } + })(context.get_eToken(),appInfo); + (function handleLifecycle() + { + var startTime=new Date; + var lastFocus=null; + var focusTime=0; + var finished=false; + var adjustFocusTime=function() + { + if(document.hasFocus()) + { + if(lastFocus==null) + lastFocus=new Date + } + else if(lastFocus) + { + focusTime+=Math.abs((new Date).getTime() - lastFocus.getTime()); + lastFocus=null + } + }; + var eventList=[]; + eventList.push(new Event("focus",adjustFocusTime)); + eventList.push(new Event("blur",adjustFocusTime)); + eventList.push(new Event("focusout",adjustFocusTime)); + eventList.push(new Event("focusin",adjustFocusTime)); + var exitFunction=function() + { + for(var i=0; i < eventList.length; i++) + OSF.OUtil.removeEventListener(window,eventList[i].name,eventList[i].handler); + eventList.length=0; + if(!finished) + { + if(document.hasFocus() && lastFocus) + { + focusTime+=Math.abs((new Date).getTime() - lastFocus.getTime()); + lastFocus=null + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date).getTime() - startTime.getTime()),focusTime); + finished=true + } + }; + eventList.push(new Event("beforeunload",exitFunction)); + eventList.push(new Event("unload",exitFunction)); + for(var i=0; i < eventList.length; i++) + OSF.OUtil.addEventListener(window,eventList[i].name,eventList[i].handler); + adjustFocusTime() + })(); + OSFAppTelemetry.onAppActivated() + } + OSFAppTelemetry.initialize=initialize; + function onAppActivated() + { + if(!appInfo) + return; + (new AppStorage).enumerateLog(function(id, log) + { + return(new AppLogger).LogRawData(log) + },true); + var data=new OSFLog.AppActivatedUsageData; + data.SessionId=sessionId; + data.AppId=appInfo.appId; + data.AssetId=appInfo.assetId; + data.AppURL=appInfo.appURL; + data.UserId=appInfo.userId; + data.ClientId=appInfo.clientId; + data.Browser=appInfo.browser; + data.Host=appInfo.host; + data.HostVersion=appInfo.hostVersion; + data.CorrelationId=appInfo.correlationId; + data.AppSizeWidth=window.innerWidth; + data.AppSizeHeight=window.innerHeight; + (new AppLogger).LogData(data); + setTimeout(function() + { + if(!OSF.Logger) + return; + OSF.Logger.allowUploadingData() + },100) + } + OSFAppTelemetry.onAppActivated=onAppActivated; + function onScriptDone(scriptId, msStartTime, msResponseTime) + { + var data=new OSFLog.ScriptLoadUsageData; + data.SessionId=sessionId; + data.ScriptId=scriptId; + data.StartTime=msStartTime; + data.ResponseTime=msResponseTime; + (new AppLogger).LogData(data) + } + OSFAppTelemetry.onScriptDone=onScriptDone; + function onCallDone(apiType, id, parameters, msResponseTime, errorType) + { + if(!appInfo) + return; + var data=new OSFLog.APIUsageUsageData; + data.SessionId=sessionId; + data.APIType=apiType; + data.APIID=id; + data.Parameters=parameters; + data.ResponseTime=msResponseTime; + data.ErrorType=errorType; + (new AppLogger).LogData(data) + } + OSFAppTelemetry.onCallDone=onCallDone; + function onMethodDone(id, args, msResponseTime, errorType) + { + var parameters=null; + if(args) + if(typeof args=="number") + parameters=String(args); + else if(typeof args==="object") + for(var index in args) + { + if(parameters !==null) + parameters+=","; + else + parameters=""; + if(typeof args[index]=="number") + parameters+=String(args[index]) + } + else + parameters=""; + OSF.AppTelemetry.onCallDone("method",id,parameters,msResponseTime,errorType) + } + OSFAppTelemetry.onMethodDone=onMethodDone; + function onPropertyDone(propertyName, msResponseTime) + { + OSF.AppTelemetry.onCallDone("property",-1,propertyName,msResponseTime) + } + OSFAppTelemetry.onPropertyDone=onPropertyDone; + function onEventDone(id, errorType) + { + OSF.AppTelemetry.onCallDone("event",id,null,0,errorType) + } + OSFAppTelemetry.onEventDone=onEventDone; + function onRegisterDone(register, id, msResponseTime, errorType) + { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent",id,null,msResponseTime,errorType) + } + OSFAppTelemetry.onRegisterDone=onRegisterDone; + function onAppClosed(openTime, focusTime) + { + if(!appInfo) + return; + var data=new OSFLog.AppClosedUsageData; + data.SessionId=sessionId; + data.FocusTime=focusTime; + data.OpenTime=openTime; + data.AppSizeFinalWidth=window.innerWidth; + data.AppSizeFinalHeight=window.innerHeight; + (new AppStorage).saveLog(sessionId,data.SerializeRow()) + } + OSFAppTelemetry.onAppClosed=onAppClosed; + function onGetAppContextAsyncStart(startTime) + { + var data=new OSFLog.APIUsageUsageData; + data.SessionId=sessionId; + data.APIType="method"; + data.APIID=-1; + data.Parameters="onGetAppContextAsyncStart"; + data.ResponseTime=startTime; + data.ErrorType=null; + (new AppLogger).LogData(data) + } + OSFAppTelemetry.onGetAppContextAsyncStart=onGetAppContextAsyncStart; + OSF.AppTelemetry=OSFAppTelemetry +})(OSFAppTelemetry || (OSFAppTelemetry={})); +var OfficeExt; +(function(OfficeExt) +{ + (function(AppCommand) + { + function registerDdaFacade() + { + if(OSF.DDA.SafeArray) + { + var parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap; + parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod, + toHost: [{ + name: Microsoft.Office.WebExtension.Parameters.Id, + value: 0 + },{ + name: Microsoft.Office.WebExtension.Parameters.Status, + value: 1 + },{ + name: Microsoft.Office.WebExtension.Parameters.Data, + value: 2 + }] + }); + parameterMap.define({ + type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent, + fromHost: [{ + name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, + value: parameterMap.self + }], + isComplexType: true + }); + parameterMap.define({ + type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, + fromHost: [{ + name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId, + value: 0 + },{ + name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName, + value: 1 + },{ + name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr, + value: 2 + }], + isComplexType: true + }) + } + } + AppCommand.registerDdaFacade=registerDdaFacade + })(OfficeExt.AppCommand || (OfficeExt.AppCommand={})); + var AppCommand=OfficeExt.AppCommand +})(OfficeExt || (OfficeExt={})); +var OfficeJsClient_OutlookWin32; +(function(OfficeJsClient_OutlookWin32) +{ + function prepareRightBeforeWebExtensionInitialize() + { + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.DispIdHost.getClientDelegateMethods,OSF.DDA.SafeArray.Delegate.ParameterMap)); + var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance(); + appCommandHandler.initializeAndChangeOnce() + } + OfficeJsClient_OutlookWin32.prepareRightBeforeWebExtensionInitialize=prepareRightBeforeWebExtensionInitialize +})(OfficeJsClient_OutlookWin32 || (OfficeJsClient_OutlookWin32={})); +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) +{ + var license=new OSF.DDA.License(appContext.get_eToken()); + var isOwa=appContext.get_appName()==OSF.AppName.OutlookWebApp; + if(isOwa) + { + OSF.WebApp._UpdateLinksForHostAndXdmInfo(); + OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM)) + } + else + OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM,OSF.DDA.Theming ? OSF.DDA.Theming.getOfficeTheme : null)); + var reason=appContext.get_reason(); + Microsoft.Office.WebExtension.initialize(reason); + if(!isOwa) + OfficeJsClient_OutlookWin32.prepareRightBeforeWebExtensionInitialize() +}; +OSF.DDA.SettingsManager={ + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) + { + var ret={}; + for(var key in settingsCollection) + { + var value=settingsCollection[key]; + try + { + if(JSON) + value=JSON.stringify(value,function dateReplacer(k, v) + { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v + }); + else + value=Sys.Serialization.JavaScriptSerializer.serialize(value); + ret[key]=value + } + catch(ex){} + } + return ret + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) + { + var ret={}; + serializedSettings=serializedSettings || {}; + for(var key in serializedSettings) + { + var value=serializedSettings[key]; + try + { + if(JSON) + value=JSON.parse(value,function dateReviver(k, v) + { + var d; + if(typeof v==="string" && v && v.length > 6 && v.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) + { + d=new Date(parseInt(v.slice(5,-1))); + if(d) + return d + } + return v + }); + else + value=Sys.Serialization.JavaScriptSerializer.deserialize(value,true); + ret[key]=value + } + catch(ex){} + } + return ret + } +}; +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) +{ + Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums"); + Microsoft.Office.WebExtension.MailboxEnums.EntityType={ + MeetingSuggestion: "meetingSuggestion", + TaskSuggestion: "taskSuggestion", + Address: "address", + EmailAddress: "emailAddress", + Url: "url", + PhoneNumber: "phoneNumber", + Contact: "contact", + FlightReservations: "flightReservations", + ParcelDeliveries: "parcelDeliveries" + }; + Microsoft.Office.WebExtension.MailboxEnums.ItemType={ + Message: "message", + Appointment: "appointment" + }; + Microsoft.Office.WebExtension.MailboxEnums.ResponseType={ + None: "none", + Organizer: "organizer", + Tentative: "tentative", + Accepted: "accepted", + Declined: "declined" + }; + Microsoft.Office.WebExtension.MailboxEnums.RecipientType={ + Other: "other", + DistributionList: "distributionList", + User: "user", + ExternalUser: "externalUser" + }; + Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={ + File: "file", + Item: "item", + Cloud: "cloud" + }; + Microsoft.Office.WebExtension.MailboxEnums.BodyType={ + Text: "text", + Html: "html" + }; + Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType={ + ProgressIndicator: "progressIndicator", + InformationalMessage: "informationalMessage", + ErrorMessage: "errorMessage" + }; + Microsoft.Office.WebExtension.CoercionType={ + Text: "text", + Html: "html" + }; + Type.registerNamespace("OSF.DDA"); + OSF.DDA.OutlookAppOm=function(officeAppContext, targetWindow, appReadyCallback) + { + this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this,this._callAppReadyCallback$p$0); + this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this,this._displayNewAppointmentFormApi$p$0); + this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler); + this.$$d__getEwsUrl$p$0=Function.createDelegate(this,this._getEwsUrl$p$0); + this.$$d__getDiagnostics$p$0=Function.createDelegate(this,this._getDiagnostics$p$0); + this.$$d__getUserProfile$p$0=Function.createDelegate(this,this._getUserProfile$p$0); + this.$$d__getItem$p$0=Function.createDelegate(this,this._getItem$p$0); + this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this,this._getInitialDataResponseHandler$p$0); + OSF.DDA.OutlookAppOm._instance$p=this; + this._officeAppContext$p$0=officeAppContext; + this._appReadyCallback$p$0=appReadyCallback; + var $$t_4=this; + var stringLoadedCallback=function() + { + if(appReadyCallback) + $$t_4._invokeHostMethod$i$0(1,"GetInitialData",null,$$t_4.$$d__getInitialDataResponseHandler$p$0) + }; + if(this._areStringsLoaded$p$0()) + stringLoadedCallback(); + else + this._loadLocalizedScript$p$0(stringLoadedCallback) + }; + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function(currentPermissionLevel) + { + if(!currentPermissionLevel) + throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text); + }; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function(value, minValue, maxValue, argumentName) + { + if(value < minValue || value > maxValue) + throw Error.argumentOutOfRange(argumentName); + }; + OSF.DDA.OutlookAppOm._getHtmlBody$p=function(data) + { + var htmlBody=""; + if("htmlBody" in data) + { + OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p(data["htmlBody"]); + htmlBody=data["htmlBody"] + } + return htmlBody + }; + OSF.DDA.OutlookAppOm._getAttachments$p=function(data) + { + var attachments=[]; + if("attachments" in data) + { + attachments=data["attachments"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p(attachments) + } + return attachments + }; + OSF.DDA.OutlookAppOm._getOptionsAndCallback$p=function(data) + { + var args=[]; + if("options" in data) + args[0]=data["options"]; + if("callback" in data) + args[args.length]=data["callback"]; + return args + }; + OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p=function(attachments) + { + var attachmentsData=new Array(0); + if(Array.isInstanceOfType(attachments)) + for(var i=0; i < attachments.length; i++) + if(Object.isInstanceOfType(attachments[i])) + { + var attachment=attachments[i]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p(attachment); + attachmentsData[i]=OSF.DDA.OutlookAppOm._createAttachmentData$p(attachment) + } + else + throw Error.argument("attachments"); + return attachmentsData + }; + OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p=function(htmlBody) + { + if(!String.isInstanceOfType(htmlBody)) + throw Error.argument("htmlBody"); + if($h.ScriptHelpers.isNullOrUndefined(htmlBody)) + throw Error.argument("htmlBody"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody") + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p=function(attachments) + { + if(!Array.isInstanceOfType(attachments)) + throw Error.argument("attachments"); + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p=function(attachment) + { + if(!Object.isInstanceOfType(attachment)) + throw Error.argument("attachments"); + if(!("type" in attachment) || !("name" in attachment)) + throw Error.argument("attachments"); + if(!("url" in attachment || "itemId" in attachment)) + throw Error.argument("attachments"); + }; + OSF.DDA.OutlookAppOm._createAttachmentData$p=function(attachment) + { + var attachmentData=null; + if(attachment["type"]==="file") + { + var url=attachment["url"]; + var name=attachment["name"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p(url,name); + attachmentData=OSF.DDA.OutlookAppOm._createFileAttachmentData$p(url,name) + } + else if(attachment["type"]==="item") + { + var itemId=attachment["itemId"]; + var name=attachment["name"]; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p(itemId,name); + attachmentData=OSF.DDA.OutlookAppOm._createItemAttachmentData$p(itemId,name) + } + else + throw Error.argument("attachments"); + return attachmentData + }; + OSF.DDA.OutlookAppOm._createFileAttachmentData$p=function(url, name) + { + return["file",name,url] + }; + OSF.DDA.OutlookAppOm._createItemAttachmentData$p=function(itemId, name) + { + return["item",name,itemId] + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p=function(url, name) + { + if(!String.isInstanceOfType(url) || !String.isInstanceOfType(name)) + throw Error.argument("attachments"); + if(url.length > 2048) + throw Error.argumentOutOfRange("attachments",url.length,_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text); + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name) + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p=function(itemId, name) + { + if(!String.isInstanceOfType(itemId) || !String.isInstanceOfType(name)) + throw Error.argument("attachments"); + if(itemId.length > 200) + throw Error.argumentOutOfRange("attachments",itemId.length,_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text); + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name) + }; + OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p=function(name) + { + if(name.length > 255) + throw Error.argumentOutOfRange("attachments",name.length,_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text); + }; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function(value, expectedType, argumentName) + { + if(Object.getType(value) !==expectedType) + throw Error.argumentType(argumentName); + }; + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function(value, minLength, maxLength, name) + { + if($h.ScriptHelpers.isNullOrUndefined(value)) + return; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value,String,name); + var stringValue=value; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(stringValue.length,minLength,maxLength,name) + }; + OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function(dispid, data) + { + var executeParameters=null; + switch(dispid) + { + case 1: + case 2: + case 12: + case 3: + case 14: + case 18: + case 26: + case 32: + case 41: + case 34: + break; + case 4: + var jsonProperty=JSON.stringify(data["customProperties"]); + executeParameters=[jsonProperty]; + break; + case 5: + executeParameters=[data["body"]]; + break; + case 8: + case 9: + executeParameters=[data["itemId"]]; + break; + case 7: + executeParameters=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["requiredAttendees"]),OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["optionalAttendees"]),data["start"],data["end"],data["location"],OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["resources"]),data["subject"],data["body"]]; + break; + case 40: + executeParameters=[data["extensionId"],data["consentState"]]; + break; + case 11: + case 10: + executeParameters=[data["htmlBody"]]; + break; + case 31: + case 30: + executeParameters=[data["htmlBody"],data["attachments"]]; + break; + case 23: + case 13: + case 38: + case 29: + executeParameters=[data["data"],data["coercionType"]]; + break; + case 37: + case 28: + executeParameters=[data["coercionType"]]; + break; + case 17: + executeParameters=[data["subject"]]; + break; + case 15: + executeParameters=[data["recipientField"]]; + break; + case 22: + case 21: + executeParameters=[data["recipientField"],OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(data["recipientArray"])]; + break; + case 19: + executeParameters=[data["itemId"],data["name"]]; + break; + case 16: + executeParameters=[data["uri"],data["name"]]; + break; + case 20: + executeParameters=[data["attachmentIndex"]]; + break; + case 25: + executeParameters=[data["TimeProperty"],data["time"]]; + break; + case 24: + executeParameters=[data["TimeProperty"]]; + break; + case 27: + executeParameters=[data["location"]]; + break; + case 33: + case 35: + executeParameters=[data["key"],data["type"],data["persistent"],data["message"],data["icon"]]; + break; + case 36: + executeParameters=[data["key"]]; + break; + default: + Sys.Debug.fail("Unexpected method dispid"); + break + } + return executeParameters + }; + OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(array) + { + return array ? array.join(";") : null + }; + OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function(recipients) + { + if(!recipients) + return null; + var results=new Array(recipients.length); + for(var i=0; i < recipients.length; i++) + results[i]=[recipients[i]["address"],recipients[i]["name"]]; + return results + }; + OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function(emailset, name) + { + if($h.ScriptHelpers.isNullOrUndefined(emailset)) + return null; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset,Array,name); + var originalAttendees=emailset; + var updatedAttendees=null; + var normalizationNeeded=false; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(originalAttendees.length,0,OSF.DDA.OutlookAppOm._maxRecipients$p,String.format("{0}.length",name)); + for(var i=0; i < originalAttendees.length; i++) + if($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) + { + normalizationNeeded=true; + break + } + if(normalizationNeeded) + updatedAttendees=[]; + for(var i=0; i < originalAttendees.length; i++) + if(normalizationNeeded) + { + updatedAttendees[i]=$h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]) ? originalAttendees[i].emailAddress : originalAttendees[i]; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i],String,String.format("{0}[{1}]",name,i)) + } + else + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i],String,String.format("{0}[{1}]",name,i)); + return updatedAttendees + }; + OSF.DDA.OutlookAppOm.prototype={ + _initialData$p$0: null, + _item$p$0: null, + _userProfile$p$0: null, + _diagnostics$p$0: null, + _officeAppContext$p$0: null, + _appReadyCallback$p$0: null, + _clientEndPoint$p$0: null, + get_clientEndPoint: function() + { + if(!this._clientEndPoint$p$0) + this._clientEndPoint$p$0=OSF._OfficeAppFactory.getClientEndPoint(); + return this._clientEndPoint$p$0 + }, + set_clientEndPoint: function(value) + { + this._clientEndPoint$p$0=value; + return value + }, + get_initialData: function() + { + return this._initialData$p$0 + }, + get__appName$i$0: function() + { + return this._officeAppContext$p$0.get_appName() + }, + initialize: function(initialData) + { + var ItemTypeKey="itemType"; + this._initialData$p$0=new $h.InitialData(initialData); + if(1===initialData[ItemTypeKey]) + this._item$p$0=new $h.Message(this._initialData$p$0); + else if(3===initialData[ItemTypeKey]) + this._item$p$0=new $h.MeetingRequest(this._initialData$p$0); + else if(2===initialData[ItemTypeKey]) + this._item$p$0=new $h.Appointment(this._initialData$p$0); + else if(4===initialData[ItemTypeKey]) + this._item$p$0=new $h.MessageCompose(this._initialData$p$0); + else if(5===initialData[ItemTypeKey]) + this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0); + else + Sys.Debug.trace("Unexpected item type was received from the host."); + this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0); + this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0.get_appName()); + this._initializeMethods$p$0(); + $h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"ewsUrl",this.$$d__getEwsUrl$p$0); + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + if(this._initialData$p$0.get__overrideWindowOpen$i$0()) + window.open=this.$$d_windowOpenOverrideHandler + }, + windowOpenOverrideHandler: function(url, targetName, features, replace) + { + this._invokeHostMethod$i$0(0,"LaunchPalUrl",{launchUrl: url},null) + }, + makeEwsRequestAsync: function(data) + { + var args=[]; + for(var $$pai_5=1; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 1]=arguments[$$pai_5]; + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + if(data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) + throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text); + this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0); + var $$t_4=this; + ewsRequest.onreadystatechange=function() + { + if(4===ewsRequest.get__requestState$i$1()) + parameters._callback$p$0(ewsRequest._asyncResult$p$0) + }; + ewsRequest.send(data) + }, + recordDataPoint: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"RecordDataPoint",data,null) + }, + recordTrace: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"RecordTrace",data,null) + }, + trackCtq: function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + this._invokeHostMethod$i$0(0,"TrackCtq",data,null) + }, + convertToLocalClientTime: function(timeValue) + { + var date=new Date(timeValue.getTime()); + var offset=date.getTimezoneOffset() * -1; + if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + date.setUTCMinutes(date.getUTCMinutes() - offset); + offset=this._findOffset$p$0(date); + date.setUTCMinutes(date.getUTCMinutes()+offset) + } + var retValue=this._dateToDictionary$i$0(date); + retValue["timezoneOffset"]=offset; + return retValue + }, + convertToUtcClientTime: function(input) + { + var retValue=this._dictionaryToDate$i$0(input); + if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + var offset=this._findOffset$p$0(retValue); + retValue.setUTCMinutes(retValue.getUTCMinutes() - offset); + offset=!input["timezoneOffset"] ? retValue.getTimezoneOffset() * -1 : input["timezoneOffset"]; + retValue.setUTCMinutes(retValue.getUTCMinutes()+offset) + } + return retValue + }, + getUserIdentityTokenAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",parameters._callback$p$0,parameters._asyncContext$p$0) + }, + getCallbackTokenAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync"); + var parameters=$h.CommonParameters.parse(args,true,true); + this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",parameters._callback$p$0,parameters._asyncContext$p$0) + }, + displayMessageForm: function(itemId) + { + if($h.ScriptHelpers.isNullOrUndefined(itemId)) + throw Error.argumentNull("itemId"); + this._invokeHostMethod$i$0(8,"DisplayExistingMessageForm",{itemId: itemId},null) + }, + displayAppointmentForm: function(itemId) + { + if($h.ScriptHelpers.isNullOrUndefined(itemId)) + throw Error.argumentNull("itemId"); + this._invokeHostMethod$i$0(9,"DisplayExistingAppointmentForm",{itemId: itemId},null) + }, + RegisterConsentAsync: function(consentState) + { + if(consentState !==2 && consentState !==1 && consentState) + throw Error.argumentOutOfRange("consentState"); + var parameters={}; + parameters["consentState"]=consentState.toString(); + parameters["extensionId"]=this.GetExtensionId(); + this._invokeHostMethod$i$0(40,"RegisterConsentAsync",parameters,null) + }, + CloseApp: function() + { + this._invokeHostMethod$i$0(42,"CloseApp",null,null) + }, + GetIsRead: function() + { + return this._initialData$p$0.get__isRead$i$0() + }, + GetEndNodeUrl: function() + { + return this._initialData$p$0.get__endNodeUrl$i$0() + }, + GetConsentMetadata: function() + { + return this._initialData$p$0.get__consentMetadata$i$0() + }, + GetEntryPointUrl: function() + { + return this._initialData$p$0.get__entryPointUrl$i$0() + }, + GetMarketplaceContentMarket: function() + { + return this._initialData$p$0.get__marketplaceContentMarket$i$0() + }, + GetMarketplaceAssetId: function() + { + return this._initialData$p$0.get__marketplaceAssetId$i$0() + }, + GetExtensionId: function() + { + return this._initialData$p$0.get__extensionId$i$0() + }, + createAsyncResult: function(value, errorCode, detailedErrorCode, userContext, errorMessage) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if(0 !==errorCode) + { + errorArgs={}; + var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorProperties["name"]; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=!errorMessage ? errorProperties["message"] : errorMessage; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=detailedErrorCode + } + return new OSF.DDA.AsyncResult(initArgs,errorArgs) + }, + _throwOnMethodCallForInsufficientPermission$i$0: function(requiredPermissionLevel, methodName) + { + if(this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel) + throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text,methodName)); + }, + _displayReplyForm$i$0: function(obj) + { + this._displayReplyFormHelper$p$0(obj,false) + }, + _displayReplyAllForm$i$0: function(obj) + { + this._displayReplyFormHelper$p$0(obj,true) + }, + _displayReplyFormHelper$p$0: function(obj, isReplyAll) + { + if(String.isInstanceOfType(obj)) + this._doDisplayReplyForm$p$0(obj,isReplyAll); + else if(Object.isInstanceOfType(obj) && Object.getTypeName(obj)==="Object") + { + var data=$h.ScriptHelpers.deepClone(obj); + this._doDisplayReplyFormWithAttachments$p$0(data,isReplyAll) + } + else + throw Error.argumentType(); + }, + _doDisplayReplyForm$p$0: function(htmlBody, isReplyAll) + { + if(!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody"); + this._invokeHostMethod$i$0(isReplyAll ? 11 : 10,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{htmlBody: htmlBody},null) + }, + _doDisplayReplyFormWithAttachments$p$0: function(data, isReplyAll) + { + var htmlBody=OSF.DDA.OutlookAppOm._getHtmlBody$p(data); + var attachments=OSF.DDA.OutlookAppOm._getAttachments$p(data); + var parameters=$h.CommonParameters.parse(OSF.DDA.OutlookAppOm._getOptionsAndCallback$p(data),false); + var $$t_6=this; + this._standardInvokeHostMethod$i$0(isReplyAll ? 31 : 30,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{ + htmlBody: htmlBody, + attachments: OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(attachments) + },function(rawInput) + { + return rawInput + },parameters._asyncContext$p$0,parameters._callback$p$0) + }, + _standardInvokeHostMethod$i$0: function(dispid, name, data, format, userContext, callback) + { + var $$t_C=this; + this._invokeHostMethod$i$0(dispid,name,data,function(resultCode, response) + { + if(callback) + { + var asyncResult=null; + if(Object.isInstanceOfType(response)) + { + var responseDictionary=response; + if("error" in responseDictionary || "data" in responseDictionary || "errorCode" in responseDictionary) + if(!responseDictionary["error"]) + { + var formattedData=format ? format(responseDictionary["data"]) : responseDictionary["data"]; + asyncResult=$$t_C.createAsyncResult(formattedData,0,0,userContext,null) + } + else + { + var errorCode=responseDictionary["errorCode"]; + asyncResult=$$t_C.createAsyncResult(null,1,errorCode,userContext,null) + } + } + if(!asyncResult && resultCode) + asyncResult=$$t_C.createAsyncResult(null,1,9002,userContext,null); + callback(asyncResult) + } + }) + }, + _invokeHostMethod$i$0: function(dispid, name, data, responseCallback) + { + if(64===this._officeAppContext$p$0.get_appName()) + this.get_clientEndPoint().invoke(name,responseCallback,data); + else if(dispid) + { + var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid,data); + var $$t_B=this; + OSF.ClientHostController.execute(dispid,executeParameters,function(nativeData, resultCode) + { + if(responseCallback) + { + var responseData=nativeData.toArray(); + var rawData=JSON.parse(responseData[0]); + if(Object.isInstanceOfType(rawData)) + { + var deserializedData=rawData; + if(responseData.length > 1 && responseData[1]) + { + deserializedData["error"]=true; + deserializedData["errorCode"]=responseData[1] + } + else + deserializedData["error"]=false; + responseCallback(resultCode,deserializedData) + } + else if(Number.isInstanceOfType(rawData)) + { + var returnDict={}; + returnDict["error"]=true; + returnDict["errorCode"]=rawData; + responseCallback(resultCode,returnDict) + } + else + throw Error.notImplemented("Return data type from host must be Dictionary or int"); + } + }) + } + else if(responseCallback) + responseCallback(-2,null) + }, + _dictionaryToDate$i$0: function(input) + { + var retValue=new Date(input["year"],input["month"],input["date"],input["hours"],input["minutes"],input["seconds"],!input["milliseconds"] ? 0 : input["milliseconds"]); + if(isNaN(retValue.getTime())) + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + return retValue + }, + _dateToDictionary$i$0: function(input) + { + var retValue={}; + retValue["month"]=input.getMonth(); + retValue["date"]=input.getDate(); + retValue["year"]=input.getFullYear(); + retValue["hours"]=input.getHours(); + retValue["minutes"]=input.getMinutes(); + retValue["seconds"]=input.getSeconds(); + retValue["milliseconds"]=input.getMilliseconds(); + return retValue + }, + _displayNewAppointmentFormApi$p$0: function(parameters) + { + var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["requiredAttendees"],"requiredAttendees"); + var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["optionalAttendees"],"optionalAttendees"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["location"],0,OSF.DDA.OutlookAppOm._maxLocationLength$p,"location"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["body"],0,OSF.DDA.OutlookAppOm.maxBodyLength,"body"); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["subject"],0,OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject"); + if(!$h.ScriptHelpers.isNullOrUndefined(parameters["start"])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["start"],Date,"start"); + var startDateTime=parameters["start"]; + parameters["start"]=startDateTime.getTime(); + if(!$h.ScriptHelpers.isNullOrUndefined(parameters["end"])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["end"],Date,"end"); + var endDateTime=parameters["end"]; + if(endDateTime < startDateTime) + throw Error.argumentOutOfRange("end",endDateTime,_u.ExtensibilityStrings.l_InvalidEventDates_Text); + parameters["end"]=endDateTime.getTime() + } + } + var updatedParameters=null; + if(normalizedRequiredAttendees || normalizedOptionalAttendees) + { + updatedParameters={}; + var $$dict_7=parameters; + for(var $$key_8 in $$dict_7) + { + var entry={ + key: $$key_8, + value: $$dict_7[$$key_8] + }; + updatedParameters[entry.key]=entry.value + } + if(normalizedRequiredAttendees) + updatedParameters["requiredAttendees"]=normalizedRequiredAttendees; + if(normalizedOptionalAttendees) + updatedParameters["optionalAttendees"]=normalizedOptionalAttendees + } + this._invokeHostMethod$i$0(7,"DisplayNewAppointmentForm",updatedParameters || parameters,null) + }, + _initializeMethods$p$0: function() + { + var currentInstance=this; + if($h.Item.isInstanceOfType(this._item$p$0)) + currentInstance.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0 + }, + _getInitialDataResponseHandler$p$0: function(resultCode, data) + { + if(resultCode) + return; + this.initialize(data); + this.displayName="mailbox"; + window.setTimeout(this.$$d__callAppReadyCallback$p$0,0) + }, + _callAppReadyCallback$p$0: function() + { + this._appReadyCallback$p$0() + }, + _invokeGetTokenMethodAsync$p$0: function(outlookDispid, methodName, callback, userContext) + { + if($h.ScriptHelpers.isNullOrUndefined(callback)) + throw Error.argumentNull("callback"); + var $$t_8=this; + this._invokeHostMethod$i$0(outlookDispid,methodName,null,function(resultCode, response) + { + var asyncResult; + if(resultCode) + asyncResult=$$t_8.createAsyncResult(null,1,9017,userContext,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode)); + else + { + var responseDictionary=response; + if(responseDictionary["wasSuccessful"]) + asyncResult=$$t_8.createAsyncResult(responseDictionary["token"],0,0,userContext,null); + else + asyncResult=$$t_8.createAsyncResult(null,1,responseDictionary["errorCode"],userContext,responseDictionary["errorMessage"]) + } + callback(asyncResult) + }) + }, + _getItem$p$0: function() + { + return this._item$p$0 + }, + _getUserProfile$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._userProfile$p$0 + }, + _getDiagnostics$p$0: function() + { + return this._diagnostics$p$0 + }, + _getEwsUrl$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._initialData$p$0.get__ewsUrl$i$0() + }, + _findOffset$p$0: function(value) + { + var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0(); + for(var r=0; r < ranges.length; r++) + { + var range=ranges[r]; + var start=parseInt(range["start"]); + var end=parseInt(range["end"]); + if(value.getTime() - start >=0 && value.getTime() - end < 0) + return parseInt(range["offset"]) + } + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + }, + _areStringsLoaded$p$0: function() + { + var stringsLoaded=false; + try + { + stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text) + } + catch($$e_1){} + return stringsLoaded + }, + _loadLocalizedScript$p$0: function(stringLoadedCallback) + { + var url=null; + var baseUrl=""; + var scripts=document.getElementsByTagName("script"); + for(var i=scripts.length - 1; i >=0; i--) + { + var filename=null; + var attributes=scripts[i].attributes; + if(attributes) + { + var attribute=attributes.getNamedItem("src"); + if(attribute) + filename=attribute.value; + if(filename) + { + var debug=false; + filename=filename.toLowerCase(); + var officeIndex=filename.indexOf("office_strings.js"); + if(officeIndex < 0) + { + officeIndex=filename.indexOf("office_strings.debug.js"); + debug=true + } + if(officeIndex > 0 && officeIndex < filename.length) + { + url=filename.replace(debug ? "office_strings.debug.js" : "office_strings.js","outlook_strings.js"); + var languageUrl=filename.substring(0,officeIndex); + var lastIndexOfSlash=languageUrl.lastIndexOf("/",languageUrl.length - 2); + if(lastIndexOfSlash===-1) + lastIndexOfSlash=languageUrl.lastIndexOf("\\",languageUrl.length - 2); + if(lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) + baseUrl=languageUrl.substring(0,lastIndexOfSlash+1); + break + } + } + } + } + if(url) + { + var head=document.getElementsByTagName("head")[0]; + var scriptElement=null; + var $$t_H=this; + var scriptElementCallback=function() + { + if(stringLoadedCallback && (!scriptElement.readyState || scriptElement.readyState && (scriptElement.readyState==="loaded" || scriptElement.readyState==="complete"))) + { + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + stringLoadedCallback() + } + }; + var $$t_I=this; + var failureCallback=function() + { + if(!$$t_I._areStringsLoaded$p$0()) + { + var fallbackUrl=baseUrl+"en-us/"+"outlook_strings.js"; + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + head.appendChild(scriptElement) + } + }; + scriptElement=this._createScriptElement$p$0(url); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + window.setTimeout(failureCallback,2e3); + head.appendChild(scriptElement) + } + }, + _createScriptElement$p$0: function(url) + { + var scriptElement=document.createElement("script"); + scriptElement.type="text/javascript"; + scriptElement.src=url; + return scriptElement + } + }; + OSF.DDA.Settings=function(data) + { + this._rawData$p$0=data + }; + OSF.DDA.Settings._convertFromRawSettings$p=function(rawSettings) + { + if(!rawSettings) + return{}; + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) + { + var outlookSettings=rawSettings["SettingsKey"]; + if(outlookSettings) + return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings) + } + return rawSettings + }; + OSF.DDA.Settings.prototype={ + _rawData$p$0: null, + _settingsData$p$0: null, + get__data$p$0: function() + { + if(!this._settingsData$p$0) + { + this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0); + this._rawData$p$0=null + } + return this._settingsData$p$0 + }, + get: function(name) + { + return this.get__data$p$0()[name] + }, + set: function(name, value) + { + this.get__data$p$0()[name]=value + }, + remove: function(name) + { + delete this.get__data$p$0()[name] + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4]=arguments[$$pai_4]; + var commonParameters=$h.CommonParameters.parse(args,false); + if(JSON.stringify(OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0())).length > 32768) + { + var asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,commonParameters._asyncContext$p$0,""); + var $$t_3=this; + window.setTimeout(function() + { + commonParameters._callback$p$0(asyncResult) + },0); + return + } + if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + this._saveSettingsForOwa$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0); + else + this._saveSettingsForOutlook$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0) + }, + _saveSettingsForOutlook$p$0: function(callback, userContext) + { + var storedException=null; + try + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var jsonSettings=JSON.stringify(serializedSettings); + var settingsObjectToSave={SettingsKey: jsonSettings}; + OSF.DDA.ClientSettingsManager.write(settingsObjectToSave) + } + catch(ex) + { + storedException=ex + } + if(callback) + { + var asyncResult; + if(storedException) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,userContext,storedException.message); + else + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,userContext,null); + callback(asyncResult) + } + }, + _saveSettingsForOwa$p$0: function(callback, userContext) + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var $$t_7=this; + OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(resultCode, response) + { + if(callback) + { + var asyncResult; + if(resultCode) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9017,userContext,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode)); + else + { + var responseDictionary=response; + if(!responseDictionary["error"]) + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,userContext,null); + else + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,userContext,responseDictionary["errorMessage"]) + } + callback(asyncResult) + } + },[serializedSettings]) + } + }; + Type.registerNamespace("$h"); + Type.registerNamespace("Office.cast"); + $h.Appointment=function(dataDictionary) + { + this.$$d__getOrganizer$p$2=Function.createDelegate(this,this._getOrganizer$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2); + this.$$d__getResources$p$2=Function.createDelegate(this,this._getResources$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2); + this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2); + $h.Appointment.initializeBase(this,[dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$2) + }; + $h.Appointment.prototype={ + getEntities: function() + { + return this._data$p$0._getEntities$i$0() + }, + getEntitiesByType: function(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, + getRegExMatches: function() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches"); + return this._data$p$0._getRegExMatches$i$0() + }, + getFilteredEntitiesByName: function(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, + getRegExMatchesByName: function(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName"); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, + displayReplyForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj) + }, + displayReplyAllForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj) + }, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, + _getStart$p$2: function() + { + return this._data$p$0.get__start$i$0() + }, + _getEnd$p$2: function() + { + return this._data$p$0.get__end$i$0() + }, + _getLocation$p$2: function() + { + return this._data$p$0.get__location$i$0() + }, + _getOptionalAttendees$p$2: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getRequiredAttendees$p$2: function() + { + return this._data$p$0.get__to$i$0() + }, + _getResources$p$2: function() + { + return this._data$p$0.get__resources$i$0() + }, + _getSubject$p$2: function() + { + return this._data$p$0.get__subject$i$0() + }, + _getNormalizedSubject$p$2: function() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, + _getOrganizer$p$2: function() + { + return this._data$p$0.get__organizer$i$0() + } + }; + $h.AppointmentCompose=function(data) + { + this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2); + $h.AppointmentCompose.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2) + }; + $h.AppointmentCompose.prototype={ + _requiredAttendees$p$2: null, + _optionalAttendees$p$2: null, + _start$p$2: null, + _end$p$2: null, + _location$p$2: null, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, + _getRequiredAttendees$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._requiredAttendees$p$2) + this._requiredAttendees$p$2=new $h.ComposeRecipient(0,"requiredAttendees"); + return this._requiredAttendees$p$2 + }, + _getOptionalAttendees$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._optionalAttendees$p$2) + this._optionalAttendees$p$2=new $h.ComposeRecipient(1,"optionalAttendees"); + return this._optionalAttendees$p$2 + }, + _getStart$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._start$p$2) + this._start$p$2=new $h.ComposeTime(1); + return this._start$p$2 + }, + _getEnd$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._end$p$2) + this._end$p$2=new $h.ComposeTime(2); + return this._end$p$2 + }, + _getLocation$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._location$p$2) + this._location$p$2=new $h.ComposeLocation; + return this._location$p$2 + } + }; + $h.AttachmentConstants=function(){}; + $h.AttachmentDetails=function(data) + { + this.$$d__getIsInline$p$0=Function.createDelegate(this,this._getIsInline$p$0); + this.$$d__getAttachmentType$p$0=Function.createDelegate(this,this._getAttachmentType$p$0); + this.$$d__getSize$p$0=Function.createDelegate(this,this._getSize$p$0); + this.$$d__getContentType$p$0=Function.createDelegate(this,this._getContentType$p$0); + this.$$d__getName$p$0=Function.createDelegate(this,this._getName$p$0); + this.$$d__getId$p$0=Function.createDelegate(this,this._getId$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"id",this.$$d__getId$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"name",this.$$d__getName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contentType",this.$$d__getContentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"size",this.$$d__getSize$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"attachmentType",this.$$d__getAttachmentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"isInline",this.$$d__getIsInline$p$0) + }; + $h.AttachmentDetails.prototype={ + _data$p$0: null, + _getId$p$0: function() + { + return this._data$p$0["id"] + }, + _getName$p$0: function() + { + return this._data$p$0["name"] + }, + _getContentType$p$0: function() + { + return this._data$p$0["contentType"] + }, + _getSize$p$0: function() + { + return this._data$p$0["size"] + }, + _getAttachmentType$p$0: function() + { + var response=this._data$p$0["attachmentType"]; + return response < $h.AttachmentDetails._attachmentTypeMap$p.length ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File + }, + _getIsInline$p$0: function() + { + return this._data$p$0["isInline"] + } + }; + $h.Body=function(){}; + $h.Body._tryMapToHostCoercionType$i=function(coercionType, hostCoercionType) + { + hostCoercionType.val=undefined; + if(coercionType===Microsoft.Office.WebExtension.CoercionType.Html) + hostCoercionType.val=3; + else if(coercionType===Microsoft.Office.WebExtension.CoercionType.Text) + hostCoercionType.val=0; + else + return false; + return true + }; + $h.Body.prototype={getAsync: function(coercionType) + { + var args=[]; + for(var $$pai_7=1; $$pai_7 < arguments.length;++$$pai_7) + args[$$pai_7 - 1]=arguments[$$pai_7]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getAsync"); + var commonParameters=$h.CommonParameters.parse(args,true); + var hostCoercionType; + var $$t_5, + $$t_6; + if(!($$t_6=$h.Body._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5.val,$$t_6)) + throw Error.argument("coercionType"); + var dataToHost={coercionType: hostCoercionType}; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(37,"GetBodyAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }}; + $h.ComposeBody=function() + { + $h.ComposeBody.initializeBase(this) + }; + $h.ComposeBody._createParameterDictionaryToHost$i=function(data, parameters) + { + var dataToHost={data: data}; + if(parameters._options$p$0 && !$h.ScriptHelpers.isNull(parameters._options$p$0["coercionType"])) + { + var hostCoercionType; + var $$t_4, + $$t_5; + if(!($$t_5=$h.Body._tryMapToHostCoercionType$i(parameters._options$p$0["coercionType"],$$t_4={val: hostCoercionType}),hostCoercionType=$$t_4.val,$$t_5)) + { + if(parameters._callback$p$0) + parameters._callback$p$0(OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,1e3,parameters._asyncContext$p$0,null)); + return null + } + dataToHost["coercionType"]=hostCoercionType + } + else + dataToHost["coercionType"]=0; + return dataToHost + }; + $h.ComposeBody.prototype={ + getTypeAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14,"GetBodyTypeAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setSelectedDataAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13,"BodySetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + prependAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23,"BodyPrependAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(38,"SetBodyAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeItem=function(data) + { + this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1); + $h.ComposeItem.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1) + }; + $h.ComposeItem.prototype={ + _subject$p$1: null, + _body$p$1: null, + addFileAttachmentAsync: function(uri, attachmentName) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(uri)) + throw Error.argument("uri"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + throw Error.argument("attachmentName"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(uri.length,0,2048,"uri"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName"); + var commonParameters=$h.CommonParameters.parse(args,false); + var parameters={ + uri: uri, + name: attachmentName, + __timeout__: 6e5 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16,"AddFileAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + addItemAttachmentAsync: function(itemId, attachmentName) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(itemId)) + throw Error.argument("itemId"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + throw Error.argument("attachmentName"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(itemId.length,0,200,"itemId"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName"); + var commonParameters=$h.CommonParameters.parse(args,false); + var parameters={ + itemId: itemId, + name: attachmentName, + __timeout__: 6e5 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19,"AddItemAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + removeAttachmentAsync: function(attachmentId) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync"); + if(!$h.ScriptHelpers.isNonEmptyString(attachmentId)) + throw Error.argument("attachmentId"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentId.length,0,200,"attachmentId"); + var commonParameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20,"RemoveAttachmentAsync",{attachmentIndex: attachmentId},null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + getSelectedDataAsync: function(coercionType) + { + var args=[]; + for(var $$pai_7=1; $$pai_7 < arguments.length;++$$pai_7) + args[$$pai_7 - 1]=arguments[$$pai_7]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync"); + var commonParameters=$h.CommonParameters.parse(args,true); + var hostCoercionType; + var $$t_5, + $$t_6; + if(coercionType !==Microsoft.Office.WebExtension.CoercionType.Html && coercionType !==Microsoft.Office.WebExtension.CoercionType.Text || !($$t_6=$h.Body._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5.val,$$t_6)) + throw Error.argument("coercionType"); + var dataToHost={coercionType: hostCoercionType}; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(28,"GetSelectedDataAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + setSelectedDataAsync: function(data) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync"); + var parameters=$h.CommonParameters.parse(args,false); + if(!String.isInstanceOfType(data)) + throw Error.argumentType("data",Object.getType(data),String); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data"); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters); + if(!dataToHost) + return; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(29,"SetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + close: function() + { + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(41,"Close",null,null,null,null) + }, + _getBody$p$1: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._body$p$1) + this._body$p$1=new $h.ComposeBody; + return this._body$p$1 + }, + _getSubject$p$1: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._subject$p$1) + this._subject$p$1=new $h.ComposeSubject; + return this._subject$p$1 + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"saveAsync"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(32,"SaveAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeRecipient=function(type, propertyName) + { + this._type$p$0=type; + this._propertyName$p$0=propertyName + }; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(displayName, emailAddress) + { + if(!displayName && !emailAddress) + throw Error.argument("recipients"); + if(displayName && displayName.length > 255) + throw Error.argumentOutOfRange("recipients",displayName.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text); + if(emailAddress && emailAddress.length > 571) + throw Error.argumentOutOfRange("recipients",emailAddress.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text); + }; + $h.ComposeRecipient._getAsyncFormatter$p=function(rawInput) + { + var input=rawInput; + var output=[]; + for(var i=0; i < input.length; i++) + { + var email=new $h.EmailAddressDetails(input[i]); + output[i]=email + } + return output + }; + $h.ComposeRecipient._createEmailDictionaryForHost$p=function(address, name) + { + return{ + address: address, + name: name + } + }; + $h.ComposeRecipient.prototype={ + _propertyName$p$0: null, + _type$p$0: 0, + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._propertyName$p$0+".getAsync"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15,"GetRecipientsAsync",{recipientField: this._type$p$0},$h.ComposeRecipient._getAsyncFormatter$p,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(recipients) + { + var args=[]; + for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2 - 1]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync"); + this.setAddHelper(recipients,args,true) + }, + addAsync: function(recipients) + { + var args=[]; + for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2 - 1]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync"); + this.setAddHelper(recipients,args,false) + }, + setAddHelper: function(recipients, args, isSet) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(recipients.length,0,100,"recipients"); + var parameters=$h.CommonParameters.parse(args,false); + var recipientData=[]; + if(Array.isInstanceOfType(recipients)) + for(var i=0; i < recipients.length; i++) + if(String.isInstanceOfType(recipients[i])) + { + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i],recipients[i]); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i],recipients[i]) + } + else if($h.EmailAddressDetails.isInstanceOfType(recipients[i])) + { + var address=recipients[i]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address.displayName,address.emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address.emailAddress,address.displayName) + } + else if(Object.isInstanceOfType(recipients[i])) + { + var input=recipients[i]; + var emailAddress=input["emailAddress"]; + var displayName=input["displayName"]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName,emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress,displayName) + } + else + throw Error.argument("recipients"); + else + throw Error.argument("recipients"); + var $$t_B=this; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(isSet ? 21 : 22,isSet ? "SetRecipientsAsync" : "AddRecipientsAsync",{ + recipientField: this._type$p$0, + recipientArray: recipientData + },function(rawInput) + { + return rawInput + },parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeRecipient.RecipientField=function(){}; + $h.ComposeRecipient.RecipientField.prototype={ + to: 0, + cc: 1, + bcc: 2, + requiredAttendees: 0, + optionalAttendees: 1 + }; + $h.ComposeRecipient.RecipientField.registerEnum("$h.ComposeRecipient.RecipientField",false); + $h.ComposeLocation=function(){}; + $h.ComposeLocation.prototype={ + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26,"GetLocationAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(location) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(location.length,0,255,"location"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27,"SetLocationAsync",{location: location},null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeSubject=function(){}; + $h.ComposeSubject.prototype={ + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18,"GetSubjectAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(data) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync"); + if(!String.isInstanceOfType(data)) + throw Error.argument("data"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,255,"data"); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17,"SetSubjectAsync",{subject: data},null,parameters._asyncContext$p$0,parameters._callback$p$0) + } + }; + $h.ComposeTime=function(type) + { + this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0); + this._timeType$p$0=type + }; + $h.ComposeTime.prototype={ + _timeType$p$0: 0, + getAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync"); + var parameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24,"GetTimeAsync",{TimeProperty: this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + setAsync: function(dateTime) + { + var args=[]; + for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3 - 1]=arguments[$$pai_3]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync"); + if(!Date.isInstanceOfType(dateTime)) + throw Error.argumentType("dateTime",Object.getType(dateTime),Date); + if(isNaN(dateTime.getTime())) + throw Error.argument("dateTime"); + if(dateTime.getTime() < -864e13 || dateTime.getTime() > 864e13) + throw Error.argumentOutOfRange("dateTime"); + var parameters=$h.CommonParameters.parse(args,false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25,"SetTimeAsync",{ + TimeProperty: this._timeType$p$0, + time: dateTime.getTime() + },null,parameters._asyncContext$p$0,parameters._callback$p$0) + }, + _ticksToDateFormatter$p$0: function(rawInput) + { + var ticks=rawInput; + return new Date(ticks) + }, + _getPropertyName$p$0: function() + { + return this._timeType$p$0===1 ? "start" : "end" + } + }; + $h.ComposeTime.TimeType=function(){}; + $h.ComposeTime.TimeType.prototype={ + start: 1, + end: 2 + }; + $h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",false); + $h.Contact=function(data) + { + this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0); + this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0); + this.$$d__getPersonName$p$0=Function.createDelegate(this,this._getPersonName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"personName",this.$$d__getPersonName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"businessName",this.$$d__getBusinessName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contactString",this.$$d__getContactString$p$0) + }; + $h.Contact.prototype={ + _data$p$0: null, + _phoneNumbers$p$0: null, + _getPersonName$p$0: function() + { + return this._data$p$0["PersonName"] + }, + _getBusinessName$p$0: function() + { + return this._data$p$0["BusinessName"] + }, + _getAddresses$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses") + }, + _getEmailAddresses$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses") + }, + _getUrls$p$0: function() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls") + }, + _getPhoneNumbers$p$0: function() + { + if(!this._phoneNumbers$p$0) + { + var $$t_1=this; + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",function(data) + { + return new $h.PhoneNumber(data) + }) + } + return this._phoneNumbers$p$0 + }, + _getContactString$p$0: function() + { + return this._data$p$0["ContactString"] + } + }; + $h.CustomProperties=function(data) + { + if($h.ScriptHelpers.isNullOrUndefined(data)) + throw Error.argumentNull("data"); + if(Array.isInstanceOfType(data)) + { + var customPropertiesArray=data; + if(customPropertiesArray.length > 0) + this._data$p$0=customPropertiesArray[0]; + else + throw Error.argument("data"); + } + else + this._data$p$0=data + }; + $h.CustomProperties.prototype={ + _data$p$0: null, + get: function(name) + { + var value=this._data$p$0[name]; + if(typeof value==="string") + { + var valueString=value; + if(valueString.length > 6 && valueString.startsWith("Date(") && valueString.endsWith(")")) + { + var ticksString=valueString.substring(5,valueString.length - 1); + var ticks=parseInt(ticksString); + if(!isNaN(ticks)) + { + var dateTimeValue=new Date(ticks); + if(dateTimeValue) + value=dateTimeValue + } + } + } + return value + }, + set: function(name, value) + { + if(OSF.OUtil.isDate(value)) + value="Date("+value.getTime()+")"; + this._data$p$0[name]=value + }, + remove: function(name) + { + delete this._data$p$0[name] + }, + saveAsync: function() + { + var args=[]; + for(var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4]=arguments[$$pai_4]; + var MaxCustomPropertiesLength=2500; + if(JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) + throw Error.argument(); + var parameters=$h.CommonParameters.parse(args,false,true); + var saveCustomProperties=new $h.SaveDictionaryRequest(parameters._callback$p$0,parameters._asyncContext$p$0); + saveCustomProperties._sendRequest$i$0(4,"SaveCustomProperties",{customProperties: this._data$p$0}) + } + }; + $h.Diagnostics=function(data, appName) + { + this.$$d__getOwaView$p$0=Function.createDelegate(this,this._getOwaView$p$0); + this.$$d__getHostVersion$p$0=Function.createDelegate(this,this._getHostVersion$p$0); + this.$$d__getHostName$p$0=Function.createDelegate(this,this._getHostName$p$0); + this._data$p$0=data; + this._appName$p$0=appName; + $h.InitialData._defineReadOnlyProperty$i(this,"hostName",this.$$d__getHostName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"hostVersion",this.$$d__getHostVersion$p$0); + if(64===this._appName$p$0) + $h.InitialData._defineReadOnlyProperty$i(this,"OWAView",this.$$d__getOwaView$p$0) + }; + $h.Diagnostics.prototype={ + _data$p$0: null, + _appName$p$0: 0, + _getHostName$p$0: function() + { + if(8===this._appName$p$0) + return"Outlook"; + else if(64===this._appName$p$0) + return"OutlookWebApp"; + return null + }, + _getHostVersion$p$0: function() + { + return this._data$p$0.get__hostVersion$i$0() + }, + _getOwaView$p$0: function() + { + return this._data$p$0.get__owaView$i$0() + } + }; + $h.EmailAddressDetails=function(data) + { + this.$$d__getRecipientType$p$0=Function.createDelegate(this,this._getRecipientType$p$0); + this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this,this._getAppointmentResponse$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0); + if($h.ScriptHelpers.dictionaryContainsKey(data,"appointmentResponse")) + $h.InitialData._defineReadOnlyProperty$i(this,"appointmentResponse",this.$$d__getAppointmentResponse$p$0); + if($h.ScriptHelpers.dictionaryContainsKey(data,"recipientType")) + $h.InitialData._defineReadOnlyProperty$i(this,"recipientType",this.$$d__getRecipientType$p$0) + }; + $h.EmailAddressDetails._createFromEmailUserDictionary$i=function(data) + { + var emailAddressDetailsDictionary={}; + var displayName=data["Name"]; + var emailAddress=data["UserId"]; + emailAddressDetailsDictionary["name"]=displayName || $h.EmailAddressDetails._emptyString$p; + emailAddressDetailsDictionary["address"]=emailAddress || $h.EmailAddressDetails._emptyString$p; + return new $h.EmailAddressDetails(emailAddressDetailsDictionary) + }; + $h.EmailAddressDetails.prototype={ + _data$p$0: null, + toJSON: function() + { + var result={}; + result["emailAddress"]=this._getEmailAddress$p$0(); + result["displayName"]=this._getDisplayName$p$0(); + if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"appointmentResponse")) + result["appointmentResponse"]=this._getAppointmentResponse$p$0(); + if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"recipientType")) + result["recipientType"]=this._getRecipientType$p$0(); + return result + }, + _getEmailAddress$p$0: function() + { + return this._data$p$0["address"] + }, + _getDisplayName$p$0: function() + { + return this._data$p$0["name"] + }, + _getAppointmentResponse$p$0: function() + { + var response=this._data$p$0["appointmentResponse"]; + return response < $h.EmailAddressDetails._responseTypeMap$p.length ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None + }, + _getRecipientType$p$0: function() + { + var response=this._data$p$0["recipientType"]; + return response < $h.EmailAddressDetails._recipientTypeMap$p.length ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other + } + }; + $h.Entities=function(data, filteredEntitiesData, timeSent, permissionLevel) + { + this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this,this._createMeetingSuggestion$p$0); + this.$$d__getParcelDeliveries$p$0=Function.createDelegate(this,this._getParcelDeliveries$p$0); + this.$$d__getFlightReservations$p$0=Function.createDelegate(this,this._getFlightReservations$p$0); + this.$$d__getContacts$p$0=Function.createDelegate(this,this._getContacts$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0); + this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this,this._getMeetingSuggestions$p$0); + this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this,this._getTaskSuggestions$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0); + this._data$p$0=data || {}; + this._filteredData$p$0=filteredEntitiesData || {}; + this._dateTimeSent$p$0=timeSent; + $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"taskSuggestions",this.$$d__getTaskSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"meetingSuggestions",this.$$d__getMeetingSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"contacts",this.$$d__getContacts$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"flightReservations",this.$$d__getFlightReservations$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"parcelDeliveries",this.$$d__getParcelDeliveries$p$0); + this._permissionLevel$p$0=permissionLevel + }; + $h.Entities._getExtractedObjects$i=function(T, data, name, creator, removeDuplicates, stringPropertyName) + { + var results=null; + var extractedObjects=data[name]; + if(!extractedObjects) + return new Array(0); + if(removeDuplicates) + extractedObjects=$h.Entities._removeDuplicate$p(Object,extractedObjects,$h.Entities._entityDictionaryEquals$p,stringPropertyName); + results=new Array(extractedObjects.length); + var count=0; + for(var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) + { + var extractedObject=$$arr_9[$$idx_B]; + if(creator) + results[count++]=creator(extractedObject); + else + results[count++]=extractedObject + } + return results + }; + $h.Entities._getExtractedStringProperty$i=function(data, name, removeDuplicate) + { + var extractedProperties=data[name]; + if(!extractedProperties) + return new Array(0); + if(removeDuplicate) + extractedProperties=$h.Entities._removeDuplicate$p(String,extractedProperties,$h.Entities._stringEquals$p,null); + return extractedProperties + }; + $h.Entities._createContact$p=function(data) + { + return new $h.Contact(data) + }; + $h.Entities._createTaskSuggestion$p=function(data) + { + return new $h.TaskSuggestion(data) + }; + $h.Entities._createPhoneNumber$p=function(data) + { + return new $h.PhoneNumber(data) + }; + $h.Entities._entityDictionaryEquals$p=function(dictionary1, dictionary2, entityPropertyIdentifier) + { + if(dictionary1===dictionary2) + return true; + if(!dictionary1 || !dictionary2) + return false; + if(dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) + return true; + return false + }; + $h.Entities._stringEquals$p=function(string1, string2, entityProperty) + { + return string1===string2 + }; + $h.Entities._removeDuplicate$p=function(T, array, entityEquals, entityPropertyIdentifier) + { + for(var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) + { + var removeMatch=false; + for(var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) + if(entityEquals(array[matchIndex1],array[matchIndex2],entityPropertyIdentifier)) + { + removeMatch=true; + break + } + if(removeMatch) + Array.removeAt(array,matchIndex1) + } + return array + }; + $h.Entities.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _filteredData$p$0: null, + _filteredEntitiesCache$p$0: null, + _permissionLevel$p$0: 0, + _taskSuggestions$p$0: null, + _meetingSuggestions$p$0: null, + _phoneNumbers$p$0: null, + _contacts$p$0: null, + _addresses$p$0: null, + _emailAddresses$p$0: null, + _urls$p$0: null, + _flightReservations$p$0: null, + _parcelDeliveries$p$0: null, + _getByType$i$0: function(entityType) + { + if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) + return this._getMeetingSuggestions$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) + return this._getTaskSuggestions$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) + return this._getAddresses$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) + return this._getPhoneNumbers$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) + return this._getEmailAddresses$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) + return this._getUrls$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) + return this._getContacts$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.FlightReservations) + return this._getFlightReservations$p$0(); + else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.ParcelDeliveries) + return this._getParcelDeliveries$p$0(); + return null + }, + _getFilteredEntitiesByName$i$0: function(name) + { + if(!this._filteredEntitiesCache$p$0) + this._filteredEntitiesCache$p$0={}; + if(!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0,name)) + { + var found=false; + for(var i=0; i < $h.Entities._allEntityKeys$p.length; i++) + { + var entityTypeKey=$h.Entities._allEntityKeys$p[i]; + var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey]; + if(!perEntityTypeDictionary) + continue; + if($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary,name)) + { + switch(entityTypeKey) + { + case"EmailAddresses": + case"Urls": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name); + break; + case"Addresses": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name,true); + break; + case"PhoneNumbers": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber,perEntityTypeDictionary,name,$h.Entities._createPhoneNumber$p,false,null); + break; + case"TaskSuggestions": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,perEntityTypeDictionary,name,$h.Entities._createTaskSuggestion$p,true,"TaskString"); + break; + case"MeetingSuggestions": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,perEntityTypeDictionary,name,this.$$d__createMeetingSuggestion$p$0,true,"MeetingString"); + break; + case"Contacts": + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact,perEntityTypeDictionary,name,$h.Entities._createContact$p,true,"ContactString"); + break + } + found=true; + break + } + } + if(!found) + this._filteredEntitiesCache$p$0[name]=null + } + return this._filteredEntitiesCache$p$0[name] + }, + _createMeetingSuggestion$p$0: function(data) + { + return new $h.MeetingSuggestion(data,this._dateTimeSent$p$0) + }, + _getAddresses$p$0: function() + { + if(!this._addresses$p$0) + this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses",true); + return this._addresses$p$0 + }, + _getEmailAddresses$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._emailAddresses$p$0) + this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses",false); + return this._emailAddresses$p$0 + }, + _getUrls$p$0: function() + { + if(!this._urls$p$0) + this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls",false); + return this._urls$p$0 + }, + _getPhoneNumbers$p$0: function() + { + if(!this._phoneNumbers$p$0) + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",$h.Entities._createPhoneNumber$p); + return this._phoneNumbers$p$0 + }, + _getTaskSuggestions$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._taskSuggestions$p$0) + this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,this._data$p$0,"TaskSuggestions",$h.Entities._createTaskSuggestion$p,true,"TaskString"); + return this._taskSuggestions$p$0 + }, + _getMeetingSuggestions$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._meetingSuggestions$p$0) + this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,this._data$p$0,"MeetingSuggestions",this.$$d__createMeetingSuggestion$p$0,true,"MeetingString"); + return this._meetingSuggestions$p$0 + }, + _getContacts$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._contacts$p$0) + this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact,this._data$p$0,"Contacts",$h.Entities._createContact$p,true,"ContactString"); + return this._contacts$p$0 + }, + _getParcelDeliveries$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._parcelDeliveries$p$0) + this._parcelDeliveries$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"ParcelDeliveries",null); + return this._parcelDeliveries$p$0 + }, + _getFlightReservations$p$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if(!this._flightReservations$p$0) + this._flightReservations$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"FlightReservations",null); + return this._flightReservations$p$0 + } + }; + $h.ReplyConstants=function(){}; + $h.AsyncConstants=function(){}; + Office.cast.item=function(){}; + Office.cast.item.toItemRead=function(item) + { + if($h.Item.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toItemCompose=function(item) + { + if($h.ComposeItem.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toMessage=function(item) + { + return Office.cast.item.toMessageRead(item) + }; + Office.cast.item.toMessageRead=function(item) + { + if($h.Message.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toMessageCompose=function(item) + { + if($h.MessageCompose.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toMeetingRequest=function(item) + { + if($h.MeetingRequest.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toAppointment=function(item) + { + return Office.cast.item.toAppointmentRead(item) + }; + Office.cast.item.toAppointmentRead=function(item) + { + if($h.Appointment.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + Office.cast.item.toAppointmentCompose=function(item) + { + if($h.AppointmentCompose.isInstanceOfType(item)) + return item; + throw Error.argumentType(); + }; + $h.Item=function(data) + { + this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1); + this.$$d__getAttachments$p$1=Function.createDelegate(this,this._getAttachments$p$1); + this.$$d__getItemClass$p$1=Function.createDelegate(this,this._getItemClass$p$1); + this.$$d__getItemId$p$1=Function.createDelegate(this,this._getItemId$p$1); + this.$$d__getDateTimeModified$p$1=Function.createDelegate(this,this._getDateTimeModified$p$1); + this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this,this._getDateTimeCreated$p$1); + $h.Item.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeCreated",this.$$d__getDateTimeCreated$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeModified",this.$$d__getDateTimeModified$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"itemId",this.$$d__getItemId$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"itemClass",this.$$d__getItemClass$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"attachments",this.$$d__getAttachments$p$1); + $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1) + }; + $h.Item.prototype={ + _body$p$1: null, + _getItemId$p$1: function() + { + return this._data$p$0.get__itemId$i$0() + }, + _getItemClass$p$1: function() + { + return this._data$p$0.get__itemClass$i$0() + }, + _getDateTimeCreated$p$1: function() + { + return this._data$p$0.get__dateTimeCreated$i$0() + }, + _getDateTimeModified$p$1: function() + { + return this._data$p$0.get__dateTimeModified$i$0() + }, + _getAttachments$p$1: function() + { + return this._data$p$0.get__attachments$i$0() + }, + _getBody$p$1: function() + { + if(!this._body$p$1) + this._body$p$1=new $h.Body; + return this._body$p$1 + } + }; + $h.ItemBase=function(data) + { + this.$$d__createCustomProperties$i$0=Function.createDelegate(this,this._createCustomProperties$i$0); + this.$$d__getNotificationMessages$p$0=Function.createDelegate(this,this._getNotificationMessages$p$0); + this.$$d_getItemType=Function.createDelegate(this,this.getItemType); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"itemType",this.$$d_getItemType); + $h.InitialData._defineReadOnlyProperty$i(this,"notificationMessages",this.$$d__getNotificationMessages$p$0) + }; + $h.ItemBase.prototype={ + _data$p$0: null, + _notificationMessages$p$0: null, + get_data: function() + { + return this._data$p$0 + }, + loadCustomPropertiesAsync: function() + { + var args=[]; + for(var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3) + args[$$pai_3]=arguments[$$pai_3]; + var parameters=$h.CommonParameters.parse(args,true,true); + var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0,"customProperties",parameters._callback$p$0,parameters._asyncContext$p$0); + loadCustomProperties._sendRequest$i$0(3,"LoadCustomProperties",{}) + }, + _createCustomProperties$i$0: function(data) + { + return new $h.CustomProperties(data) + }, + _getNotificationMessages$p$0: function() + { + if(!this._notificationMessages$p$0) + this._notificationMessages$p$0=new $h.NotificationMessages; + return this._notificationMessages$p$0 + } + }; + $h.MeetingRequest=function(data) + { + this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this,this._getRequiredAttendees$p$3); + this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this,this._getOptionalAttendees$p$3); + this.$$d__getLocation$p$3=Function.createDelegate(this,this._getLocation$p$3); + this.$$d__getEnd$p$3=Function.createDelegate(this,this._getEnd$p$3); + this.$$d__getStart$p$3=Function.createDelegate(this,this._getStart$p$3); + $h.MeetingRequest.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$3); + $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$3) + }; + $h.MeetingRequest.prototype={ + _getStart$p$3: function() + { + return this._data$p$0.get__start$i$0() + }, + _getEnd$p$3: function() + { + return this._data$p$0.get__end$i$0() + }, + _getLocation$p$3: function() + { + return this._data$p$0.get__location$i$0() + }, + _getOptionalAttendees$p$3: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getRequiredAttendees$p$3: function() + { + return this._data$p$0.get__to$i$0() + } + }; + $h.MeetingSuggestion=function(data, dateTimeSent) + { + this.$$d__getEndTime$p$0=Function.createDelegate(this,this._getEndTime$p$0); + this.$$d__getStartTime$p$0=Function.createDelegate(this,this._getStartTime$p$0); + this.$$d__getSubject$p$0=Function.createDelegate(this,this._getSubject$p$0); + this.$$d__getLocation$p$0=Function.createDelegate(this,this._getLocation$p$0); + this.$$d__getAttendees$p$0=Function.createDelegate(this,this._getAttendees$p$0); + this.$$d__getMeetingString$p$0=Function.createDelegate(this,this._getMeetingString$p$0); + this._data$p$0=data; + this._dateTimeSent$p$0=dateTimeSent; + $h.InitialData._defineReadOnlyProperty$i(this,"meetingString",this.$$d__getMeetingString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"attendees",this.$$d__getAttendees$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStartTime$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEndTime$p$0) + }; + $h.MeetingSuggestion.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _attendees$p$0: null, + _getMeetingString$p$0: function() + { + return this._data$p$0["MeetingString"] + }, + _getLocation$p$0: function() + { + return this._data$p$0["Location"] + }, + _getSubject$p$0: function() + { + return this._data$p$0["Subject"] + }, + _getStartTime$p$0: function() + { + var time=this._createDateTimeFromParameter$p$0("StartTime"); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0); + if(resolvedTime.getTime() !==time.getTime()) + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + return time + }, + _getEndTime$p$0: function() + { + var time=this._createDateTimeFromParameter$p$0("EndTime"); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0); + if(resolvedTime.getTime() !==time.getTime()) + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + return time + }, + _createDateTimeFromParameter$p$0: function(keyName) + { + var dateTimeString=this._data$p$0[keyName]; + if(!dateTimeString) + return null; + return new Date(dateTimeString) + }, + _getAttendees$p$0: function() + { + if(!this._attendees$p$0) + { + var $$t_1=this; + this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Attendees",function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._attendees$p$0 + } + }; + $h.MeetingSuggestionTimeDecoder=function(){}; + $h.MeetingSuggestionTimeDecoder.resolve=function(inTime, sentTime) + { + if(!sentTime) + return inTime; + try + { + var tod; + var outDate; + var extractedDate; + var sentDate=new Date(sentTime.getFullYear(),sentTime.getMonth(),sentTime.getDate(),0,0,0,0); + var $$t_7, + $$t_8, + $$t_9; + if(!($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime,$$t_7={val: extractedDate},$$t_8={val: tod}),extractedDate=$$t_7.val,tod=$$t_8.val,$$t_9)) + return inTime; + else + { + if($h._preciseDate.isInstanceOfType(extractedDate)) + outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate,extractedDate); + else if($h._relativeDate.isInstanceOfType(extractedDate)) + outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate,extractedDate); + else + outDate=sentDate; + if(isNaN(outDate.getTime())) + return sentTime; + outDate.setMilliseconds(outDate.getMilliseconds()+tod); + return outDate + } + } + catch($$e_6) + { + return sentTime + } + }; + $h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function(value) + { + return null===value || value===undefined + }; + $h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function(sentDate, precise) + { + var year=precise._year$i$1; + var month=!precise._month$i$1 ? sentDate.getMonth() : precise._month$i$1 - 1; + var day=precise._day$i$1; + if(!day) + return sentDate; + var candidate; + if($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + candidate=new Date(sentDate.getFullYear(),month,day); + if(candidate.getTime() < sentDate.getTime()) + candidate=new Date(sentDate.getFullYear()+1,month,day) + } + else + candidate=new Date(year < 50 ? 2e3+year : 1900+year,month,day); + if(candidate.getMonth() !==month) + return sentDate; + return candidate + }; + $h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function(sentDate, relative) + { + var date; + switch(relative._unit$i$1) + { + case 0: + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate()); + date.setDate(date.getDate()+relative._offset$i$1); + return date; + case 5: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate,relative._offset$i$1,relative._tag$i$1); + case 2: + var days=1; + switch(relative._modifier$i$1) + { + case 1: + break; + case 2: + days=16; + break; + default: + if(!relative._offset$i$1) + days=sentDate.getDate(); + break + } + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),days); + date.setMonth(date.getMonth()+relative._offset$i$1); + if(date.getTime() < sentDate.getTime()) + date.setDate(date.getDate()+sentDate.getDate() - 1); + return date; + case 1: + date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate()); + date.setDate(sentDate.getDate()+7 * relative._offset$i$1); + if(relative._modifier$i$1===1 || !relative._modifier$i$1) + { + date.setDate(date.getDate()+1 - date.getDay()); + if(date.getTime() < sentDate.getTime()) + return sentDate; + return date + } + else if(relative._modifier$i$1===2) + { + date.setDate(date.getDate()+5 - date.getDay()); + return date + } + break; + case 4: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate,relative); + case 3: + if(relative._offset$i$1 > 0) + return new Date(sentDate.getFullYear()+relative._offset$i$1,0,1); + break; + default: + break + } + return sentDate + }; + $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function(sentDate, offset, tag) + { + if(offset > -5 && offset < 5) + { + var dayOfWeek; + var days; + dayOfWeek=(tag+6) % 7+1; + days=7 * offset+(dayOfWeek - sentDate.getDay()); + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } + else + { + var days=(tag - sentDate.getDay()) % 7; + if(days < 0) + days+=7; + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } + }; + $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function(sentDate, relative) + { + var date; + var firstDay; + var newDate; + date=sentDate; + if(relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) + return sentDate; + var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12; + firstDay=new Date(date.getFullYear(),date.getMonth()+monthOffset,1); + if(relative._modifier$i$1===1) + if(relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay()) + return firstDay; + else + { + newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),firstDay.getDate()); + newDate.setDate(newDate.getDate()+(7+(1 - firstDay.getDay())) % 7); + if(firstDay.getDay() !==6 && firstDay.getDay() && firstDay.getDay() !==1) + newDate.setDate(newDate.getDate() - 7); + newDate.setDate(newDate.getDate()+7 * (relative._offset$i$1 - 1)); + if(newDate.getMonth()+1 !==relative._tag$i$1) + return sentDate; + return newDate + } + else + { + newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),$h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(),firstDay.getFullYear())); + var offset=1 - newDate.getDay(); + if(offset > 0) + offset=offset - 7; + newDate.setDate(newDate.getDate()+offset); + newDate.setDate(newDate.getDate()+7 * (1 - relative._offset$i$1)); + if(newDate.getMonth()+1 !==relative._tag$i$1) + if(firstDay.getDay() !==6 && firstDay.getDay()) + return firstDay; + else + return sentDate; + else + return newDate + } + }; + $h.MeetingSuggestionTimeDecoder._decode$p=function(inDate, date, time) + { + var DateValueMask=32767; + date.val=null; + time.val=0; + if(!inDate) + return false; + time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate); + var inDateAtMidnight=inDate.getTime() - time.val; + var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 864e5; + if(value < 0) + return false; + else if(value >=262144) + return false; + else + { + var type=value >> 15; + value=value & DateValueMask; + switch(type) + { + case 0: + return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value,date); + case 1: + return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value,date); + default: + return false + } + } + }; + $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function(value, date) + { + var c_SubTypeMask=7; + var c_MonthMask=15; + var c_DayMask=31; + var c_YearMask=127; + var year=null; + var month=0; + var day=0; + date.val=null; + var subType=value >> 12 & c_SubTypeMask; + if((subType & 4)===4) + { + year=value >> 5 & c_YearMask; + if((subType & 2)===2) + { + if((subType & 1)===1) + return false; + month=value >> 1 & c_MonthMask + } + } + else + { + if((subType & 2)===2) + month=value >> 8 & c_MonthMask; + if((subType & 1)===1) + day=value >> 3 & c_DayMask + } + date.val=new $h._preciseDate(day,month,year); + return true + }; + $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function(value, date) + { + var TagMask=15; + var OffsetMask=63; + var UnitMask=7; + var ModifierMask=3; + var tag=value & TagMask; + value >>=4; + var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask,6); + value >>=6; + var unit=value & UnitMask; + value >>=3; + var modifier=value & ModifierMask; + try + { + date.val=new $h._relativeDate(modifier,offset,unit,tag); + return true + } + catch($$e_A) + { + date.val=null; + return false + } + }; + $h.MeetingSuggestionTimeDecoder._fromComplement$p=function(value, n) + { + var signed=1 << n - 1; + var mask=(1 << n) - 1; + if((value & signed)===signed) + return-((value ^ mask)+1); + else + return value + }; + $h.MeetingSuggestionTimeDecoder._daysInMonth$p=function(month, year) + { + return 32 - new Date(year,month,32).getDate() + }; + $h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function(inputTime) + { + var timeOfDay=0; + timeOfDay+=inputTime.getUTCHours() * 3600; + timeOfDay+=inputTime.getUTCMinutes() * 60; + timeOfDay+=inputTime.getUTCSeconds(); + timeOfDay *=1e3; + timeOfDay+=inputTime.getUTCMilliseconds(); + return timeOfDay + }; + $h._extractedDate=function(){}; + $h._preciseDate=function(day, month, year) + { + $h._preciseDate.initializeBase(this); + if(day < 0 || day > 31) + throw Error.argumentOutOfRange("day"); + if(month < 0 || month > 12) + throw Error.argumentOutOfRange("month"); + this._day$i$1=day; + this._month$i$1=month; + if(!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + if(!month && day) + throw Error.argument("Invalid arguments"); + if(year < 0 || year > 2099) + throw Error.argumentOutOfRange("year"); + this._year$i$1=year % 100 + } + else if(!this._month$i$1 && !this._day$i$1) + throw Error.argument("Invalid datetime"); + }; + $h._preciseDate.prototype={ + _day$i$1: 0, + _month$i$1: 0, + _year$i$1: null + }; + $h._relativeDate=function(modifier, offset, unit, tag) + { + $h._relativeDate.initializeBase(this); + if(offset < -32 || offset > 31) + throw Error.argumentOutOfRange("offset"); + if(tag < 0 || tag > 15) + throw Error.argumentOutOfRange("tag"); + if(!unit && offset < 0) + throw Error.argument("unit & offset do not form a valid date"); + this._modifier$i$1=modifier; + this._offset$i$1=offset; + this._unit$i$1=unit; + this._tag$i$1=tag + }; + $h._relativeDate.prototype={ + _modifier$i$1: 0, + _offset$i$1: 0, + _unit$i$1: 0, + _tag$i$1: 0 + }; + $h.Message=function(dataDictionary) + { + this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2); + this.$$d__getInternetMessageId$p$2=Function.createDelegate(this,this._getInternetMessageId$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2); + this.$$d__getFrom$p$2=Function.createDelegate(this,this._getFrom$p$2); + this.$$d__getSender$p$2=Function.createDelegate(this,this._getSender$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2); + $h.Message.initializeBase(this,[dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"sender",this.$$d__getSender$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"from",this.$$d__getFrom$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"internetMessageId",this.$$d__getInternetMessageId$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2) + }; + $h.Message.prototype={ + getEntities: function() + { + return this._data$p$0._getEntities$i$0() + }, + getEntitiesByType: function(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, + getFilteredEntitiesByName: function(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, + getRegExMatches: function() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches"); + return this._data$p$0._getRegExMatches$i$0() + }, + getRegExMatchesByName: function(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName"); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, + displayReplyForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj) + }, + displayReplyAllForm: function(obj) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj) + }, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, + _getSubject$p$2: function() + { + return this._data$p$0.get__subject$i$0() + }, + _getNormalizedSubject$p$2: function() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, + _getSender$p$2: function() + { + return this._data$p$0.get__sender$i$0() + }, + _getFrom$p$2: function() + { + return this._data$p$0.get__from$i$0() + }, + _getTo$p$2: function() + { + return this._data$p$0.get__to$i$0() + }, + _getCc$p$2: function() + { + return this._data$p$0.get__cc$i$0() + }, + _getInternetMessageId$p$2: function() + { + return this._data$p$0.get__internetMessageId$i$0() + }, + _getConversationId$p$2: function() + { + return this._data$p$0.get__conversationId$i$0() + } + }; + $h.MessageCompose=function(data) + { + this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2); + this.$$d__getBcc$p$2=Function.createDelegate(this,this._getBcc$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2); + $h.MessageCompose.initializeBase(this,[data]); + $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"bcc",this.$$d__getBcc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2) + }; + $h.MessageCompose.prototype={ + _to$p$2: null, + _cc$p$2: null, + _bcc$p$2: null, + getItemType: function() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, + _getTo$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._to$p$2) + this._to$p$2=new $h.ComposeRecipient(0,"to"); + return this._to$p$2 + }, + _getCc$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._cc$p$2) + this._cc$p$2=new $h.ComposeRecipient(1,"cc"); + return this._cc$p$2 + }, + _getBcc$p$2: function() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if(!this._bcc$p$2) + this._bcc$p$2=new $h.ComposeRecipient(2,"bcc"); + return this._bcc$p$2 + }, + _getConversationId$p$2: function() + { + return this._data$p$0.get__conversationId$i$0() + } + }; + $h.NotificationMessages=function(){}; + $h.NotificationMessages._mapToHostItemNotificationMessageType$p=function(dataToHost) + { + var notificationType; + var hostItemNotificationMessageType; + notificationType=dataToHost["type"]; + if(notificationType===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.ProgressIndicator) + hostItemNotificationMessageType=1; + else if(notificationType===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.InformationalMessage) + hostItemNotificationMessageType=0; + else if(notificationType===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.ErrorMessage) + hostItemNotificationMessageType=2; + else + throw Error.argument("type"); + dataToHost["type"]=hostItemNotificationMessageType + }; + $h.NotificationMessages._validateKey$p=function(key) + { + if(!$h.ScriptHelpers.isNonEmptyString(key)) + throw Error.argument("key"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(key.length,0,32,"key") + }; + $h.NotificationMessages._validateDictionary$p=function(dictionary) + { + if(!$h.ScriptHelpers.isNonEmptyString(dictionary["type"])) + throw Error.argument("type"); + if(dictionary["type"]===Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.InformationalMessage) + { + if(!$h.ScriptHelpers.isNonEmptyString(dictionary["icon"])) + throw Error.argument("icon"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(dictionary["icon"].length,0,32,"icon"); + if($h.ScriptHelpers.isUndefined(dictionary["persistent"])) + throw Error.argument("persistent"); + if(!Boolean.isInstanceOfType(dictionary["persistent"])) + throw Error.argumentType("persistent",Object.getType(dictionary["persistent"]),Boolean); + } + else + { + if(!$h.ScriptHelpers.isUndefined(dictionary["icon"])) + throw Error.argument("icon"); + if(!$h.ScriptHelpers.isUndefined(dictionary["persistent"])) + throw Error.argument("persistent"); + } + if(!$h.ScriptHelpers.isNonEmptyString(dictionary["message"])) + throw Error.argument("message"); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(dictionary["message"].length,0,150,"message") + }; + $h.NotificationMessages.prototype={ + addAsync: function(key, dictionary) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.addAsync"); + var commonParameters=$h.CommonParameters.parse(args,false); + $h.NotificationMessages._validateKey$p(key); + $h.NotificationMessages._validateDictionary$p(dictionary); + var dataToHost={}; + dataToHost=$h.ScriptHelpers.deepClone(dictionary); + dataToHost["key"]=key; + $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(33,"AddNotificationMessageAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + getAllAsync: function() + { + var args=[]; + for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + args[$$pai_2]=arguments[$$pai_2]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.getAllAsync"); + var commonParameters=$h.CommonParameters.parse(args,true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(34,"GetAllNotificationMessagesAsync",null,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + replaceAsync: function(key, dictionary) + { + var args=[]; + for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + args[$$pai_5 - 2]=arguments[$$pai_5]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.replaceAsync"); + var commonParameters=$h.CommonParameters.parse(args,false); + $h.NotificationMessages._validateKey$p(key); + $h.NotificationMessages._validateDictionary$p(dictionary); + var dataToHost={}; + dataToHost=$h.ScriptHelpers.deepClone(dictionary); + dataToHost["key"]=key; + $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(35,"ReplaceNotificationMessageAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + }, + removeAsync: function(key) + { + var args=[]; + for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + args[$$pai_4 - 1]=arguments[$$pai_4]; + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.removeAsync"); + var commonParameters=$h.CommonParameters.parse(args,false); + $h.NotificationMessages._validateKey$p(key); + var dataToHost={key: key}; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(36,"RemoveNotificationMessageAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0) + } + }; + $h.OutlookErrorManager=function(){}; + $h.OutlookErrorManager.getErrorArgs=function(errorCode) + { + if(!$h.OutlookErrorManager._isInitialized$p) + $h.OutlookErrorManager._initialize$p(); + return OSF.DDA.ErrorCodeManager.getErrorArgs(errorCode) + }; + $h.OutlookErrorManager._initialize$p=function() + { + $h.OutlookErrorManager._addErrorMessage$p(9e3,"AttachmentSizeExceeded",_u.ExtensibilityStrings.l_AttachmentExceededSize_Text); + $h.OutlookErrorManager._addErrorMessage$p(9001,"NumberOfAttachmentsExceeded",_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text); + $h.OutlookErrorManager._addErrorMessage$p(9002,"InternalFormatError",_u.ExtensibilityStrings.l_InternalFormatError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9003,"InvalidAttachmentId",_u.ExtensibilityStrings.l_InvalidAttachmentId_Text); + $h.OutlookErrorManager._addErrorMessage$p(9004,"InvalidAttachmentPath",_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text); + $h.OutlookErrorManager._addErrorMessage$p(9005,"CannotAddAttachmentBeforeUpgrade",_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text); + $h.OutlookErrorManager._addErrorMessage$p(9006,"AttachmentDeletedBeforeUploadCompletes",_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text); + $h.OutlookErrorManager._addErrorMessage$p(9007,"AttachmentUploadGeneralFailure",_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9008,"AttachmentToDeleteDoesNotExist",_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text); + $h.OutlookErrorManager._addErrorMessage$p(9009,"AttachmentDeleteGeneralFailure",_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9010,"InvalidEndTime",_u.ExtensibilityStrings.l_InvalidEndTime_Text); + $h.OutlookErrorManager._addErrorMessage$p(9011,"HtmlSanitizationFailure",_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9012,"NumberOfRecipientsExceeded",String.format(_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text,500)); + $h.OutlookErrorManager._addErrorMessage$p(9013,"NoValidRecipientsProvided",_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text); + $h.OutlookErrorManager._addErrorMessage$p(9014,"CursorPositionChanged",_u.ExtensibilityStrings.l_CursorPositionChanged_Text); + $h.OutlookErrorManager._addErrorMessage$p(9016,"InvalidSelection",_u.ExtensibilityStrings.l_InvalidSelection_Text); + $h.OutlookErrorManager._addErrorMessage$p(9017,"AccessRestricted",""); + $h.OutlookErrorManager._addErrorMessage$p(9018,"GenericTokenError",""); + $h.OutlookErrorManager._addErrorMessage$p(9019,"GenericSettingsError",""); + $h.OutlookErrorManager._addErrorMessage$p(9020,"GenericResponseError",""); + $h.OutlookErrorManager._addErrorMessage$p(9021,"SaveError",_u.ExtensibilityStrings.l_SaveError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9022,"MessageInDifferentStoreError",_u.ExtensibilityStrings.l_MessageInDifferentStoreError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9023,"DuplicateNotificationKey",_u.ExtensibilityStrings.l_DuplicateNotificationKey_Text); + $h.OutlookErrorManager._addErrorMessage$p(9024,"NotificationKeyNotFound",_u.ExtensibilityStrings.l_NotificationKeyNotFound_Text); + $h.OutlookErrorManager._addErrorMessage$p(9025,"NumberOfNotificationsExceeded",_u.ExtensibilityStrings.l_NumberOfNotificationsExceeded_Text); + $h.OutlookErrorManager._isInitialized$p=true + }; + $h.OutlookErrorManager._addErrorMessage$p=function(errorCode, errorName, errorMessage) + { + OSF.DDA.ErrorCodeManager.addErrorMessage(errorCode,{ + name: errorName, + message: errorMessage + }) + }; + $h.OutlookErrorManager.OutlookErrorCodes=function(){}; + $h.OutlookErrorManager.OsfDdaErrorCodes=function(){}; + $h.PhoneNumber=function(data) + { + this.$$d__getPhoneType$p$0=Function.createDelegate(this,this._getPhoneType$p$0); + this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this,this._getOriginalPhoneString$p$0); + this.$$d__getPhoneString$p$0=Function.createDelegate(this,this._getPhoneString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"phoneString",this.$$d__getPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"originalPhoneString",this.$$d__getOriginalPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getPhoneType$p$0) + }; + $h.PhoneNumber.prototype={ + _data$p$0: null, + _getPhoneString$p$0: function() + { + return this._data$p$0["PhoneString"] + }, + _getOriginalPhoneString$p$0: function() + { + return this._data$p$0["OriginalPhoneString"] + }, + _getPhoneType$p$0: function() + { + return this._data$p$0["Type"] + } + }; + $h.TaskSuggestion=function(data) + { + this.$$d__getAssignees$p$0=Function.createDelegate(this,this._getAssignees$p$0); + this.$$d__getTaskString$p$0=Function.createDelegate(this,this._getTaskString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"taskString",this.$$d__getTaskString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"assignees",this.$$d__getAssignees$p$0) + }; + $h.TaskSuggestion.prototype={ + _data$p$0: null, + _assignees$p$0: null, + _getTaskString$p$0: function() + { + return this._data$p$0["TaskString"] + }, + _getAssignees$p$0: function() + { + if(!this._assignees$p$0) + { + var $$t_1=this; + this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Assignees",function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._assignees$p$0 + } + }; + $h.UserProfile=function(data) + { + this.$$d__getTimeZone$p$0=Function.createDelegate(this,this._getTimeZone$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this,"timeZone",this.$$d__getTimeZone$p$0) + }; + $h.UserProfile.prototype={ + _data$p$0: null, + _getDisplayName$p$0: function() + { + return this._data$p$0.get__userDisplayName$i$0() + }, + _getEmailAddress$p$0: function() + { + return this._data$p$0.get__userEmailAddress$i$0() + }, + _getTimeZone$p$0: function() + { + return this._data$p$0.get__userTimeZone$i$0() + } + }; + $h.RequestState=function(){}; + $h.RequestState.prototype={ + unsent: 0, + opened: 1, + headersReceived: 2, + loading: 3, + done: 4 + }; + $h.RequestState.registerEnum("$h.RequestState",false); + $h.CommonParameters=function(options, callback, asyncContext) + { + this._options$p$0=options; + this._callback$p$0=callback; + this._asyncContext$p$0=asyncContext + }; + $h.CommonParameters.parse=function(args, isCallbackRequired, tryLegacy) + { + var legacyParameters; + var $$t_8, + $$t_9; + if(tryLegacy && ($$t_9=$h.CommonParameters._tryParseLegacy$p(args,$$t_8={val: legacyParameters}),legacyParameters=$$t_8.val,$$t_9)) + return legacyParameters; + var argsLength=args.length; + var options=null; + var callback=null; + var asyncContext=null; + if(argsLength===1) + if(Function.isInstanceOfType(args[0])) + callback=args[0]; + else if(Object.isInstanceOfType(args[0])) + options=args[0]; + else + throw Error.argumentType(); + else if(argsLength===2) + { + if(!Object.isInstanceOfType(args[0])) + throw Error.argument("options"); + if(!Function.isInstanceOfType(args[1])) + throw Error.argument("callback"); + options=args[0]; + callback=args[1] + } + else if(argsLength) + throw Error.parameterCount(_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text); + if(isCallbackRequired && !callback) + throw Error.argumentNull("callback"); + if(options && !$h.ScriptHelpers.isNullOrUndefined(options["asyncContext"])) + asyncContext=options["asyncContext"]; + return new $h.CommonParameters(options,callback,asyncContext) + }; + $h.CommonParameters._tryParseLegacy$p=function(args, commonParameters) + { + commonParameters.val=null; + var argsLength=args.length; + var callback=null; + var userContext=null; + if(!argsLength || argsLength > 2) + return false; + if(!Function.isInstanceOfType(args[0])) + return false; + callback=args[0]; + if(argsLength > 1) + userContext=args[1]; + commonParameters.val=new $h.CommonParameters(null,callback,userContext); + return true + }; + $h.CommonParameters.prototype={ + _options$p$0: null, + _callback$p$0: null, + _asyncContext$p$0: null, + get_options: function() + { + return this._options$p$0 + }, + get_callback: function() + { + return this._callback$p$0 + }, + get_asyncContext: function() + { + return this._asyncContext$p$0 + } + }; + $h.EwsRequest=function(userContext) + { + $h.EwsRequest.initializeBase(this,[userContext]) + }; + $h.EwsRequest.prototype={ + readyState: 1, + status: 0, + statusText: null, + onreadystatechange: null, + responseText: null, + get__statusCode$i$1: function() + { + return this.status + }, + set__statusCode$i$1: function(value) + { + this.status=value; + return value + }, + get__statusDescription$i$1: function() + { + return this.statusText + }, + set__statusDescription$i$1: function(value) + { + this.statusText=value; + return value + }, + get__requestState$i$1: function() + { + return this.readyState + }, + set__requestState$i$1: function(value) + { + this.readyState=value; + return value + }, + get_hasOnReadyStateChangeCallback: function() + { + return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange) + }, + get__response$i$1: function() + { + return this.responseText + }, + set__response$i$1: function(value) + { + this.responseText=value; + return value + }, + send: function(data) + { + this._checkSendConditions$i$1(); + if($h.ScriptHelpers.isNullOrUndefined(data)) + this._throwInvalidStateException$i$1(); + this._sendRequest$i$0(5,"EwsRequest",{body: data}) + }, + _callOnReadyStateChangeCallback$i$1: function() + { + if(!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) + this.onreadystatechange() + }, + _parseExtraResponseData$i$1: function(response){}, + executeExtraFailedResponseSteps: function(){} + }; + $h.InitialData=function(data) + { + this._data$p$0=data; + this._permissionLevel$p$0=this._calculatePermissionLevel$p$0() + }; + $h.InitialData._defineReadOnlyProperty$i=function(o, methodName, getter) + { + var propertyDescriptor={ + get: getter, + configurable: false + }; + Object.defineProperty(o,methodName,propertyDescriptor) + }; + $h.InitialData.prototype={ + _toRecipients$p$0: null, + _ccRecipients$p$0: null, + _attachments$p$0: null, + _resources$p$0: null, + _entities$p$0: null, + _data$p$0: null, + _permissionLevel$p$0: 0, + get__itemId$i$0: function() + { + return this._data$p$0["id"] + }, + get__itemClass$i$0: function() + { + return this._data$p$0["itemClass"] + }, + get__dateTimeCreated$i$0: function() + { + return new Date(this._data$p$0["dateTimeCreated"]) + }, + get__dateTimeModified$i$0: function() + { + return new Date(this._data$p$0["dateTimeModified"]) + }, + get__dateTimeSent$i$0: function() + { + return new Date(this._data$p$0["dateTimeSent"]) + }, + get__subject$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0["subject"] + }, + get__normalizedSubject$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0["normalizedSubject"] + }, + get__internetMessageId$i$0: function() + { + return this._data$p$0["internetMessageId"] + }, + get__conversationId$i$0: function() + { + return this._data$p$0["conversationId"] + }, + get__sender$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var sender=this._data$p$0["sender"]; + return $h.ScriptHelpers.isNullOrUndefined(sender) ? null : new $h.EmailAddressDetails(sender) + }, + get__from$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var from=this._data$p$0["from"]; + return $h.ScriptHelpers.isNullOrUndefined(from) ? null : new $h.EmailAddressDetails(from) + }, + get__to$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._toRecipients$p$0) + this._toRecipients$p$0=this._createEmailAddressDetails$p$0("to"); + return this._toRecipients$p$0 + }, + get__cc$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._ccRecipients$p$0) + this._ccRecipients$p$0=this._createEmailAddressDetails$p$0("cc"); + return this._ccRecipients$p$0 + }, + get__attachments$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._attachments$p$0) + this._attachments$p$0=this._createAttachmentDetails$p$0(); + return this._attachments$p$0 + }, + get__ewsUrl$i$0: function() + { + return this._data$p$0["ewsUrl"] + }, + get__marketplaceAssetId$i$0: function() + { + return this._data$p$0["marketplaceAssetId"] + }, + get__extensionId$i$0: function() + { + return this._data$p$0["extensionId"] + }, + get__marketplaceContentMarket$i$0: function() + { + return this._data$p$0["marketplaceContentMarket"] + }, + get__consentMetadata$i$0: function() + { + return this._data$p$0["consentMetadata"] + }, + get__isRead$i$0: function() + { + return this._data$p$0["isRead"] + }, + get__endNodeUrl$i$0: function() + { + return this._data$p$0["endNodeUrl"] + }, + get__entryPointUrl$i$0: function() + { + return this._data$p$0["entryPointUrl"] + }, + get__start$i$0: function() + { + return new Date(this._data$p$0["start"]) + }, + get__end$i$0: function() + { + return new Date(this._data$p$0["end"]) + }, + get__location$i$0: function() + { + return this._data$p$0["location"] + }, + get__resources$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if(null===this._resources$p$0) + this._resources$p$0=this._createEmailAddressDetails$p$0("resources"); + return this._resources$p$0 + }, + get__organizer$i$0: function() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var organizer=this._data$p$0["organizer"]; + return $h.ScriptHelpers.isNullOrUndefined(organizer) ? null : new $h.EmailAddressDetails(organizer) + }, + get__userDisplayName$i$0: function() + { + return this._data$p$0["userDisplayName"] + }, + get__userEmailAddress$i$0: function() + { + return this._data$p$0["userEmailAddress"] + }, + get__userTimeZone$i$0: function() + { + return this._data$p$0["userTimeZone"] + }, + get__timeZoneOffsets$i$0: function() + { + return this._data$p$0["timeZoneOffsets"] + }, + get__hostVersion$i$0: function() + { + return this._data$p$0["hostVersion"] + }, + get__owaView$i$0: function() + { + return this._data$p$0["owaView"] + }, + get__overrideWindowOpen$i$0: function() + { + return this._data$p$0["overrideWindowOpen"] + }, + _getEntities$i$0: function() + { + if(!this._entities$p$0) + this._entities$p$0=new $h.Entities(this._data$p$0["entities"],this._data$p$0["filteredEntities"],this.get__dateTimeSent$i$0(),this._permissionLevel$p$0); + return this._entities$p$0 + }, + _getEntitiesByType$i$0: function(entityType) + { + var entites=this._getEntities$i$0(); + return entites._getByType$i$0(entityType) + }, + _getFilteredEntitiesByName$i$0: function(name) + { + var entities=this._getEntities$i$0(); + return entities._getFilteredEntitiesByName$i$0(name) + }, + _getRegExMatches$i$0: function() + { + if(!this._data$p$0["regExMatches"]) + return null; + return this._data$p$0["regExMatches"] + }, + _getRegExMatchesByName$i$0: function(regexName) + { + var regexMatches=this._getRegExMatches$i$0(); + if(!regexMatches || !regexMatches[regexName]) + return null; + return regexMatches[regexName] + }, + _throwOnRestrictedPermissionLevel$i$0: function() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0) + }, + _createEmailAddressDetails$p$0: function(key) + { + var to=this._data$p$0[key]; + if($h.ScriptHelpers.isNullOrUndefined(to)) + return[]; + var recipients=[]; + for(var i=0; i < to.length; i++) + if(!$h.ScriptHelpers.isNullOrUndefined(to[i])) + recipients[i]=new $h.EmailAddressDetails(to[i]); + return recipients + }, + _createAttachmentDetails$p$0: function() + { + var attachments=this._data$p$0["attachments"]; + if($h.ScriptHelpers.isNullOrUndefined(attachments)) + return[]; + var attachmentDetails=[]; + for(var i=0; i < attachments.length; i++) + if(!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) + attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]); + return attachmentDetails + }, + _calculatePermissionLevel$p$0: function() + { + var HostReadItem=1; + var HostReadWriteMailbox=2; + var HostReadWriteItem=3; + var permissionLevelFromHost=this._data$p$0["permissionLevel"]; + if($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0)) + return 0; + switch(permissionLevelFromHost) + { + case HostReadItem: + return 1; + case HostReadWriteItem: + return 2; + case HostReadWriteMailbox: + return 3; + default: + return 0 + } + } + }; + $h._loadDictionaryRequest=function(createResultObject, dictionaryName, callback, userContext) + { + $h._loadDictionaryRequest.initializeBase(this,[userContext]); + this._createResultObject$p$1=createResultObject; + this._dictionaryName$p$1=dictionaryName; + this._callback$p$1=callback + }; + $h._loadDictionaryRequest.prototype={ + _dictionaryName$p$1: null, + _createResultObject$p$1: null, + _callback$p$1: null, + handleResponse: function(response) + { + if(response["wasSuccessful"]) + { + var value=response[this._dictionaryName$p$1]; + var responseData=JSON.parse(value); + this.createAsyncResult(this._createResultObject$p$1(responseData),0,0,null) + } + else + this.createAsyncResult(null,1,9020,response["errorMessage"]); + this._callback$p$1(this._asyncResult$p$0) + } + }; + $h.ProxyRequestBase=function(userContext) + { + $h.ProxyRequestBase.initializeBase(this,[userContext]) + }; + $h.ProxyRequestBase.prototype={ + handleResponse: function(response) + { + if(!response["wasProxySuccessful"]) + { + this.set__statusCode$i$1(500); + this.set__statusDescription$i$1("Error"); + var errorMessage=response["errorMessage"]; + this.set__response$i$1(errorMessage); + this.createAsyncResult(null,1,9020,errorMessage) + } + else + { + this.set__statusCode$i$1(response["statusCode"]); + this.set__statusDescription$i$1(response["statusDescription"]); + this.set__response$i$1(response["body"]); + this.createAsyncResult(this.get__response$i$1(),0,0,null) + } + this._parseExtraResponseData$i$1(response); + this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() + }, + _throwInvalidStateException$i$1: function() + { + throw Error.create("DOMException",{ + code: 11, + message: "INVALID_STATE_ERR" + }); + }, + _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function() + { + var $$t_0=this; + this._changeReadyState$i$1(2,function() + { + $$t_0._changeReadyState$i$1(3,function() + { + $$t_0._changeReadyState$i$1(4,null) + }) + }) + }, + _changeReadyState$i$1: function(state, nextStep) + { + this.set__requestState$i$1(state); + var $$t_2=this; + window.setTimeout(function() + { + try + { + $$t_2._callOnReadyStateChangeCallback$i$1() + } + finally + { + if(!$h.ScriptHelpers.isNullOrUndefined(nextStep)) + nextStep() + } + },0) + }, + _checkSendConditions$i$1: function() + { + if(this.get__requestState$i$1() !==1) + this._throwInvalidStateException$i$1(); + if(this._isSent$p$0) + this._throwInvalidStateException$i$1() + } + }; + $h.RequestBase=function(userContext) + { + this._userContext$p$0=userContext + }; + $h.RequestBase.prototype={ + _isSent$p$0: false, + _asyncResult$p$0: null, + _userContext$p$0: null, + get_asyncResult: function() + { + return this._asyncResult$p$0 + }, + _sendRequest$i$0: function(dispid, methodName, dataToSend) + { + this._isSent$p$0=true; + var $$t_5=this; + OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid,methodName,dataToSend,function(resultCode, response) + { + if(resultCode) + $$t_5.createAsyncResult(null,1,9017,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode)); + else + $$t_5.handleResponse(response) + }) + }, + createAsyncResult: function(value, errorCode, detailedErrorCode, errorDescription) + { + this._asyncResult$p$0=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(value,errorCode,detailedErrorCode,this._userContext$p$0,errorDescription) + } + }; + $h.SaveDictionaryRequest=function(callback, userContext) + { + $h.SaveDictionaryRequest.initializeBase(this,[userContext]); + if(!$h.ScriptHelpers.isNullOrUndefined(callback)) + this._callback$p$1=callback + }; + $h.SaveDictionaryRequest.prototype={ + _callback$p$1: null, + handleResponse: function(response) + { + if(response["wasSuccessful"]) + this.createAsyncResult(null,0,0,null); + else + this.createAsyncResult(null,1,9020,response["errorMessage"]); + if(!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) + this._callback$p$1(this._asyncResult$p$0) + } + }; + $h.ScriptHelpers=function(){}; + $h.ScriptHelpers.isNull=function(value) + { + return null===value + }; + $h.ScriptHelpers.isNullOrUndefined=function(value) + { + return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value) + }; + $h.ScriptHelpers.isUndefined=function(value) + { + return value===undefined + }; + $h.ScriptHelpers.dictionaryContainsKey=function(obj, keyName) + { + return Object.isInstanceOfType(obj) ? keyName in obj : false + }; + $h.ScriptHelpers.isNonEmptyString=function(value) + { + if(!value) + return false; + return String.isInstanceOfType(value) + }; + $h.ScriptHelpers.deepClone=function(obj) + { + return JSON.parse(JSON.stringify(obj)) + }; + OSF.DDA.OutlookAppOm.registerClass("OSF.DDA.OutlookAppOm"); + OSF.DDA.Settings.registerClass("OSF.DDA.Settings"); + $h.ItemBase.registerClass("$h.ItemBase"); + $h.Item.registerClass("$h.Item",$h.ItemBase); + $h.Appointment.registerClass("$h.Appointment",$h.Item); + $h.ComposeItem.registerClass("$h.ComposeItem",$h.ItemBase); + $h.AppointmentCompose.registerClass("$h.AppointmentCompose",$h.ComposeItem); + $h.AttachmentConstants.registerClass("$h.AttachmentConstants"); + $h.AttachmentDetails.registerClass("$h.AttachmentDetails"); + $h.Body.registerClass("$h.Body"); + $h.ComposeBody.registerClass("$h.ComposeBody",$h.Body); + $h.ComposeRecipient.registerClass("$h.ComposeRecipient"); + $h.ComposeLocation.registerClass("$h.ComposeLocation"); + $h.ComposeSubject.registerClass("$h.ComposeSubject"); + $h.ComposeTime.registerClass("$h.ComposeTime"); + $h.Contact.registerClass("$h.Contact"); + $h.CustomProperties.registerClass("$h.CustomProperties"); + $h.Diagnostics.registerClass("$h.Diagnostics"); + $h.EmailAddressDetails.registerClass("$h.EmailAddressDetails"); + $h.Entities.registerClass("$h.Entities"); + $h.ReplyConstants.registerClass("$h.ReplyConstants"); + $h.AsyncConstants.registerClass("$h.AsyncConstants"); + Office.cast.item.registerClass("Office.cast.item"); + $h.Message.registerClass("$h.Message",$h.Item); + $h.MeetingRequest.registerClass("$h.MeetingRequest",$h.Message); + $h.MeetingSuggestion.registerClass("$h.MeetingSuggestion"); + $h.MeetingSuggestionTimeDecoder.registerClass("$h.MeetingSuggestionTimeDecoder"); + $h._extractedDate.registerClass("$h._extractedDate"); + $h._preciseDate.registerClass("$h._preciseDate",$h._extractedDate); + $h._relativeDate.registerClass("$h._relativeDate",$h._extractedDate); + $h.MessageCompose.registerClass("$h.MessageCompose",$h.ComposeItem); + $h.NotificationMessages.registerClass("$h.NotificationMessages"); + $h.OutlookErrorManager.registerClass("$h.OutlookErrorManager"); + $h.OutlookErrorManager.OutlookErrorCodes.registerClass("$h.OutlookErrorManager.OutlookErrorCodes"); + $h.OutlookErrorManager.OsfDdaErrorCodes.registerClass("$h.OutlookErrorManager.OsfDdaErrorCodes"); + $h.PhoneNumber.registerClass("$h.PhoneNumber"); + $h.TaskSuggestion.registerClass("$h.TaskSuggestion"); + $h.UserProfile.registerClass("$h.UserProfile"); + $h.CommonParameters.registerClass("$h.CommonParameters"); + $h.RequestBase.registerClass("$h.RequestBase"); + $h.ProxyRequestBase.registerClass("$h.ProxyRequestBase",$h.RequestBase); + $h.EwsRequest.registerClass("$h.EwsRequest",$h.ProxyRequestBase); + $h.InitialData.registerClass("$h.InitialData"); + $h._loadDictionaryRequest.registerClass("$h._loadDictionaryRequest",$h.RequestBase); + $h.SaveDictionaryRequest.registerClass("$h.SaveDictionaryRequest",$h.RequestBase); + $h.ScriptHelpers.registerClass("$h.ScriptHelpers"); + OSF.DDA.OutlookAppOm.asyncMethodTimeoutKeyName="__timeout__"; + OSF.DDA.OutlookAppOm._maxRecipients$p=100; + OSF.DDA.OutlookAppOm._maxSubjectLength$p=255; + OSF.DDA.OutlookAppOm.maxBodyLength=32768; + OSF.DDA.OutlookAppOm._maxLocationLength$p=255; + OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1e6; + OSF.DDA.OutlookAppOm._instance$p=null; + $h.AttachmentConstants.maxAttachmentNameLength=255; + $h.AttachmentConstants.maxUrlLength=2048; + $h.AttachmentConstants.maxItemIdLength=200; + $h.AttachmentConstants.maxRemoveIdLength=200; + $h.AttachmentConstants.attachmentParameterName="attachments"; + $h.AttachmentConstants.attachmentTypeParameterName="type"; + $h.AttachmentConstants.attachmentUrlParameterName="url"; + $h.AttachmentConstants.attachmentItemIdParameterName="itemId"; + $h.AttachmentConstants.attachmentNameParameterName="name"; + $h.AttachmentConstants.attachmentTypeFileName="file"; + $h.AttachmentConstants.attachmentTypeItemName="item"; + $h.AttachmentDetails._attachmentTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File,Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item,Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Cloud]; + $h.Body.coercionTypeParameterName="coercionType"; + $h.ComposeRecipient.displayNameLengthLimit=255; + $h.ComposeRecipient.maxSmtpLength=571; + $h.ComposeRecipient.recipientsLimit=100; + $h.ComposeRecipient.totalRecipientsLimit=500; + $h.ComposeRecipient.addressParameterName="address"; + $h.ComposeRecipient.nameParameterName="name"; + $h.ComposeLocation.locationKey="location"; + $h.ComposeLocation.maximumLocationLength=255; + $h.ComposeSubject.maximumSubjectLength=255; + $h.ComposeTime.timeTypeName="TimeProperty"; + $h.ComposeTime.timeDataName="time"; + $h.Diagnostics.outlookAppName="Outlook"; + $h.Diagnostics.outlookWebAppName="OutlookWebApp"; + $h.EmailAddressDetails._emptyString$p=""; + $h.EmailAddressDetails._responseTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined]; + $h.EmailAddressDetails._recipientTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser]; + $h.Entities._allEntityKeys$p=["Addresses","EmailAddresses","Urls","PhoneNumbers","TaskSuggestions","MeetingSuggestions","Contacts","FlightReservations","ParcelDeliveries"]; + $h.ReplyConstants.htmlBodyKeyName="htmlBody"; + $h.AsyncConstants.optionsKeyName="options"; + $h.AsyncConstants.callbackKeyName="callback"; + $h.AsyncConstants.asyncResultKeyName="asyncResult"; + $h.MeetingSuggestionTimeDecoder._baseDate$p=new Date("0001-01-01T00:00:00Z"); + $h.NotificationMessages.maximumKeyLength=32; + $h.NotificationMessages.maximumIconLength=32; + $h.NotificationMessages.maximumMessageLength=150; + $h.NotificationMessages.notificationsKeyParameterName="key"; + $h.NotificationMessages.notificationsTypeParameterName="type"; + $h.NotificationMessages.notificationsIconParameterName="icon"; + $h.NotificationMessages.notificationsMessageParameterName="message"; + $h.NotificationMessages.notificationsPersistentParameterName="persistent"; + $h.OutlookErrorManager.errorNameKey="name"; + $h.OutlookErrorManager.errorMessageKey="message"; + $h.OutlookErrorManager._isInitialized$p=false; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9e3; + $h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001; + $h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002; + $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003; + $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004; + $h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008; + $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009; + $h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010; + $h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011; + $h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012; + $h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013; + $h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014; + $h.OutlookErrorManager.OutlookErrorCodes.invalidSelection=9016; + $h.OutlookErrorManager.OutlookErrorCodes.accessRestricted=9017; + $h.OutlookErrorManager.OutlookErrorCodes.genericTokenError=9018; + $h.OutlookErrorManager.OutlookErrorCodes.genericSettingsError=9019; + $h.OutlookErrorManager.OutlookErrorCodes.genericResponseError=9020; + $h.OutlookErrorManager.OutlookErrorCodes.saveError=9021; + $h.OutlookErrorManager.OutlookErrorCodes.messageInDifferentStoreError=9022; + $h.OutlookErrorManager.OutlookErrorCodes.duplicateNotificationKey=9023; + $h.OutlookErrorManager.OutlookErrorCodes.notificationKeyNotFound=9024; + $h.OutlookErrorManager.OutlookErrorCodes.numberOfNotificationsExceeded=9025; + $h.OutlookErrorManager.OutlookErrorCodes.ooeInvalidDataFormat=2006; + $h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1e3; + $h.CommonParameters.asyncContextKeyName="asyncContext"; + $h.ScriptHelpers.emptyString=""; + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + if(appContext.get_appName()==OSF.AppName.OutlookWebApp || appContext.get_appName()==OSF.AppName.OutlookIOS) + this._settings=this._initializeSettings(appContext,false); + else + this._settings=this._initializeSettings(false); + appContext.appOM=new OSF.DDA.OutlookAppOm(appContext,this._webAppState.wnd,appReady) +} + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-win32-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-win32-16.00.js new file mode 100644 index 000000000..fea041536 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlook-win32-16.00.js @@ -0,0 +1,17 @@ +/* Outlook specific API library */ +/* Version: 16.0.6018.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/*! +Copyright (c) Microsoft Corporation. All rights reserved. +*/ +/*! +Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ +var __extends=this.__extends||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);function r(){this.constructor=n}r.prototype=t.prototype;n.prototype=new r},OfficeExt;(function(n){var t=function(){var i=null,n=!0;function t(){}t.prototype.isMsAjaxLoaded=function(){var t="function",i="undefined";return typeof Sys!==i&&typeof Type!==i&&Sys.StringBuilder&&typeof Sys.StringBuilder===t&&Type.registerNamespace&&typeof Type.registerNamespace===t&&Type.registerClass&&typeof Type.registerClass===t&&typeof Function._validateParams===t?n:!1};t.prototype.loadMsAjaxFull=function(n){var t=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(t,n)};Object.defineProperty(t.prototype,"msAjaxError",{get:function(){var n=this;n._msAjaxError==i&&n.isMsAjaxLoaded()&&(n._msAjaxError=Error);return n._msAjaxError},set:function(n){this._msAjaxError=n},enumerable:n,configurable:n});Object.defineProperty(t.prototype,"msAjaxSerializer",{get:function(){var n=this;n._msAjaxSerializer==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer);return n._msAjaxSerializer},set:function(n){this._msAjaxSerializer=n},enumerable:n,configurable:n});Object.defineProperty(t.prototype,"msAjaxString",{get:function(){var n=this;n._msAjaxString==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=String);return n._msAjaxString},set:function(n){this._msAjaxString=n},enumerable:n,configurable:n});Object.defineProperty(t.prototype,"msAjaxDebug",{get:function(){var n=this;n._msAjaxDebug==i&&n.isMsAjaxLoaded()&&(n._msAjaxDebug=Sys.Debug);return n._msAjaxDebug},set:function(n){this._msAjaxDebug=n},enumerable:n,configurable:n});return t}();n.MicrosoftAjaxFactory=t})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(n){var t=function(){function n(n){this._internalStorage=n}n.prototype.getItem=function(n){try{return this._internalStorage&&this._internalStorage.getItem(n)}catch(t){return null}};n.prototype.setItem=function(n,t){try{this._internalStorage&&this._internalStorage.setItem(n,t)}catch(i){}};n.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(n){}};n.prototype.removeItem=function(n){try{this._internalStorage&&this._internalStorage.removeItem(n)}catch(t){}};n.prototype.getKeysWithPrefix=function(n){var i=[];try{for(var u=this._internalStorage&&this._internalStorage.length||0,t=0;t1?s[s.length-1]:t,h=v();if(!r&&h){var e=window.name.indexOf(i);if(e>-1){var o=window.name.indexOf(";",e);o==-1&&(o=window.name.length);var c=window.name.substring(e,o);f?h.setItem(c,f):f=h.getItem(c)}}return f},getConversationId:function(){var i=window.location.search,n=t;if(i){var r=i.indexOf("&");n=r>0?i.substring(1,r):i.substr(1);if(n&&n.charAt(n.length-1)==="="){n=n.substring(0,n.length-1);n&&(n=decodeURIComponent(n))}}return n},getInfoItems:function(n){var t=n.split("$");typeof t[1]==c&&(t=n.split("|"));return t},getConversationUrl:function(){var t="",r=OSF.OUtil.parseXdmInfo(i);if(r){var n=OSF.OUtil.getInfoItems(r);n!=undefined&&n.length>=3&&(t=n[2])}return t},validateParamObject:function(t,r){var u=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:n},{name:"expectedProperties",type:Object,mayBeNull:n},{name:"callback",type:Function,mayBeNull:i}]);if(u)throw u;for(var f in r){u=Function._validateParameter(t[f],r[f],f);if(u)throw u;}},writeProfilerMark:function(n){if(window.msWriteProfilerMark){window.msWriteProfilerMark(n);OsfMsAjaxFactory.msAjaxDebug.trace(n)}},outputDebug:function(n){typeof Sys!==c&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(n)},defineNondefaultProperty:function(n,t,r,u){r=r||{};for(var e in u){var f=u[e];r[f]==undefined&&(r[f]=i)}Object.defineProperty(n,t,r);return n},defineNondefaultProperties:function(n,t,i){t=t||{};for(var r in t)OSF.OUtil.defineNondefaultProperty(n,r,t[r],i);return n},defineEnumerableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[f])},defineEnumerableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[f])},defineMutableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[b,f,p])},defineMutableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[b,f,p])},finalizeProperties:function(t,r){r=r||{};for(var o=Object.getOwnPropertyNames(t),s=o.length,f=0;f>8;f=e&255;i[t++]=r>>2;i[t++]=(r&3)<<4|u>>4;i[t++]=(u&15)<<2|f>>6;i[t++]=f&63;if(!isNaN(e)){r=e>>8;u=s&255;f=s>>8;i[t++]=r>>2;i[t++]=(r&3)<<4|u>>4;i[t++]=(u&15)<<2|f>>6;i[t++]=f&63}if(isNaN(e))i[t-1]=64;else if(isNaN(s)){i[t-2]=64;i[t-1]=64}for(var h=0;h0;t++){(t==8||t==12||t==16||t==20)&&(i+="-");i+=n[r%16];r=Math.floor(r/16)}for(;t<32;t++){(t==8||t==12||t==16||t==20)&&(i+="-");i+=n[Math.floor(Math.random()*16)]}return i}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y){var p=this;p._id=n;p._appName=t;p._appVersion=i;p._appUILocale=r;p._dataLocale=u;p._docUrl=f;p._clientMode=e;p._settings=o;p._reason=s;p._osfControlType=h;p._eToken=c;p._correlationId=l;p._appInstanceId=a;p._touchEnabled=v;p._commerceAllowed=y;p.get_id=function(){return this._id};p.get_appName=function(){return this._appName};p.get_appVersion=function(){return this._appVersion};p.get_appUILocale=function(){return this._appUILocale};p.get_dataLocale=function(){return this._dataLocale};p.get_docUrl=function(){return this._docUrl};p.get_clientMode=function(){return this._clientMode};p.get_bindings=function(){return this._bindings};p.get_settings=function(){return this._settings};p.get_reason=function(){return this._reason};p.get_osfControlType=function(){return this._osfControlType};p.get_eToken=function(){return this._eToken};p.get_correlationId=function(){return this._correlationId};p.get_appInstanceId=function(){return this._appInstanceId};p.get_touchEnabled=function(){return this._touchEnabled};p.get_commerceAllowed=function(){return this._commerceAllowed}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(n,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged?n+"_"+t:t};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var n={};return{getErrorArgs:function(t){return n[t]||n[this.errorCodes.ooeInternalError]},addErrorMessage:function(t,i){n[t]=i},errorCodes:{ooeSuccess:0,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(t){n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported}}}}();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var t,n=!1;return{enableShortcut:function(){if(!n){window.Office?t=window.Office:OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;n=!0}},disableShortcut:function(){if(n){t?window.Office=t:OSF.OUtil.unsetNamespace("Office",window);n=!1}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(n){n?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(n,t){var i;if(n&&typeof n=="string"){var r=n.indexOf("#");if(r!=-1){var o=n.substring(0,r),e=n.substring(r+1);switch(o){case"binding":case"bindings":e&&(i=new OSF.DDA.BindingPromise(e))}}}if(i){i.onFail=t;return i}else if(t){var u=typeof t;if(u=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=t;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,u);}};OSF.DDA.Context=function(n,t,i,r,u){var f=this;OSF.OUtil.defineEnumerableProperties(f,{contentLanguage:{value:n.get_dataLocale()},displayLanguage:{value:n.get_appUILocale()},touchEnabled:{value:n.get_touchEnabled()},commerceAllowed:{value:n.get_commerceAllowed()}});t&&OSF.OUtil.defineEnumerableProperty(f,"document",{value:t});i&&OSF.OUtil.defineEnumerableProperty(f,"license",{value:i});if(r){var e=r.displayName||"appOM";delete r.displayName;OSF.OUtil.defineEnumerableProperty(f,e,{value:r})}u&&OSF.OUtil.defineEnumerableProperty(f,"officeTheme",{get:function(){return u()}})};OSF.DDA.OutlookContext=function(n,t,i,r,u){OSF.DDA.OutlookContext.uber.constructor.call(this,n,null,i,r,u);t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(n,t){var i;switch(n.get_clientMode()){case OSF.ClientMode.ReadOnly:i=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:i=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t});OSF.OUtil.defineMutableProperties(this,{mode:{value:i},url:{value:n.get_docUrl()}})};OSF.DDA.JsomDocument=function(n,t,i){var r=this;OSF.DDA.JsomDocument.uber.constructor.call(r,n,i);t&&OSF.OUtil.defineEnumerableProperty(r,"bindings",{get:function(){return t}});var u=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(r,[u.GetSelectedDataAsync,u.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(r,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var n;OSF&&OSF._OfficeAppFactory&&(n=OSF._OfficeAppFactory.getContext());return n}});OSF.DDA.License=function(n){OSF.OUtil.defineEnumerableProperty(this,"value",{value:n})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(n){for(var t in n){var i={};OSF.OUtil.defineEnumerableProperties(i,{id:{value:t},displayName:{value:n[t]}});OSF.DDA.AsyncMethodNames[t]=i}};OSF.DDA.AsyncMethodCall=function(n,t,i,r,u,f,e){var c="function",o=n.length,s=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,e)});function h(n,t){for(var u in n){var i=n[u],r=t[u];if(i["enum"])switch(typeof r){case"string":if(OSF.OUtil.listContainsValue(i["enum"],r))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw s();}if(i.types&&!OSF.OUtil.listContainsValue(i.types,typeof r))throw s();}}function a(t,i,r){if(t.lengtho+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var f,l,v=n.length-1;v>=o;v--){var a=n[v];switch(typeof a){case"object":if(f)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else f=a;break;case c:if(l)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else l=a;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);}}f=f||{};for(var y in t)if(!OSF.OUtil.listContainsKey(f,y)){var e=undefined,s=t[y];s.calculate&&i&&(e=s.calculate(i,r,u));e||s.defaultValue===undefined||(e=s.defaultValue);f[y]=e}if(l)if(f[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else f[Microsoft.Office.WebExtension.Parameters.Callback]=l;h(t,f);return f}this.verifyAndExtractCall=function(n,t,r){var e=a(n,t,r),h=l(n,e,t,r),u={};for(var c in e)u[c]=e[c];for(var o in h)u[o]=h[o];for(var s in i)u[s]=i[s](t,r);f&&(u=f(u,t,r));return u};this.processResponse=function(n,t,i,f){var e;e=n==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?r?r(t,i,f):t:u?u(n,t):OSF.DDA.ErrorCodeManager.getErrorArgs(n);return e};this.getCallArgs=function(n){for(var t,u,r=n.length-1;r>=o;r--){var i=n[r];switch(typeof i){case"object":t=i;break;case c:u=i}}t=t||{};u&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=u);return t}};OSF.DDA.AsyncMethodCallFactory=function(){function n(n){var i=null;if(n){i={};for(var r=n.length,t=0;t0&&t.push(i)}}}catch(s){}return t}var i=[],n={};n[Microsoft.Office.WebExtension.Parameters.Data]=function(){var i=0,n=1;return{toHost:function(t){if(typeof t!="string"&&t[OSF.DDA.TableDataProperties.TableRows]!==undefined){var r=[];r[i]=t[OSF.DDA.TableDataProperties.TableRows];r[n]=t[OSF.DDA.TableDataProperties.TableHeaders];t=r}return t},fromHost:function(r){var f;if(r.toArray){var e=r.dimensions();if(e===2)f=t(r);else{var u=r.toArray();if(u.length===2&&(u[0]!=null&&u[0].toArray||u[1]!=null&&u[1].toArray)){f={};f[OSF.DDA.TableDataProperties.TableRows]=t(u[i]);f[OSF.DDA.TableDataProperties.TableHeaders]=t(u[n])}else f=u}}else f=r;return f}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,i,n);this.unpack=function(t,i){var r;if(this.isComplexType(t)||OSF.DDA.ListType.isListType(t)){var u=(i||typeof i=="unknown")&&i.toArray;r=u?i.toArray():i||{}}else r=this.isDynamicType(t)?n[t].fromHost(i):i;return r}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(n){function t(n){var i=n;if(OSF.OUtil.isArray(n))for(var f=i.length,r=0;r2){u=[];for(var f=1;f=3){u=n[0];f=n[2];t=Microsoft.Office.Common.XdmCommunicationManager.connect(u,window.parent,f)}}var i=null;if(t)try{t.invoke("getCustomizedScriptPathAsync",function(n,t){e(n===0?t:null)},{__timeout__:1e3})}catch(o){OsfMsAjaxFactory.msAjaxDebug.trace("no script override through cross frame communication.")}else{try{typeof window.external.getCustomizedScriptPath!="undefined"&&(i=window.external.getCustomizedScriptPath())}catch(o){OsfMsAjaxFactory.msAjaxDebug.trace("no script override through window.external.")}e(i)}};OSF._OfficeAppFactory.getLoadScriptHelper&&OSF._OfficeAppFactory.getLoadScriptHelper().waitForScripts([OSF.ConstantNames.MicrosoftAjaxId],n)})();Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(n){this._eventHandlers={};for(var i in n){var t=n[i];this._eventHandlers[t]=[]}};OSF.EventDispatch.prototype={getSupportedEvents:function(){var n=[];for(var t in this._eventHandlers)n.push(t);return n},supportsEvent:function(n){var t=!1;for(var i in this._eventHandlers)if(n==i){t=!0;break}return t},hasEventHandler:function(n,t){var i=this._eventHandlers[n];if(i&&i.length>0)for(var r in i)if(i[r]===t)return!0;return!1},addEventHandler:function(n,t){if(typeof t!="function")return!1;var i=this._eventHandlers[n];if(i&&!this.hasEventHandler(n,t)){i.push(t);return!0}else return!1},removeEventHandler:function(n,t){var i=this._eventHandlers[n];if(i&&i.length>0)for(var r=0;r0){this._eventHandlers[n]=[];return!0}return!1},getEventHandlerCount:function(n){return this._eventHandlers[n]!=undefined?this._eventHandlers[n].length:-1},fireEvent:function(n){if(n.type==undefined)return!1;var t=n.type;if(t&&this._eventHandlers[t]){var i=this._eventHandlers[t];for(var r in i)i[r](n);return!0}else return!1}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(n,t,i){var u=this,r;switch(n){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:r=new OSF.DDA.DocumentSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:r=new OSF.DDA.BindingSelectionChangedEventArgs(u.manufactureBinding(i,t.document),i[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:r=new OSF.DDA.BindingDataChangedEventArgs(u.manufactureBinding(i,t.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:r=new OSF.DDA.SettingsChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:r=new OSF.DDA.ActiveViewChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:r=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:r=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:r=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(i);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:r=new OSF.DDA.NodeInsertedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:r=new OSF.DDA.NodeReplacedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:r=new OSF.DDA.NodeDeletedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:r=new OSF.DDA.TaskSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:r=new OSF.DDA.ResourceSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:r=new OSF.DDA.ViewSelectionChangedEventArgs(t);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,n));}return r};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});var OfficeExt;(function(n){(function(t){var r=function(){var f="object",e="string",u=null;function r(){var t=this,n=t;t._pseudoDocument=u;t._eventDispatch=u;t._processAppCommandInvocation=function(t){var i=n._verifyManifestCallback(t.callbackName);if(i.errorCode!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){n._invokeAppCommandCompletedMethod(t.appCommandId,i.errorCode,"");return}var r=n._constructEventObjectForCallback(t);r?window.setTimeout(function(){i.callback(r)},0):n._invokeAppCommandCompletedMethod(t.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,"")}}r.initializeOsfDda=function(){OSF.DDA.AsyncMethodNames.addNames({AppCommandInvocationCompletedAsync:"appCommandInvocationCompletedAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[e]},{name:Microsoft.Office.WebExtension.Parameters.Status,types:["number"]},{name:Microsoft.Office.WebExtension.Parameters.Data,types:[e]}]});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{AppCommandInvokedEvent:"AppCommandInvokedEvent"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{AppCommandInvoked:"appCommandInvoked"});OSF.OUtil.setNamespace("AppCommand",OSF.DDA);OSF.DDA.AppCommand.AppCommandInvokedEventArgs=n.AppCommand.AppCommandInvokedEventArgs};r.prototype.initializeAndChangeOnce=function(n){var i=this;t.registerDdaFacade();i._pseudoDocument={};OSF.DDA.DispIdHost.addAsyncMethods(i._pseudoDocument,[OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync]);i._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.AppCommandInvoked]);var r=function(t){n&&(t.status=="succeeded"?n(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):n(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError))};OSF.DDA.DispIdHost.addEventSupport(i._pseudoDocument,i._eventDispatch);i._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked,i._processAppCommandInvocation,r)};r.prototype._verifyManifestCallback=function(n){var e={callback:u,errorCode:OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback};n=n.trim();try{for(var t=n.split("."),r=window,i=0;i40){n=OSF.OUtil.Guid.generateNewGuid();t.setValue(t.clientIDKey,n)}return n};n.prototype.saveLog=function(n,t){var r=this,i=r.getValue(r.logIdSetKey);i=(i&&i.length>0?i+";":"")+n;r.setValue(r.logIdSetKey,i);r.setValue(n,t)};n.prototype.enumerateLog=function(n,t){var i=this,f=i.getValue(i.logIdSetKey);if(f){var e=f.split(";");for(var o in e){var r=e[o],u=i.getValue(r);if(u){n&&n(r,u);t&&i.remove(r)}}t&&i.remove(i.logIdSetKey)}};n.prototype.getValue=function(n){var i=OSF.OUtil.getLocalStorage(),t="";i&&(t=i.getItem(n));return t};n.prototype.setValue=function(n,t){var i=OSF.OUtil.getLocalStorage();i&&i.setItem(n,t)};n.prototype.remove=function(n){var t=OSF.OUtil.getLocalStorage();if(t)try{t.removeItem(n)}catch(i){}};return n}(),f=function(){function n(){}n.prototype.LogData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n.SerializeRow(),OSF.Logger.SendFlag.none)};n.prototype.LogRawData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n,OSF.Logger.SendFlag.none)};return n}();function v(u){if(OSF.Logger&&!t){t=new y;t.hostVersion=u.get_appVersion();t.appId=u.get_id();t.host=u.get_appName();t.browser=window.navigator.userAgent;t.correlationId=u.get_correlationId();t.clientId=(new e).getClientId();var f=location.href.indexOf("?");t.appURL=f==-1?location.href:location.href.substring(0,f);(function(n,t){var f,u,r;t.assetId="";t.userId="";try{f=decodeURIComponent(n);u=new DOMParser;r=u.parseFromString(f,"text/xml");t.userId=r.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;t.assetId=r.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(e){}finally{f=i;r=i;u=i}})(u.get_eToken(),t);(function(){var c=new Date,u=i,o=0,h=!1,f=function(){if(document.hasFocus())u==i&&(u=new Date);else if(u){o+=Math.abs(+new Date-u.getTime());u=i}},t=[];t.push(new r("focus",f));t.push(new r("blur",f));t.push(new r("focusout",f));t.push(new r("focusin",f));var s=function(){for(var r=0;r6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){i=new Date(parseInt(t.slice(5,-1)));if(i)return i}return t}):Sys.Serialization.JavaScriptSerializer.deserialize(t,!0);r[i]=t}catch(u){}}return r}};OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(n,t,i){Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact",FlightReservations:"flightReservations",ParcelDeliveries:"parcelDeliveries"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item",Cloud:"cloud"};Microsoft.Office.WebExtension.MailboxEnums.BodyType={Text:"text",Html:"html"};Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType={ProgressIndicator:"progressIndicator",InformationalMessage:"informationalMessage",ErrorMessage:"errorMessage"};Microsoft.Office.WebExtension.CoercionType={Text:"text",Html:"html"};Type.registerNamespace("OSF.DDA");OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d_$2r_0=Function.createDelegate(this,this.$2r_0);this.$$d_$3E_0=Function.createDelegate(this,this.$3E_0);this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);this.$$d_$43_0=Function.createDelegate(this,this.$43_0);this.$$d_$41_0=Function.createDelegate(this,this.$41_0);this.$$d_$4W_0=Function.createDelegate(this,this.$4W_0);this.$$d_$4C_0=Function.createDelegate(this,this.$4C_0);this.$$d_$49_0=Function.createDelegate(this,this.$49_0);OSF.DDA.OutlookAppOm.$2=this;this.$W_0=n;this.$18_0=i;var u=this;var r=function(){i&&u.$C_0(1,"GetInitialData",null,u.$$d_$49_0)};this.$1u_0()?r():this.$4e_0(r)};OSF.DDA.OutlookAppOm.$G=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};OSF.DDA.OutlookAppOm.$9=function(n,t,i,r){if(ni)throw Error.argumentOutOfRange(r);};OSF.DDA.OutlookAppOm.$47=function(n){var t="";if("htmlBody"in n){OSF.DDA.OutlookAppOm.$4x(n.htmlBody);t=n.htmlBody}return t};OSF.DDA.OutlookAppOm.$2G=function(n){var t=[];if("attachments"in n){t=n.attachments;OSF.DDA.OutlookAppOm.$4v(t)}return t};OSF.DDA.OutlookAppOm.$4I=function(n){var t=[];"options"in n&&(t[0]=n.options);"callback"in n&&(t[t.length]=n.callback);return t};OSF.DDA.OutlookAppOm.$30=function(n){var r=new Array(0);if(Array.isInstanceOfType(n))for(var t=0;t2048)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text);OSF.DDA.OutlookAppOm.$2m(t)};OSF.DDA.OutlookAppOm.$4u=function(n,t){if(!String.isInstanceOfType(n)||!String.isInstanceOfType(t))throw Error.argument("attachments");if(n.length>200)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text);OSF.DDA.OutlookAppOm.$2m(t)};OSF.DDA.OutlookAppOm.$2m=function(n){if(n.length>255)throw Error.argumentOutOfRange("attachments",n.length,_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text);};OSF.DDA.OutlookAppOm.$T=function(n,t,i){if(Object.getType(n)!==t)throw Error.argumentType(i);};OSF.DDA.OutlookAppOm.$1s=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm.$T(n,String,r);var u=n;OSF.DDA.OutlookAppOm.$9(u.length,t,i,r)}};OSF.DDA.OutlookAppOm.$2x=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:case 14:case 18:case 26:case 32:case 41:case 34:break;case 4:var r=JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm.$1C(t.requiredAttendees),OSF.DDA.OutlookAppOm.$1C(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm.$1C(t.resources),t.subject,t.body];break;case 40:i=[t.extensionId,t.consentState];break;case 11:case 10:i=[t.htmlBody];break;case 31:case 30:i=[t.htmlBody,t.attachments];break;case 23:case 13:case 38:case 29:i=[t.data,t.coercionType];break;case 37:case 28:i=[t.coercionType];break;case 17:i=[t.subject];break;case 15:i=[t.recipientField];break;case 22:case 21:i=[t.recipientField,OSF.DDA.OutlookAppOm.$2v(t.recipientArray)];break;case 19:i=[t.itemId,t.name];break;case 16:i=[t.uri,t.name];break;case 20:i=[t.attachmentIndex];break;case 25:i=[t.TimeProperty,t.time];break;case 24:i=[t.TimeProperty];break;case 27:i=[t.location];break;case 33:case 35:i=[t.key,t.type,t.persistent,t.message,t.icon];break;case 36:i=[t.key];break;default:break}return i};OSF.DDA.OutlookAppOm.$1C=function(n){return n?n.join(";"):null};OSF.DDA.OutlookAppOm.$2v=function(n){if(!n)return null;for(var i=new Array(n.length),t=0;tOSF.DDA.OutlookAppOm.$2Z)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);this.$5_0(3,"makeEwsRequestAsync");var u=$h.CommonParameters.parse(r,!0,!0);var t=new $h.EwsRequest(u.$4_0);var f=this;t.onreadystatechange=function(){4===t.get_$1f_1()&&u.$3_0(t.$P_0)};t.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$C_0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$C_0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$C_0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this.$6_0&&this.$6_0.get_$1l_0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this.$27_0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this.$1G_0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this.$3D_0(n);if(this.$6_0&&this.$6_0.get_$1l_0()){var i=this.$27_0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},getUserIdentityTokenAsync:function(){for(var i=[],n=0;n1&&f[1]){i.error=!0;i.errorCode=f[1]}else i.error=!1;r(t,i)}else if(Number.isInstanceOfType(u)){var e={};e.error=!0;e.errorCode=u;r(t,e)}else throw Error.notImplemented("Return data type from host must be Dictionary or int");}})}else r&&r(-2,null)},$3D_0:function(n){var t=new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds?n.milliseconds:0);if(isNaN(t.getTime()))throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);return t},$1G_0:function(n){var t={};t.month=n.getMonth();t.date=n.getDate();t.year=n.getFullYear();t.hours=n.getHours();t.minutes=n.getMinutes();t.seconds=n.getSeconds();t.milliseconds=n.getMilliseconds();return t},$3E_0:function(n){var u=OSF.DDA.OutlookAppOm.$2n(n.requiredAttendees,"requiredAttendees");var r=OSF.DDA.OutlookAppOm.$2n(n.optionalAttendees,"optionalAttendees");OSF.DDA.OutlookAppOm.$1s(n.location,0,OSF.DDA.OutlookAppOm.$2a,"location");OSF.DDA.OutlookAppOm.$1s(n.body,0,OSF.DDA.OutlookAppOm.maxBodyLength,"body");OSF.DDA.OutlookAppOm.$1s(n.subject,0,OSF.DDA.OutlookAppOm.$2c,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){OSF.DDA.OutlookAppOm.$T(n.start,Date,"start");var o=n.start;n.start=o.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){OSF.DDA.OutlookAppOm.$T(n.end,Date,"end");var i=n.end;if(i=0&&n.getTime()-u<0)return parseInt(t.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},$1u_0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},$4e_0:function(n){for(var s=null,l="",a=document.getElementsByTagName("script"),o=a.length-1;o>=0;o--){var i=null;var v=a[o].attributes;if(v){var p=v.getNamedItem("src");p&&(i=p.value);if(i){var y=!1;i=i.toLowerCase();var f=i.indexOf("office_strings.js");if(f<0){f=i.indexOf("office_strings.debug.js");y=!0}if(f>0&&fu+1&&(l=r.substring(0,u+1));break}}}}if(s){var h=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var c=this;var w=function(){if(!c.$1u_0()){var n=l+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=c.$21_0(n);t.onload=e;t.onreadystatechange=e;h.appendChild(t)}};t=this.$21_0(s);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);h.appendChild(t)}},$21_0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};OSF.DDA.Settings=function(n){this.$v_0=n};OSF.DDA.Settings.$2w=function(n){if(!n)return{};if(OSF.DDA.OutlookAppOm.$2.get_$17_0()===8){var t=n.SettingsKey;if(t)return OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={$v_0:null,$y_0:null,get_$Q_0:function(){if(!this.$y_0){this.$y_0=OSF.DDA.Settings.$2w(this.$v_0);this.$v_0=null}return this.$y_0},get:function(n){return this.get_$Q_0()[n]},set:function(n,t){this.get_$Q_0()[n]=t},remove:function(n){delete this.get_$Q_0()[n]},saveAsync:function(){for(var i=[],t=0;t32768){var r=OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9019,n.$4_0,"");var u=this;window.setTimeout(function(){n.$3_0(r)},0);return}OSF.DDA.OutlookAppOm.$2.get_$17_0()===64?this.$4p_0(n.$3_0,n.$4_0):this.$4o_0(n.$3_0,n.$4_0)},$4o_0:function(n,t){var r=null;try{var f=OSF.DDA.SettingsManager.serializeSettings(this.get_$Q_0());var e=JSON.stringify(f);var u={SettingsKey:e};OSF.DDA.ClientSettingsManager.write(u)}catch(o){r=o}if(n){var i;i=r?OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9019,t,r.message):OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,0,0,t,null);n(i)}},$4p_0:function(n,t){var i=OSF.DDA.SettingsManager.serializeSettings(this.get_$Q_0());var r=this;OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(i,r){if(n){var u;if(i)u=OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9017,t,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,i));else{var f=r;u=f.error?OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,1,9019,t,f.errorMessage):OSF.DDA.OutlookAppOm.$2.createAsyncResult(null,0,0,t,null)}n(u)}},[i])}};Type.registerNamespace("$h");Type.registerNamespace("Office.cast");$h.Appointment=function(n){this.$$d_$4J_2=Function.createDelegate(this,this.$4J_2);this.$$d_$2O_2=Function.createDelegate(this,this.$2O_2);this.$$d_$o_2=Function.createDelegate(this,this.$o_2);this.$$d_$4P_2=Function.createDelegate(this,this.$4P_2);this.$$d_$1Z_2=Function.createDelegate(this,this.$1Z_2);this.$$d_$1W_2=Function.createDelegate(this,this.$1W_2);this.$$d_$n_2=Function.createDelegate(this,this.$n_2);this.$$d_$1U_2=Function.createDelegate(this,this.$1U_2);this.$$d_$1a_2=Function.createDelegate(this,this.$1a_2);$h.Appointment.initializeBase(this,[n]);$h.InitialData.$1(this,"start",this.$$d_$1a_2);$h.InitialData.$1(this,"end",this.$$d_$1U_2);$h.InitialData.$1(this,"location",this.$$d_$n_2);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1W_2);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_2);$h.InitialData.$1(this,"resources",this.$$d_$4P_2);$h.InitialData.$1(this,"subject",this.$$d_$o_2);$h.InitialData.$1(this,"normalizedSubject",this.$$d_$2O_2);$h.InitialData.$1(this,"organizer",this.$$d_$4J_2)};$h.Appointment.prototype={getEntities:function(){return this.$0_0.$m_0()},getEntitiesByType:function(n){return this.$0_0.$2L_0(n)},getRegExMatches:function(){OSF.DDA.OutlookAppOm.$2.$5_0(1,"getRegExMatches");return this.$0_0.$1Y_0()},getFilteredEntitiesByName:function(n){return this.$0_0.$1V_0(n)},getRegExMatchesByName:function(n){OSF.DDA.OutlookAppOm.$2.$5_0(1,"getRegExMatchesByName");return this.$0_0.$2S_0(n)},displayReplyForm:function(n){OSF.DDA.OutlookAppOm.$2.$24_0(n)},displayReplyAllForm:function(n){OSF.DDA.OutlookAppOm.$2.$23_0(n)},getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},$1a_2:function(){return this.$0_0.get_$2i_0()},$1U_2:function(){return this.$0_0.get_$26_0()},$n_2:function(){return this.$0_0.get_$2X_0()},$1W_2:function(){return this.$0_0.get_$1A_0()},$1Z_2:function(){return this.$0_0.get_$1m_0()},$4P_2:function(){return this.$0_0.get_$4n_0()},$o_2:function(){return this.$0_0.get_$2l_0()},$2O_2:function(){return this.$0_0.get_$2d_0()},$4J_2:function(){return this.$0_0.get_$4h_0()}};$h.AppointmentCompose=function(n){this.$$d_$n_2=Function.createDelegate(this,this.$n_2);this.$$d_$1U_2=Function.createDelegate(this,this.$1U_2);this.$$d_$1a_2=Function.createDelegate(this,this.$1a_2);this.$$d_$1W_2=Function.createDelegate(this,this.$1W_2);this.$$d_$1Z_2=Function.createDelegate(this,this.$1Z_2);$h.AppointmentCompose.initializeBase(this,[n]);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_2);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1W_2);$h.InitialData.$1(this,"start",this.$$d_$1a_2);$h.InitialData.$1(this,"end",this.$$d_$1U_2);$h.InitialData.$1(this,"location",this.$$d_$n_2)};$h.AppointmentCompose.prototype={$w_2:null,$t_2:null,$z_2:null,$j_2:null,$p_2:null,getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},$1Z_2:function(){this.$0_0.$A_0();this.$w_2||(this.$w_2=new $h.ComposeRecipient(0,"requiredAttendees"));return this.$w_2},$1W_2:function(){this.$0_0.$A_0();this.$t_2||(this.$t_2=new $h.ComposeRecipient(1,"optionalAttendees"));return this.$t_2},$1a_2:function(){this.$0_0.$A_0();this.$z_2||(this.$z_2=new $h.ComposeTime(1));return this.$z_2},$1U_2:function(){this.$0_0.$A_0();this.$j_2||(this.$j_2=new $h.ComposeTime(2));return this.$j_2},$n_2:function(){this.$0_0.$A_0();this.$p_2||(this.$p_2=new $h.ComposeLocation);return this.$p_2}};$h.AttachmentConstants=function(){};$h.AttachmentDetails=function(n){this.$$d_$4B_0=Function.createDelegate(this,this.$4B_0);this.$$d_$3s_0=Function.createDelegate(this,this.$3s_0);this.$$d_$4R_0=Function.createDelegate(this,this.$4R_0);this.$$d_$3y_0=Function.createDelegate(this,this.$3y_0);this.$$d_$4G_0=Function.createDelegate(this,this.$4G_0);this.$$d_$48_0=Function.createDelegate(this,this.$48_0);this.$0_0=n;$h.InitialData.$1(this,"id",this.$$d_$48_0);$h.InitialData.$1(this,"name",this.$$d_$4G_0);$h.InitialData.$1(this,"contentType",this.$$d_$3y_0);$h.InitialData.$1(this,"size",this.$$d_$4R_0);$h.InitialData.$1(this,"attachmentType",this.$$d_$3s_0);$h.InitialData.$1(this,"isInline",this.$$d_$4B_0)};$h.AttachmentDetails.prototype={$0_0:null,$48_0:function(){return this.$0_0.id},$4G_0:function(){return this.$0_0.name},$3y_0:function(){return this.$0_0.contentType},$4R_0:function(){return this.$0_0.size},$3s_0:function(){var n=this.$0_0.attachmentType;return n<$h.AttachmentDetails.$19.length?$h.AttachmentDetails.$19[n]:Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File},$4B_0:function(){return this.$0_0.isInline}};$h.Body=function(){};$h.Body.$1n=function(n,t){t.val=undefined;if(n===Microsoft.Office.WebExtension.CoercionType.Html)t.val=3;else if(n===Microsoft.Office.WebExtension.CoercionType.Text)t.val=0;else return!1;return!0};$h.Body.prototype={getAsync:function(n){for(var f=[],t=1;t255)throw Error.argumentOutOfRange("recipients",n.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text);if(t&&t.length>571)throw Error.argumentOutOfRange("recipients",t.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text);};$h.ComposeRecipient.$3r=function(n){for(var r=n,i=[],t=0;t864e13)throw Error.argumentOutOfRange("dateTime");var i=$h.CommonParameters.parse(r,!1);OSF.DDA.OutlookAppOm.$2.$8_0(25,"SetTimeAsync",{TimeProperty:this.$Y_0,time:n.getTime()},null,i.$4_0,i.$3_0)},$4y_0:function(n){var t=n;return new Date(t)},$2Q_0:function(){return this.$Y_0===1?"start":"end"}};$h.ComposeTime.TimeType=function(){};$h.ComposeTime.TimeType.prototype={start:1,end:2};$h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",!1);$h.Contact=function(n){this.$$d_$3x_0=Function.createDelegate(this,this.$3x_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$$d_$1b_0=Function.createDelegate(this,this.$1b_0);this.$$d_$1T_0=Function.createDelegate(this,this.$1T_0);this.$$d_$1X_0=Function.createDelegate(this,this.$1X_0);this.$$d_$3v_0=Function.createDelegate(this,this.$3v_0);this.$$d_$4M_0=Function.createDelegate(this,this.$4M_0);this.$0_0=n;$h.InitialData.$1(this,"personName",this.$$d_$4M_0);$h.InitialData.$1(this,"businessName",this.$$d_$3v_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$1X_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$1T_0);$h.InitialData.$1(this,"urls",this.$$d_$1b_0);$h.InitialData.$1(this,"addresses",this.$$d_$1Q_0);$h.InitialData.$1(this,"contactString",this.$$d_$3x_0)};$h.Contact.prototype={$0_0:null,$K_0:null,$4M_0:function(){return this.$0_0.PersonName},$3v_0:function(){return this.$0_0.BusinessName},$1Q_0:function(){return $h.Entities.$I(this.$0_0,"Addresses")},$1T_0:function(){return $h.Entities.$I(this.$0_0,"EmailAddresses")},$1b_0:function(){return $h.Entities.$I(this.$0_0,"Urls")},$1X_0:function(){if(!this.$K_0){var n=this;this.$K_0=$h.Entities.$E($h.PhoneNumber,this.$0_0,"PhoneNumbers",function(n){return new $h.PhoneNumber(n)})}return this.$K_0},$3x_0:function(){return this.$0_0.ContactString}};$h.CustomProperties=function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");if(Array.isInstanceOfType(n)){var t=n;if(t.length>0)this.$0_0=t[0];else throw Error.argument("data");}else this.$0_0=n};$h.CustomProperties.prototype={$0_0:null,get:function(n){var i=this.$0_0[n];if(typeof i=="string"){var t=i;if(t.length>6&&t.startsWith("Date(")&&t.endsWith(")")){var f=t.substring(5,t.length-1);var r=parseInt(f);if(!isNaN(r)){var u=new Date(r);u&&(i=u)}}}return i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")");this.$0_0[n]=t},remove:function(n){delete this.$0_0[n]},saveAsync:function(){for(var i=[],n=0;nu)throw Error.argument();var t=$h.CommonParameters.parse(i,!1,!0);var r=new $h.SaveDictionaryRequest(t.$3_0,t.$4_0);r.$1i_0(4,"SaveCustomProperties",{customProperties:this.$0_0})}};$h.Diagnostics=function(n,t){this.$$d_$4L_0=Function.createDelegate(this,this.$4L_0);this.$$d_$46_0=Function.createDelegate(this,this.$46_0);this.$$d_$45_0=Function.createDelegate(this,this.$45_0);this.$0_0=n;this.$U_0=t;$h.InitialData.$1(this,"hostName",this.$$d_$45_0);$h.InitialData.$1(this,"hostVersion",this.$$d_$46_0);64===this.$U_0&&$h.InitialData.$1(this,"OWAView",this.$$d_$4L_0)};$h.Diagnostics.prototype={$0_0:null,$U_0:0,$45_0:function(){if(8===this.$U_0)return"Outlook";else if(64===this.$U_0)return"OutlookWebApp";return null},$46_0:function(){return this.$0_0.get_$4X_0()},$4L_0:function(){return this.$0_0.get_$4j_0()}};$h.EmailAddressDetails=function(n){this.$$d_$2R_0=Function.createDelegate(this,this.$2R_0);this.$$d_$2F_0=Function.createDelegate(this,this.$2F_0);this.$$d_$1R_0=Function.createDelegate(this,this.$1R_0);this.$$d_$1S_0=Function.createDelegate(this,this.$1S_0);this.$0_0=n;$h.InitialData.$1(this,"emailAddress",this.$$d_$1S_0);$h.InitialData.$1(this,"displayName",this.$$d_$1R_0);$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData.$1(this,"appointmentResponse",this.$$d_$2F_0);$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData.$1(this,"recipientType",this.$$d_$2R_0)};$h.EmailAddressDetails.$1z=function(n){var t={};var r=n.Name;var i=n.UserId;t.name=r||$h.EmailAddressDetails.$1K;t.address=i||$h.EmailAddressDetails.$1K;return new $h.EmailAddressDetails(t)};$h.EmailAddressDetails.prototype={$0_0:null,toJSON:function(){var n={};n.emailAddress=this.$1S_0();n.displayName=this.$1R_0();$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"appointmentResponse")&&(n.appointmentResponse=this.$2F_0());$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"recipientType")&&(n.recipientType=this.$2R_0());return n},$1S_0:function(){return this.$0_0.address},$1R_0:function(){return this.$0_0.name},$2F_0:function(){var n=this.$0_0.appointmentResponse;return n<$h.EmailAddressDetails.$1h.length?$h.EmailAddressDetails.$1h[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},$2R_0:function(){var n=this.$0_0.recipientType;return n<$h.EmailAddressDetails.$1e.length?$h.EmailAddressDetails.$1e[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}};$h.Entities=function(n,t,i,r){this.$$d_$34_0=Function.createDelegate(this,this.$34_0);this.$$d_$2P_0=Function.createDelegate(this,this.$2P_0);this.$$d_$2M_0=Function.createDelegate(this,this.$2M_0);this.$$d_$2J_0=Function.createDelegate(this,this.$2J_0);this.$$d_$1X_0=Function.createDelegate(this,this.$1X_0);this.$$d_$1b_0=Function.createDelegate(this,this.$1b_0);this.$$d_$1T_0=Function.createDelegate(this,this.$1T_0);this.$$d_$2N_0=Function.createDelegate(this,this.$2N_0);this.$$d_$2T_0=Function.createDelegate(this,this.$2T_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$0_0=n||{};this.$1L_0=t||{};this.$N_0=i;$h.InitialData.$1(this,"addresses",this.$$d_$1Q_0);$h.InitialData.$1(this,"taskSuggestions",this.$$d_$2T_0);$h.InitialData.$1(this,"meetingSuggestions",this.$$d_$2N_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$1T_0);$h.InitialData.$1(this,"urls",this.$$d_$1b_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$1X_0);$h.InitialData.$1(this,"contacts",this.$$d_$2J_0);$h.InitialData.$1(this,"flightReservations",this.$$d_$2M_0);$h.InitialData.$1(this,"parcelDeliveries",this.$$d_$2P_0);this.$B_0=r};$h.Entities.$E=function(n,t,i,r,u,f){var o=null;var e=t[i];if(!e)return new Array(0);u&&(e=$h.Entities.$2e(Object,e,$h.Entities.$3I,f));o=new Array(e.length);for(var c=0,l=e,a=l.length,s=0;s=0;u--){for(var e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t};$h.Entities.prototype={$N_0:null,$0_0:null,$1L_0:null,$F_0:null,$B_0:0,$11_0:null,$q_0:null,$K_0:null,$g_0:null,$Z_0:null,$i_0:null,$15_0:null,$l_0:null,$u_0:null,$3w_0:function(n){if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)return this.$2N_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)return this.$2T_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)return this.$1Q_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)return this.$1X_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)return this.$1T_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)return this.$1b_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)return this.$2J_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.FlightReservations)return this.$2M_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.ParcelDeliveries)return this.$2P_0();return null},$1V_0:function(n){this.$F_0||(this.$F_0={});if(!$h.ScriptHelpers.dictionaryContainsKey(this.$F_0,n)){for(var r=!1,i=0;i<$h.Entities.$16.length;i++){var u=$h.Entities.$16[i];var t=this.$1L_0[u];if(t&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this.$F_0[n]=$h.Entities.$I(t,n);break;case"Addresses":this.$F_0[n]=$h.Entities.$I(t,n,!0);break;case"PhoneNumbers":this.$F_0[n]=$h.Entities.$E($h.PhoneNumber,t,n,$h.Entities.$20,!1,null);break;case"TaskSuggestions":this.$F_0[n]=$h.Entities.$E($h.TaskSuggestion,t,n,$h.Entities.$22,!0,"TaskString");break;case"MeetingSuggestions":this.$F_0[n]=$h.Entities.$E($h.MeetingSuggestion,t,n,this.$$d_$34_0,!0,"MeetingString");break;case"Contacts":this.$F_0[n]=$h.Entities.$E($h.Contact,t,n,$h.Entities.$1x,!0,"ContactString");break}r=!0;break}}r||(this.$F_0[n]=null)}return this.$F_0[n]},$34_0:function(n){return new $h.MeetingSuggestion(n,this.$N_0)},$1Q_0:function(){this.$Z_0||(this.$Z_0=$h.Entities.$I(this.$0_0,"Addresses",!0));return this.$Z_0},$1T_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$i_0||(this.$i_0=$h.Entities.$I(this.$0_0,"EmailAddresses",!1));return this.$i_0},$1b_0:function(){this.$15_0||(this.$15_0=$h.Entities.$I(this.$0_0,"Urls",!1));return this.$15_0},$1X_0:function(){this.$K_0||(this.$K_0=$h.Entities.$E($h.PhoneNumber,this.$0_0,"PhoneNumbers",$h.Entities.$20));return this.$K_0},$2T_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$11_0||(this.$11_0=$h.Entities.$E($h.TaskSuggestion,this.$0_0,"TaskSuggestions",$h.Entities.$22,!0,"TaskString"));return this.$11_0},$2N_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$q_0||(this.$q_0=$h.Entities.$E($h.MeetingSuggestion,this.$0_0,"MeetingSuggestions",this.$$d_$34_0,!0,"MeetingString"));return this.$q_0},$2J_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$g_0||(this.$g_0=$h.Entities.$E($h.Contact,this.$0_0,"Contacts",$h.Entities.$1x,!0,"ContactString"));return this.$g_0},$2P_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$u_0||(this.$u_0=$h.Entities.$E(Object,this.$0_0,"ParcelDeliveries",null));return this.$u_0},$2M_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0);this.$l_0||(this.$l_0=$h.Entities.$E(Object,this.$0_0,"FlightReservations",null));return this.$l_0}};$h.ReplyConstants=function(){};$h.AsyncConstants=function(){};Office.cast.item=function(){};Office.cast.item.toItemRead=function(n){if($h.Item.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toItemCompose=function(n){if($h.ComposeItem.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessage=function(n){return Office.cast.item.toMessageRead(n)};Office.cast.item.toMessageRead=function(n){if($h.Message.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessageCompose=function(n){if($h.MessageCompose.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMeetingRequest=function(n){if($h.MeetingRequest.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointment=function(n){return Office.cast.item.toAppointmentRead(n)};Office.cast.item.toAppointmentRead=function(n){if($h.Appointment.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointmentCompose=function(n){if($h.AppointmentCompose.isInstanceOfType(n))return n;throw Error.argumentType();};$h.Item=function(n){this.$$d_$2H_1=Function.createDelegate(this,this.$2H_1);this.$$d_$2G_1=Function.createDelegate(this,this.$2G_1);this.$$d_$4D_1=Function.createDelegate(this,this.$4D_1);this.$$d_$4E_1=Function.createDelegate(this,this.$4E_1);this.$$d_$40_1=Function.createDelegate(this,this.$40_1);this.$$d_$3z_1=Function.createDelegate(this,this.$3z_1);$h.Item.initializeBase(this,[n]);$h.InitialData.$1(this,"dateTimeCreated",this.$$d_$3z_1);$h.InitialData.$1(this,"dateTimeModified",this.$$d_$40_1);$h.InitialData.$1(this,"itemId",this.$$d_$4E_1);$h.InitialData.$1(this,"itemClass",this.$$d_$4D_1);$h.InitialData.$1(this,"attachments",this.$$d_$2G_1);$h.InitialData.$1(this,"body",this.$$d_$2H_1)};$h.Item.prototype={$H_1:null,$4E_1:function(){return this.$0_0.get_$4d_0()},$4D_1:function(){return this.$0_0.get_$4c_0()},$3z_1:function(){return this.$0_0.get_$36_0()},$40_1:function(){return this.$0_0.get_$37_0()},$2G_1:function(){return this.$0_0.get_$2p_0()},$2H_1:function(){this.$H_1||(this.$H_1=new $h.Body);return this.$H_1}};$h.ItemBase=function(n){this.$$d_$31_0=Function.createDelegate(this,this.$31_0);this.$$d_$4H_0=Function.createDelegate(this,this.$4H_0);this.$$d_getItemType=Function.createDelegate(this,this.getItemType);this.$0_0=n;$h.InitialData.$1(this,"itemType",this.$$d_getItemType);$h.InitialData.$1(this,"notificationMessages",this.$$d_$4H_0)};$h.ItemBase.prototype={$0_0:null,$s_0:null,get_data:function(){return this.$0_0},loadCustomPropertiesAsync:function(){for(var i=[],n=0;n0)return new Date(n.getFullYear()+t.$D_1,0,1);break;default:break}return n};$h.MeetingSuggestionTimeDecoder.$3M=function(n,t,i){if(t>-5&&t<5){var u;var f;u=(i+6)%7+1;f=7*t+(u-n.getDay());n.setDate(n.getDate()+f);return n}else{var r=(i-n.getDay())%7;r<0&&(r+=7);n.setDate(n.getDate()+r);return n}};$h.MeetingSuggestionTimeDecoder.$3N=function(n,t){var f;var i;var r;f=n;if(t.$L_1<=0||t.$L_1>12||t.$D_1<=0||t.$D_1>5)return n;var e=(12+t.$L_1-f.getMonth()-1)%12;i=new Date(f.getFullYear(),f.getMonth()+e,1);if(t.$O_1===1)if(t.$D_1===1&&i.getDay()!==6&&i.getDay())return i;else{r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()+(8-i.getDay())%7);i.getDay()!==6&&i.getDay()&&i.getDay()!==1&&r.setDate(r.getDate()-7);r.setDate(r.getDate()+7*(t.$D_1-1));return r.getMonth()+1!==t.$L_1?n:r}else{r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder.$39(i.getMonth(),i.getFullYear()));var u=1-r.getDay();u>0&&(u=u-7);r.setDate(r.getDate()+u);r.setDate(r.getDate()+7*(1-t.$D_1));return r.getMonth()+1!==t.$L_1?i.getDay()!==6&&i.getDay()?i:n:r}};$h.MeetingSuggestionTimeDecoder.$3A=function(n,t,i){var f=32767;t.val=null;i.val=0;if(!n)return!1;i.val=$h.MeetingSuggestionTimeDecoder.$4U(n);var e=n.getTime()-i.val;var r=(e-$h.MeetingSuggestionTimeDecoder.$1v.getTime())/864e5;if(r<0)return!1;else if(r>=262144)return!1;else{var u=r>>15;r=r&f;switch(u){case 0:return $h.MeetingSuggestionTimeDecoder.$3B(r,t);case 1:return $h.MeetingSuggestionTimeDecoder.$3C(r,t);default:return!1}}};$h.MeetingSuggestionTimeDecoder.$3B=function(n,t){var h=7;var e=15;var o=31;var s=127;var u=null;var r=0;var f=0;t.val=null;var i=n>>12&h;if((i&4)==4){u=n>>5&s;if((i&2)==2){if((i&1)==1)return!1;r=n>>1&e}}else{(i&2)==2&&(r=n>>8&e);(i&1)==1&&(f=n>>3&o)}t.val=new $h.PreciseDate(f,r,u);return!0};$h.MeetingSuggestionTimeDecoder.$3C=function(n,t){var o=15;var e=63;var h=7;var s=3;var r=n&o;n>>=4;var i=$h.MeetingSuggestionTimeDecoder.$3P(n&e,6);n>>=6;var f=n&h;n>>=3;var u=n&s;try{t.val=new $h.RelativeDate(u,i,f,r);return!0}catch(c){t.val=null;return!1}};$h.MeetingSuggestionTimeDecoder.$3P=function(n,t){var i=1<2||!Function.isInstanceOfType(n[0]))return!1;u=n[0];i>1&&(r=n[1]);t.val=new $h.CommonParameters(null,u,r);return!0};$h.CommonParameters.prototype={$S_0:null,$3_0:null,$4_0:null,get_options:function(){return this.$S_0},get_callback:function(){return this.$3_0},get_asyncContext:function(){return this.$4_0}};$h.EwsRequest=function(n){$h.EwsRequest.initializeBase(this,[n])};$h.EwsRequest.prototype={readyState:1,status:0,statusText:null,onreadystatechange:null,responseText:null,get_$2j_1:function(){return this.status},set_$2j_1:function(n){this.status=n;return n},get_$2k_1:function(){return this.statusText},set_$2k_1:function(n){this.statusText=n;return n},get_$1f_1:function(){return this.readyState},set_$1f_1:function(n){this.readyState=n;return n},get_hasOnReadyStateChangeCallback:function(){return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)},get_$1g_1:function(){return this.responseText},set_$1g_1:function(n){this.responseText=n;return n},send:function(n){this.$2t_1();$h.ScriptHelpers.isNullOrUndefined(n)&&this.$1j_1();this.$1i_0(5,"EwsRequest",{body:n})},$2s_1:function(){$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)||this.onreadystatechange()},$4k_1:function(n){},executeExtraFailedResponseSteps:function(){}};$h.InitialData=function(n){this.$0_0=n;this.$B_0=this.$2q_0()};$h.InitialData.$1=function(n,t,i){var r={get:i,configurable:!1};Object.defineProperty(n,t,r)};$h.InitialData.prototype={$13_0:null,$f_0:null,$b_0:null,$x_0:null,$k_0:null,$0_0:null,$B_0:0,get_$4d_0:function(){return this.$0_0.id},get_$4c_0:function(){return this.$0_0.itemClass},get_$36_0:function(){return new Date(this.$0_0.dateTimeCreated)},get_$37_0:function(){return new Date(this.$0_0.dateTimeModified)},get_$38_0:function(){return new Date(this.$0_0.dateTimeSent)},get_$2l_0:function(){this.$A_0();return this.$0_0.subject},get_$2d_0:function(){this.$A_0();return this.$0_0.normalizedSubject},get_$4a_0:function(){return this.$0_0.internetMessageId},get_$1w_0:function(){return this.$0_0.conversationId},get_$4q_0:function(){this.$A_0();var n=this.$0_0.sender;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$3O_0:function(){this.$A_0();var n=this.$0_0.from;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$1m_0:function(){this.$A_0();null===this.$13_0&&(this.$13_0=this.$1D_0("to"));return this.$13_0},get_$1A_0:function(){this.$A_0();null===this.$f_0&&(this.$f_0=this.$1D_0("cc"));return this.$f_0},get_$2p_0:function(){this.$A_0();null===this.$b_0&&(this.$b_0=this.$2z_0());return this.$b_0},get_$3K_0:function(){return this.$0_0.ewsUrl},get_$4f_0:function(){return this.$0_0.marketplaceAssetId},get_$3L_0:function(){return this.$0_0.extensionId},get_$4g_0:function(){return this.$0_0.marketplaceContentMarket},get_$2u_0:function(){return this.$0_0.consentMetadata},get_$4b_0:function(){return this.$0_0.isRead},get_$3H_0:function(){return this.$0_0.endNodeUrl},get_$3J_0:function(){return this.$0_0.entryPointUrl},get_$2i_0:function(){return new Date(this.$0_0.start)},get_$26_0:function(){return new Date(this.$0_0.end)},get_$2X_0:function(){return this.$0_0.location},get_$4n_0:function(){this.$A_0();null===this.$x_0&&(this.$x_0=this.$1D_0("resources"));return this.$x_0},get_$4h_0:function(){this.$A_0();var n=this.$0_0.organizer;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$50_0:function(){return this.$0_0.userDisplayName},get_$51_0:function(){return this.$0_0.userEmailAddress},get_$52_0:function(){return this.$0_0.userTimeZone},get_$1l_0:function(){return this.$0_0.timeZoneOffsets},get_$4X_0:function(){return this.$0_0.hostVersion},get_$4j_0:function(){return this.$0_0.owaView},get_$4i_0:function(){return this.$0_0.overrideWindowOpen},$m_0:function(){this.$k_0||(this.$k_0=new $h.Entities(this.$0_0.entities,this.$0_0.filteredEntities,this.get_$38_0(),this.$B_0));return this.$k_0},$2L_0:function(n){var t=this.$m_0();return t.$3w_0(n)},$1V_0:function(n){var t=this.$m_0();return t.$1V_0(n)},$1Y_0:function(){return this.$0_0.regExMatches?this.$0_0.regExMatches:null},$2S_0:function(n){var t=this.$1Y_0();return!t||!t[n]?null:t[n]},$A_0:function(){OSF.DDA.OutlookAppOm.$G(this.$B_0)},$1D_0:function(n){var i=this.$0_0[n];if($h.ScriptHelpers.isNullOrUndefined(i))return[];for(var r=[],t=0;tGets a list of attachments to the item.
+ attachments: undefined + }, + contents: function () { + return new Array(new Office._context_mailbox_item_attachmentDetails()) + } + }, + attachments_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "attachments", + annotate: { + ///Gets a list of attachments to the item. In compose mode the attachments property is undefined. In read mode it returns a list of attachments to the item. + attachments: undefined + }, + contents: function () { + return new Array(new Office._context_mailbox_item_attachmentDetails()) + } + } + } + + bodyDoc = { + body_compose: { + conditions: { + hosts: ["not outlook, outlookcompose"] + }, + name: "body", + annotate: { + /// Provides methods to get and set the body of the item. + body: undefined + }, + contents: function () { + return new Office._context_mailbox_item_body() + } + }, + body_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "body", + annotate: { + /// Gets the content of an item. In read mode, the body property is undefined. In compose mode it returns a Body object. + body: undefined + }, + contents: function () { + return new Office._context_mailbox_item_body() + } + } + } + + // dateTimeCreated property. + dateTimeCreatedDoc = { + dateTimeCreated_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "dateTimeCreated", + annotate: { + ///Gets the date and time that the item was created. + dateTimeCreated: undefined + }, + contents: function () { + return new Date() + } + }, + dateTimeCreated_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "dateTimeCreated", + annotate: { + ///Gets the date and time that the item was created. In compose mode the dateTimeCreated property is undefined. + dateTimeCreated: undefined + }, + contents: function () { + return new Date() + } + } + } + + // dateTimeModified property. + dateTimeModifiedDoc = { + dateTimeModified_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "dateTimeModified", + annotate: { + ///Gets the date and time that the item was last modified. + dateTimeModified: undefined + }, + contents: function () { + return new Date() + } + }, + dateTimeModified_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "dateTimeModified", + annotate: { + ///Gets the date and time that the item was last modified. In compose mode the dateTimeModified property is undefined.
+ dateTimeModified: undefined + }, + contents: function () { + return new Date() + } + } + } + + // itemClass property. + itemClassDoc = { + itemClass_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "itemClass", + annotate: { + ///Gets the item class of the item. + itemClass: undefined + } + }, + itemClass_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "itemClass", + annotate: { + ///Gets the item class of the item. In compose mode the itemClass property is undefined. + itemClass: undefined + } + } + } + + // itemId property + // This property is in all modes, so it gets processed in place rather than + // after the extra documentation is removed. + Office._processContents(obj, { + itemIdDoc: { + conditions: { + hosts: ["outlook", "outlookcompose"] + }, + name: "itemId", + annotate: { + ///Gets the Exchange Web Services (EWS) item identifier of an item. + itemId: undefined + } + } + }) + + // itemType property. + Office._processContents(obj, { + itemTypeDoc: { + conditions: { + hosts: ["outlook", "outlookcompose"] + }, + name: "itemType", + annotate: { + ///Gets the type of an item that an instance represents. + itemType: undefined + } + } + }) + + //obj.normalizedSubject = {}; + normalizedSubjectDoc = { + normalizedSubject_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "normalizedSubject", + annotate: { + ///Gets the subject of the item, with standard prefixes removed. + normalizedSubject: undefined + } + }, + normalizedSubject_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "normalizedSubject", + annotate: { + ///Gets the subject of the item, with standard prefixes removed. In compose mode, the normalizedSubject property is undefined. + normalizedSubject: undefined + } + } + } + + subjectDoc = { + subject_compose: { + conditions: { + hosts: ["not outlook, outlookcompose"] + }, + name: "subject", + annotate: { + /// Provides methods to get and set the item subject. + subject: undefined + }, + contents: function () { + return new Office._context_mailbox_item_subject() + } + }, + subject_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "subject", + annotate: { + /// Gets the subject of the item. + subject: undefined + } + }, + subject_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "subject", + annotate: { + /// Gets the subject of an item. In compose mode the Subject property returns a Subject object. In read mode, it returns a string. + subject: undefined + } + } + } + + if (appMode == Office._appMode.Compose) { + delete attachmentsDoc["attachments_read"]; + delete attachmentsDoc["attachments_read_compose"]; + delete bodyDoc.body_compose["conditions"]; + delete bodyDoc["body_read_compose"]; + delete dateTimeCreatedDoc["dateTimeCreated_read"]; + delete dateTimeCreatedDoc["dateTimeCreated_read_compose"]; + delete dateTimeModifiedDoc["dateTimeModified_read"]; + delete dateTimeModifiedDoc["dateTimeModified_read_compose"]; + delete itemClassDoc["itemClass_read"]; + delete itemClassDoc["itemClass_read_compose"]; + delete normalizedSubjectDoc["normalizedSubject_read"]; + delete normalizedSubjectDoc["normalizedSubject_read_compose"]; + delete subjectDoc.subject_compose["conditions"]; + delete subjectDoc["subject_read"]; + delete subjectDoc["subject_read_compose"]; + } + else if (appMode == Office._appMode.Read) { + delete attachmentsDoc.attachments_read["conditions"]; + delete attachmentsDoc["attachments_read_compose"]; + delete bodyDoc["body_compose"]; + delete bodyDoc["body_read_compose"]; + delete dateTimeCreatedDoc.dateTimeCreated_read["conditions"]; + delete dateTimeCreatedDoc["dateTimeCreated_read_compose"]; + delete dateTimeModifiedDoc.dateTimeModified_read["conditions"]; + delete dateTimeModifiedDoc["dateTimeModified_read_compose"]; + delete itemClassDoc.itemClass_read["conditions"]; + delete itemClassDoc["itemClass_read_compose"]; + delete normalizedSubjectDoc.normalizedSubject_read["conditions"]; + delete normalizedSubjectDoc["normalizedSubject_read_compose"]; + delete subjectDoc.subject_read["conditions"]; + delete subjectDoc["subject_compose"]; + delete subjectDoc["subject_read_compose"]; + } + else if (appMode == Office._appMode.ReadCompose) { + delete attachmentsDoc["attachments_read"]; + delete attachmentsDoc.attachments_read_compose["conditions"]; + delete bodyDoc["body_compose"]; + delete bodyDoc.body_read_compose["conditions"]; + delete dateTimeCreatedDoc["dateTimeCreated_read"]; + delete dateTimeCreatedDoc.dateTimeCreated_read_compose["conditions"]; + delete dateTimeModifiedDoc["dateTimeModified_read"]; + delete dateTimeModifiedDoc.dateTimeModified_read_compose["conditions"]; + delete itemClassDoc["itemClass_read"]; + delete itemClassDoc.itemClass_read_compose["conditions"]; + delete normalizedSubjectDoc["normalizedSubject_read"]; + delete normalizedSubjectDoc.normalizedSubject_read_compose["conditions"]; + delete subjectDoc["subject_compose"]; + delete subjectDoc["subject_read"]; + delete subjectDoc.subject_read_compose["conditions"]; + } + + Office._processContents(obj, attachmentsDoc); + Office._processContents(obj, bodyDoc); + Office._processContents(obj, dateTimeCreatedDoc); + Office._processContents(obj, dateTimeModifiedDoc); + Office._processContents(obj, itemClassDoc); + Office._processContents(obj, normalizedSubjectDoc); + Office._processContents(obj, subjectDoc); + + if (appMode == Office._appMode.Compose || appMode == Office._appMode.ReadCompose) { + obj.addFileAttachmentAsync = function (uri, attachmentName, options, callback) { + ///Attach a file to an item. + ///A URI that provides the location of the file. Required. + ///The name to display while the attachment is loading. The name is limited to 256 characters. Required. + ///An optional parameters or state data passed to the callback method. Optional. + ///The method to invoke when the attachment finishes uploading. Optional. + + var result = new Office._Mailbox_AsyncResult("attachmentAsync"); + if (arguments.length == 3) { callback = options; } + callback(result); + }; + + obj.addItemAttachmentAsync = function (itemId, attachmentName, options, callback) { + ///Attach an email item to an item. + ///The Exchange identifier of the item to attach. The maximum length is 100 characters. + ///The name to display while the attachment is loading. The name is limited to 256 characters. + ///An optional parameters or state data passed to the callback method. + ///The method to invoke when the attachment finishes uploading. + + var result = new Office._Mailbox_AsyncResult("attachmentAsync"); + if (arguments.length == 3) { callback = options; } + callback(result); + }; + + obj.removeAttachmentAsync = function (attachmentIndex, options, callback) { + ///Removes a file or item that was previously attached to an item. + ///The index of the attachment to remove. + ///An optional parameters or state data passed to the callback method. + ///The method to invoke when the attachment is removed. + + var result = new Office._Mailbox_AsyncResult("removeAttachmentAsync"); + if (arguments.length == 2) { callback = options; } + callback(result); + }; + + Office._processItem(obj, { + conditions: { + reqs: ["set Mailbox GE 1.2"] + }, + metaOnly: true, + contents: { + getSelectedDataAsync: { + value: function (coercionType, options, callback) { + ///Gets the selected data in the subject or body of the current item; or null if not data is selected. + ///One of the CoercionType enumeration values indicating whether the selected content is HTML or plain text. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous method is complete. + var result = new Office._Mailbox_AsyncResult("getSelectedDataAsync"); + if (arguments.length == 2) { callback = options; } + callback(result); + } + }, + setSelectedDataAsync: { + value: function (data, options, callback) { + ///Sets the specified data in the subject or body of the current item. + ///The text to insert into the subject or body of the item. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous method is complete. + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + } + } + } + }); + } + + if (appMode == Office._appMode.Read || appMode == Office._appMode.ReadCompose) { + obj.displayReplyAllForm = function (htmlBody) { + ///Display a form for creating an email reply to all recipients. + ///The HTML contents of the email reply. 32 KB limit. + }; + obj.displayReplyForm = function (htmlBody) { + ///Display a form for creating an email reply to the sender. + ///The HTML contents of the email reply. 32 KB limit + }; + Office._processItem(obj, { + conditions: { + reqs: ["set Mailbox GE 1.2"] + }, + metaOnly: true, + contents: { + displayReplyAllForm: { + value: function (replyForm) { + ///Display a form for creating an email reply to all recipients. + ///Syntax example: { + /// "body": "..." , + /// "attachments": [ + /// { + /// "type":"item", + /// "id":"...", + /// }, + /// { + /// "type":"file", + /// "name":"...", + /// "url":"...", + /// } + /// ]} + /// body: HTML contents of the email reply. Optional, 32 KB limit. + /// attachments: An array of JSON objects that are either file or item attachments. Optional. + /// attachments:type: "item" to indicate that the attachment is an Exchange item, or "file" to indicate that the attachment is a file. + /// attachments:id: The EWS identifier of the item to attach. 100 character limit. + /// attachments:file: The file name of the file to attach. 255 character limit. + /// attachments:url: The URL of the location where the file bytes are located. 2048 character limit. + /// -or- + /// The HTML contents of the email reply. 32 KB limit. + } + }, + displayReplyForm: { + value: function (replyForm) { + ///Display a form for creating an email reply to the sender. + ///Syntax example: { + /// "body": "..." , + /// "attachments": [ + /// { + /// "type":"item", + /// "id":"...", + /// }, + /// { + /// "type":"file", + /// "name":"...", + /// "url":"...", + /// } + /// ]} + /// body: HTML contents of the email reply. Optional, 32 KB limit. + /// attachments: An array of JSON objects that are either file or item attachments. Optional. + /// attachments:type: "item" to indicate that the attachment is an Exchange item, or "file" to indicate that the attachment is a file. + /// attachments:id: The EWS identifier of the item to attach. 100 character limit. + /// attachments:file: The file name of the file to attach. 255 character limit. + /// attachments:url: The URL of the location where the file bytes are located. 2048 character limit. + /// -or- + /// The HTML contents of the email reply. 32 KB limit. + } + } + } + }); + obj.getEntities = function () { + ///Gets an array of entities found in an item. + return (new Office._context_mailbox_item_entities()); + }; + obj.getEntitiesByType = function (entityType) { + ///Gets an array of entities of the specified entity type found in an item. + ///One of the EntityType enumeration values. + if (entityType == Office.MailboxEnums.EntityType.Address) { + return (new Array("")); + } + + if (entityType == Office.MailboxEnums.EntityType.Contact) { + return (new Array(new Office._context_mailbox_item_contact())); + } + + if (entityType == Office.MailboxEnums.EntityType.EmailAddress) { + return (new Array("")); + } + + if (entityType == Office.MailboxEnums.EntityType.MeetingSuggestion) { + return (new Array(new Office._context_mailbox_item_meetingSuggestion())); + } + + if (entityType == Office.MailboxEnums.EntityType.PhoneNumber) { + return (new Array(new Office._context_mailbox_item_phoneNumber())); + } + + if (entityType == Office.MailboxEnums.EntityType.TaskSuggestion) { + return (new Array(new Office._context_mailbox_item_taskSuggestion())); + } + + if (entityType == Office.MailboxEnums.EntityType.Url) { + return (new Array("")); + } + }; + obj.getFilteredEntitiesByName = function (name) { + ///Returns well-known enitities that pass the named filter defined in the manifest XML file. + ///The name of the filter defined in the manifest XML file. + return (new Array(Office._context_mailbox_item_entities())); + }; + obj.getRegExMatches = function () { + ///Returns string values that match the regular expressions defined in the manifest XML file. + return (new Array("")); + }; + obj.getRegExMatchesByName = function (name) { + ///Returns string values that match the named regular expression defined in the manifest XML file. + ///The name of the regular expression defined in the manifest XML file. + return (new Array("")); + }; + } + + obj.loadCustomPropertiesAsync = function (callback, userContext) { + ///Asynchronously loads custom properties that are specific to the item and a mail app for Outlook. + ///The method to call when the asynchronous load is complete. + ///Any state data that is passed to the asynchronous method. + + var result = new Office._Mailbox_AsyncResult("loadCustomPropertiesAsync"); + callback(result); + }; +}; + +Office._$MailboxAppointment_helper = function (obj, appMode) { + // End property. + endDoc = { + end_compose: { + conditions: { + hosts: ["not outlook; outlookcompose"] + }, + name: "end", + annotate: { + /// Provides methods to get and set the end time of an appointment. + end: undefined + }, + contents: function () { + return new Office._context_mailbox_item_time(); + } + }, + end_read: { + conditions: { + hosts: ["outlook; not outlookcompose"] + }, + name: "end", + annotate: { + ///Gets the date and time that the appointment is to end. + end: undefined + }, + contents: function () { + return new Date(); + } + }, + end_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "end", + annotate: { + /// Gets the date and time that the appointment is to end. In read mode, returns Date object. In compose mode, returns a Time object. + end: undefined + } + } + } + + // Location property. + locationDoc = { + location_compose: { + conditions: { + hosts: ["not outlook, outlookcompose"] + }, + name: "location", + annotate: { + /// Provides methods to get and set the location of an appointment. + location: undefined + }, + contents: function () { + return new Office._context_mailbox_item_location() + } + }, + location_read: { + conditions: { + hosts: ["not outlook, outlookcompose"] + }, + name: "location", + annotate: { + ///Gets the location of an appointment. + location: undefined + } + }, + location_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "location", + annotate: { + /// Gets the location of an appointment. In read mode, returns a string. In compose mode returns a Location object. + location: undefined + } + } + } + + // Optional attendees property. + optionalAttendeesDoc = { + optionalAttendees_compose: { + conditions: { + hosts: ["not outlook; outlookcompose"] + }, + name: "optionalAttendees", + annotate: { + /// Provides methods to get and set the optional attendees of an appointment. + optionalAttendees: undefined + }, + contents: function () { + return new Office._context_mailbox_item_recipients(); + } + }, + optionalAttendees_read: { + conditions: { + hosts: ["outlook; not outlookcompose"] + }, + name: "optionalAttendees", + annotate: { + ///Gets a list of email addresses for optional attendees of an appointment. + optionalAttendees: undefined + }, + contents: function () { + return new Array(new Office._context_mailbox_item_emailAddressDetails()) + } + }, + optionalAttendees_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "optionalAttendees", + annotate: { + /// Gets a list of email addresses for optional attendees of an appointment. In read mode, returns an array of EmailAddressDetails objects. In compose mode, returns a Recipients object. + optionalAttendees: undefined + } + } + } + + // Organizer property. + organizerDoc = { + organizer_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "organizer", + annotate: { + ///Gets the email address of the meeting organizer for the specified meeting. + organizer: undefined + }, + contents: function () { + return new Office._context_mailbox_item_emailAddressDetails() + } + }, + organizer_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "organizer", + annotate: { + ///Gets the email address of the meeting organizer for the specified meeting. In compose mode, the organizer property is undefined. + organizer: undefined + }, + contents: function () { + return new Office._context_mailbox_item_emailAddressDetails() + } + } + } + + // Required attendees + requiredAttendeesDoc = { + requiredAttendees_compose: { + conditions: { + hosts: ["not outlook, outlookcompose"] + }, + name: "requiredAttendees", + annotate: { + /// Provides methods to get and set the required attendees of an appointment. + requiredAttendees: undefined + }, + contents: function () { + return new Office._context_mailbox_item_recipients(); + } + }, + requiredAttendees_read: { + conditions: { + hosts: ["outlook; not outlookcompose"] + }, + name: "requiredAttendees", + annotate: { + /// Gets a list of email addresses for required attendees of an appointment. + requiredAttendees: undefined + }, + contents: function () { + return new Array(new Office._context_mailbox_item_emailAddressDetails()) + } + }, + requiredAttendees_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "requiredAttendees", + annotate: { + /// Gets a list of email addresses for required attendees of an appointment. In read mode, returns an array of EmailAddressDetails objects. In compose mode, returns a Recipients object. + requiredAttendees: undefined + } + } + } + + // Resources property. + resourcesDoc = { + resources_read: { + conditions: { + hosts: ["outlook; not outlookcompose"] + }, + name: "resources", + annotate: { + /// Gets the resources required for an appointment. + resources: undefined + }, + contents: function () { + return new Array(new Office._context_mailbox_item_emailAddressDetails()) + } + }, + resources_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "resources", + annotate: { + /// Gets the resources required for an appointment. In read mode, returns an array of EmailAddressDetails objects. In compose mode, the resources property is undefined. + resources: undefined + } + } + } + + // Start property + startDoc = { + start_compose: { + conditions: { + hosts: ["not outlook; outlookcompose"] + }, + name: "start", + annotate: { + /// Provides methods to get and set the start time for the appointment. + start: undefined + }, + contents: function () { + return new Office._context_mailbox_item_time(); + } + }, + start_read: { + conditions: { + hosts: ["outlook; not outlookcompose"] + }, + name: "start", + annotate: { + ///Gets the date and time that the appointment is to begin. + start: undefined + }, + contents: function () { + return new Date(); + } + }, + start_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "start", + annotate: { + /// Gets the date and time that the appointment is to begin. In read mode, returns Date object. In compose mode, returns a Time object. + start: undefined + } + } + } + + if (appMode == Office._appMode.Compose) { + delete endDoc.end_compose["conditions"]; + delete endDoc["end_read"]; + delete endDoc["end_read_compose"]; + delete locationDoc.location_compose["conditions"]; + delete locationDoc["location_read"]; + delete locationDoc["location_read_compose"]; + delete optionalAttendeesDoc.optionalAttendees_compose["conditions"]; + delete optionalAttendeesDoc["optionalAttendees_read"]; + delete optionalAttendeesDoc["optionalAttendees_read_compose"]; + delete organizerDoc["organizer_read"]; + delete organizerDoc["organizer_read_compose"]; + delete requiredAttendeesDoc.requiredAttendees_compose["conditions"]; + delete requiredAttendeesDoc["requiredAttendees_read"]; + delete requiredAttendeesDoc["requiredAttendees_read_compose"]; + delete resourcesDoc["resources_read"]; + delete resourcesDoc["resources_read_compose"]; + delete startDoc.start_compose["conditions"]; + delete startDoc["start_read"]; + delete startDoc["start_read_compose"]; + } + else if (appMode == Office._appMode.Read) { + delete endDoc["end_compose"]; + delete endDoc.end_read["conditions"]; + delete endDoc["end_read_compose"]; + delete locationDoc["location_compose"]; + delete locationDoc.location_read["conditions"]; + delete locationDoc["location_read_compose"]; + delete optionalAttendeesDoc["optionalAttendees_compose"]; + delete optionalAttendeesDoc.optionalAttendees_read["conditions"]; + delete optionalAttendeesDoc["optionalAttendees_read_compose"]; + delete organizerDoc.organizer_read["conditions"]; + delete organizerDoc["organizer_read_compose"]; + delete requiredAttendeesDoc["requiredAttendees_compose"]; + delete requiredAttendeesDoc.requiredAttendees_read["conditions"]; + delete requiredAttendeesDoc["requiredAttendees_read_compose"]; + delete resourcesDoc.resources_read["conditions"]; + delete resourcesDoc["resources_read_compose"]; + delete startDoc["start_compose"]; + delete startDoc.start_read["conditions"]; + delete startDoc["start_read_compose"]; + } + else if (appMode == Office._appMode.ReadCompose) { + delete endDoc["end_compose"]; + delete endDoc["end_read"]; + delete endDoc.end_read_compose["condtions"]; + delete locationDoc["location_compose"]; + delete locationDoc["location_read"]; + delete optionalAttendeesDoc["optionalAttendees_compose"]; + delete optionalAttendeesDoc["optionalAttendees_read"]; + delete optionalAttendeesDoc.optionalAttendees_read_compose["conditions"]; + delete locationDoc.location_read_compose["conditions"]; + delete organizerDoc["organizer_read"]; + delete organizerDoc.organizer_read_compose["conditions"]; + delete requiredAttendeesDoc["requiredAttendees_compose"]; + delete requiredAttendeesDoc["requiredAttendees_read"]; + delete requiredAttendeesDoc.requiredAttendees_read_compose["conditions"]; + delete resourcesDoc["resources_read"]; + delete resourcesDoc.resources_read_compose["conditions"]; + delete startDoc["start_compose"]; + delete startDoc["start_read"]; + delete startDoc.start_read_compose["conditions"]; + } + + Office._processContents(obj, endDoc); + Office._processContents(obj, locationDoc); + Office._processContents(obj, optionalAttendeesDoc); + Office._processContents(obj, organizerDoc); + Office._processContents(obj, requiredAttendeesDoc); + Office._processContents(obj, resourcesDoc); + Office._processContents(obj, startDoc); +}; + +Office._$MailboxMessage_helper = function (obj, appMode) { + // BCC property. + bccDoc = { + bcc_compose: { + conditions: { + hosts: ["not outlook; outlookcompose"] + }, + name: "bcc", + annotate: { + /// Provides methods to get and set the Bcc recipients of a message. + bcc: undefined + }, + contents: function () { + return new Office._context_mailbox_item_recipients(); + } + }, + bcc_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "bcc", + annotate: { + /// Gets the Bcc recipients of a message. In read mode, the bcc property is undefined. In compose mode it returns a Recipients object. + bcc: undefined + } + } + } + + // CC property. + ccDoc = { + cc_compose: { + conditions: { + hosts: ["not outlook; outlookcompose"] + }, + name: "cc", + annotate: { + /// Provides methods to get and set the carbon-copy (Cc) recipients of a message. + cc: undefined + }, + contents: function () { + return new Office._context_mailbox_item_recipients(); + } + }, + cc_read: { + conditions: { + hosts: ["outlook; not outlookcompose"] + }, + name: "cc", + annotate: { + /// Gets the carbon-copy (Cc) recipients of a message. + cc: undefined + }, + contents: function () { + return new Array(new Office._context_mailbox_item_emailAddressDetails()) + } + }, + cc_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "cc", + annotate: { + /// Gets the carbon-copy (Cc) recipients of a message. In read mode, the cc property returns an array of EmailAddressDetails objects. In compose mode it returns a Recipients object. + cc: undefined + } + } + } + + // conversationId property + Office._processContents(obj, { + conversationIdDoc: { + conditions: { + hosts: ["outlook", "outlookcompose"] + }, + name: "conversationId", + annotate: { + ///Gets an identifier for the email conversation that contains a particular message. + conversationId: undefined + } + } + }); + + // From property. + fromDoc = { + from_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "from", + annotate: { + /// Gets the email address of the message's sender. + from: undefined + }, + contents: function () { + return new Office._context_mailbox_item_emailAddressDetails(); + } + }, + from_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "from", + annotate: { + /// Gets the email address of the message's sender. In compose mode, the from property is undefined. + from: undefined + }, + contents: function () { + return new Office._context_mailbox_item_emailAddressDetails(); + } + } + } + + // InternetMessageId property. + internetMessageIdDoc = { + internetMessageId_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "internetMessageId", + annotate: { + /// Gets the internet message identifier of the message. + internetMessageId: undefined + } + }, + internetMessageId_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "internetMessageId", + annotate: { + /// Gets the internet message identifier of the message. In compose mode, the internetMessageId property is undefined. + internetMessageId: undefined + } + } + } + + // Sender property. + senderDoc = { + sender_read: { + conditions: { + hosts: ["outlook, not outlookcompose"] + }, + name: "sender", + annotate: { + /// Gets the email address of the message sender. + sender: undefined + }, + contents: function () { + return new Office._context_mailbox_item_emailAddressDetails(); + } + }, + sender_read_compose: { + conditions: { + hosts: ["outlook, outlookcompose"] + }, + name: "sender", + annotate: { + /// Gets the email address of the message sender. In compose mode, the sender property is undefined. + sender: undefined + }, + contents: function () { + return new Office._context_mailbox_item_emailAddressDetails(); + } + } + } + + // To property + toDoc = { + to_compose: { + conditions: { + hosts: ["not outlook; outlookcompose"] + }, + name: "to", + annotate: { + /// Provides methods to get and set the list of recipients of a message. + to: undefined + }, + contents: function () { + return new Office._context_mailbox_item_recipients(); + } + }, + to_read: { + conditions: { + hosts: ["outlook; not outlookcompose"] + }, + name: "to", + annotate: { + /// Gets the list of recipients of a message. + to: undefined + }, + contents: function () { + return new Array(new Office._context_mailbox_item_emailAddressDetails()) + } + }, + to_read_compose: { + conditions: { + hosts: ["outlook; outlookcompose"] + }, + name: "to", + annotate: { + /// Gets the list of recipients of a message. In read mode, the to property returns an array of EmailAddressDetails objects. In compose mode, it returns a Recipients object. + to: undefined + } + } + } + + if (appMode == Office._appMode.Compose) { + delete bccDoc.bcc_compose["conditions"]; + delete bccDoc["bcc_read_compose"]; + delete ccDoc.cc_compose["conditions"]; + delete ccDoc["cc_read"]; + delete ccDoc["cc_read_compose"]; + delete fromDoc["from_read"]; + delete fromDoc["from_read_compose"]; + delete internetMessageIdDoc["internetMessageId_read"]; + delete internetMessageIdDoc["internetMessageId_read_compose"]; + delete senderDoc["sender_read"]; + delete senderDoc["sender_read_compose"]; + delete toDoc.to_compose["conditions"]; + delete toDoc["to_read"]; + delete toDoc["to_read_compose"]; + } + else if (appMode == Office._appMode.Read) { + delete bccDoc["bcc_compose"]; + delete bccDoc["bcc_read_compose"]; + delete ccDoc["cc_compose"]; + delete ccDoc.cc_read["conditions"]; + delete ccDoc["cc_read_compose"]; + delete fromDoc.from_read["conditions"]; + delete fromDoc["from_read_compose"]; + delete internetMessageIdDoc.internetMessageId_read["conditions"]; + delete internetMessageIdDoc["internetMessageId_read_compose"]; + delete senderDoc.sender_read["conditions"]; + delete senderDoc["sender_read_compose"]; + delete toDoc["to_compose"]; + delete toDoc.to_read["conditions"]; + delete toDoc["to_read_compose"]; + } + else if (appMode == Office._appMode.ReadCompose) { + delete bccDoc["bcc_compose"]; + delete bccDoc.bcc_read_compose["conditions"]; + delete ccDoc["cc_compose"]; + delete ccDoc["cc_read"]; + delete ccDoc.cc_read_compose["conditions"]; + delete fromDoc["from_read"]; + delete fromDoc.from_read_compose["conditions"]; + delete internetMessageIdDoc["internetMessageId_read"]; + delete internetMessageIdDoc.internetMessageId_read_compose["conditions"]; + delete senderDoc["sender_read"]; + delete senderDoc.sender_read_compose["conditions"]; + delete toDoc["to_compose"]; + delete toDoc["to_read"]; + delete toDoc.to_read_compose["conditions"]; + } + + Office._processContents(obj, bccDoc); + Office._processContents(obj, ccDoc); + Office._processContents(obj, fromDoc); + Office._processContents(obj, internetMessageIdDoc); + Office._processContents(obj, senderDoc); + Office._processContents(obj, toDoc); +} + +Office._context_mailbox = function () { + ///Gets the URL of the Exchange Web Services (EWS) endpoint for this email account. + ///Represents the current item (message or appointment). + ///Represents the host application's user profile information. + ///Provides troubleshooting capabilities for a mail app. + var instance = new Office._context_mailbox_item(); + + this.ewsUrl = {}; + this.item = intellisense.nullWithCompletionsOf(instance); + this.userProfile = new Office._context_mailbox_userProfile(); + this.diagnostics = new Office._context_mailbox_diagnostics(); + + this.displayAppointmentForm = function (itemId) { + ///Displays an existing calendar appointment. + ///The Exchange Web Services (EWS) identifier for an existing calendar appointment. + }; + this.displayMessageForm = function (itemId) { + ///Displays an existing message. + ///The Exchange Web Services (EWS) identifier for an existing message. + }; + this.displayNewAppointmentForm = function (meetingRequest) { + ///Display a form for creating a new calendar appointment. + /// + /// Syntax example: {requiredAttendees:, optionalAttendees:, start:, end:, location:, resources:, subject:, body:} + /// requiredAttendees: An array of strings containing the SMTP email addresses of the required attendees for the meeting. The array is limited to 100 entries. + /// optionalAttendees: An array of strings containing the SMTP email addresses of the optional attendees for the meeting. The array is limited to 100 entries. + /// start: The start date and time of the appointment. + /// end: The end date and time of the appointment. + /// location: A string containing the location of the appointment. Limited to 255 characters. + /// resources: An array of strings containing the resources required for the appointment. The array is limited to 100 entries. + /// subject: A string containing the subject of the appointment. Limited to 255 characters. + /// body: The body of the appointment message. Limited to 32 Kb. + /// + }; + + this.convertToLocalClientTime = function (timeValue) { + ///Gets a dictionary containing time information in local client time. + ///The date and time to convert. + } + + this.convertToUtcClientTime = function (input) { + ///Get s Date object from a dictionary containing time information. + ///A dictionary containing a date. The dictionary should contain the following fields: year, month, date, hours, minutes, seconds, time zone, time zone offset. + } + + this.getCallbackTokenAsync = function (callback, userContext) { + ///Gets a token that can be used to retrieve attachments for the current item. This method is only available in read mode. + ///The method to call when the asynchronous method is complete. + ///Any state data that is passed to the asynchronous method. + var result = new Office._Mailbox_AsyncResult("getCallbackTokenAsync"); + callback(result); + } + this.getUserIdentityTokenAsync = function (callback, userContext) { + ///Gets a token identifying the user and the mail app for Outlook. + ///The method to call when the asynchronous load method is complete. + ///Any state data that is passed to the asynchronous method. + + var result = new Office._Mailbox_AsyncResult("getUserIdentityTokenAsync"); + callback(result); + }; + this.makeEwsRequestAsync = function (data, callback, userContext) { + ///Gets a token identifying the user and the mail app for Outlook. + ///Makes an asynchronous request to an Exchange Web Services (EWS) service on the Microsoft Exchange Server 2013 Preview that hosts the mail app for Outlook. + ///The method to call when the asynchronous load method is complete. + ///Any state data that is passed to the asynchronous method. + + var result = new Office._Mailbox_AsyncResult("makeEwsRequestAsync"); + callback(result); + }; +} + +Office._context_mailbox_diagnostics = function () { + ///Gets a string containing the name of the host application for the mail app. + ///Gets a string containing the version of either the host application or the Exchange server. + ///Gets a string containing the current view of the Outlook Web App. + this.hostName = {}; + this.hostVersion = {}; + this.OWAView = {}; +} + +Office._context_mailbox_item_attachmentDetails = function () { + /// Indicates whether the attachment is an Exchange item or file. + /// The MIME content type of the attachment. + /// The Exchange Web Services (EWS) attachment identifer for the attachment. + /// true if the attachment is inline, otherwise, false. + /// The name of the attachment. + /// Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult("bodyGetTypeAsync"); + if (arguments.length == 1) { callback = options; } + callback(result); + }; + this.prependAsync = function (data, options, callback) { + ///Sets the body of a message or meeting. + ///The text to insert at the beginning of the item body. The string is limited to 1,000,000 characters. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + }; + this.setSelectedDataAsync = function (data, options, callback) { + ///Replaces the selection in the body with the specified text. + ///The text to insert in the item body. The string is limited to 1,000,000 characters. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + }; +} +Office._context_mailbox_item_contact = function () { + ///Gets the mailing and street addresses associated with a contact. + ///Gets the name of the business associated with a contact. + ///Gets the SMTP email addresses associated with a contact. + ///Gets the name of the person associated with a contact. + ///Gets the phone numbers associated with a contact. + ///Get the list of Internet URLs associated with a contact. + this.addresses = new Array(""); + this.businessName = {}; + this.emailAddresses = new Array(""); + this.personName = {}; + this.phoneNumbers = new Array(new Office._context_mailbox_item_phoneNumber()); + this.urls = new Array(""); +} +Office._context_mailbox_item_customProperties = function () { + this.get = function (name) { + ///Gets the value of the specicifed custom property. + ///The name of the custom property to be returned. + } + + this.remove = function (name) { + ///Removes the specicifed custom property. + ///The name of the custom property to be removed. + } + + this.saveAsync = function (callback, userContext) { + ///Saves item-specific custom properties to the Exchange server. + ///The method to call when an asynchronous call is complete. + ///Any state data that is passed to the callback method. + } + + this.set = function (name, value) { + ///Sets the value of the specicifed custom property. + ///The name of the custom property to be set. + ///The value of the custom property to be set. + } +} +Office._context_mailbox_item_emailAddressDetails = function () { + ///One of the ResponseType enumeration values. + ///Gets the display name associated with the email address. + ///Gets the SMTP email address. + ///One of the RecipientType enumeration values. + this.appointmentResponse = {}; + this.displayName = {}; + this.emailAddress = {}; + this.recipientType = {}; +} +Office._context_mailbox_item_emailUser = function () { + ///Gets the name associated with an email account. + this.name = {}; + ///Gets the SMTP email address of the email account. + this.userId = {}; +} +Office._context_mailbox_item_entities = function () { + ///Gets the physical addresses (street or mailing address) found in an email message or appointment. + ///Gets the contacts found in an email message or appointment. + ///Gets the email addresses found in an email message or appointment. + ///Gets the meeting suggestions found in an email message or appointment. + ///Gets the phone numbers found in an email message or appointment. + ///Gets the task suggestions found in an email message or appointment. + ///Gets the Internet URLs found in an email message or appointment. + this.addresses = new Array(""); + this.contacts = new Array(new Office._context_mailbox_item_contact()); + this.emailAddresses = new Array(""); + this.meetingSuggestions = new Array(new Office._context_mailbox_item_meetingSuggestion()); + this.phoneNumbers = new Array(new Office._context_mailbox_item_phoneNumber()); + this.taskSuggestions = new Array(new Office._context_mailbox_item_taskSuggestion()); + this.urls = new Array(""); +} +Office._context_mailbox_item_location = function () { + this.getAsync = function (options, callback) { + ///Gets the location of an appointment. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult("locationGetAsync"); + if (arguments.length == 1) { callback = options; } + callback(result); + }; + + this.setAsync = function (location, options, callback) { + ///Sets the subject of an item. + ///The location of the appointment. The string is limited to 255 characters. + ///Any optional parameters or state data passed to the method. Optional. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + } +} +Office._context_mailbox_item_meetingRequest = function () { + ///Gets the date and time that a meeting is to end. + ///Gets the location of the proposed meeting. + ///Gets a list of the optional attendees for the meeting. + ///Gets the required attendees for the meeting. + ///Gets a list of the resources required for the meeting. + ///Gets the date and time that the meeting is to begin. + this.end = new Date; + this.location = {}; + this.optionalAttendees = new Array(new Office._context_mailbox_item_emailAddressDetails()); + this.requiredAttendees = new Array(new Office._context_mailbox_item_emailAddressDetails()); + this.resources = new Array(""); + this.start = new Date(); +} +Office._context_mailbox_item_meetingSuggestion = function () { + ///Gets the attendees for a suggested meeting. + ///Gets the date and time that a suggested meeting is to end. + ///Gets the location of a suggested meeting. + ///Gets a string that was identified as a meeting suggestion. + ///Gets the date and time that a suggested meeting is to begin. + ///Gets the subject of a suggested meeting. + this.attendees = new Array(new Office._Context_mailbox_item_emailAddressDetails()); + this.end = new Date(); + this.location = {}; + this.meetingString = {}; + this.start = new Date(); + this.subject = {}; +} +Office._context_mailbox_item_recipients = function () { + this.addAsync = function (recipients, options, callback) { + ///Adds recipients to an item. + /// + /// An array containing the recipients of the item. It can be: + /// An array of strings containing the SMTP email addresses of the recipients. + /// An array of {"diplayName":, "emailAddress":} dictionaries. + /// An array of EmailAddressDetail objects. + /// + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + }; + this.getAsync = function (options, callback) { + ///Gets the list of recipients for the item. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult("recipientGetAsync"); + if (arguments.length == 1) { callback = options; } + callback(result); + }; + this.setAsync = function (recipients, options, callback) { + ///Sets the recipients of an item. + /// + /// An array containing the recipients of the item. The array is limited to 100 entries. It can be: + /// An array of strings containing the SMTP email addresses of the recipients. + /// An array of {"diplayName":, "emailAddress":} dictionaries. + /// An array of EmailAddressDetail objects. + /// + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + } +} +Office._context_mailbox_item_phoneNumber = function () { + ///Gets the text that was identified in an item as a phone number. + ///Gets a text string identified as a phone number. + ///Gets the type of a phone number. + this.originalPhoneString = {}; + this.phoneString = {}; + this.type = {}; +} +Office._context_mailbox_item_subject = function () { + this.getAsync = function (options, callback) { + ///Gets the subject of an item. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult("subjectGetAsync"); + if (arguments.length = 1) { callback = options; } + callback(result); + }; + + this.setAsync = function (data, options, callback) { + ///Sets the subject of an item. + ///The subject of the item. The string is limited to 255 characters. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + } +} +Office._context_mailbox_item_taskSuggestion = function () { + ///Gets the users that should be assigned a suggested task. + ///Gets the text of an item that was identified as a task suggestion. + this.assignees = new Array(new Office._context_mailbox_item_emailAddressDetails()); + this.taskString = {}; +} +Office._context_mailbox_item_time = function () { + this.getAsync = function (options, callback) { + ///Gets the UTC value of a time. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult("subjectGetAsync"); + if (arguments.length == 1) { callback = options; } + callback(result); + }; + + this.setAsync = function (dateTime, options, callback) { + ///Sets the subject of an item. + ///The date and time to set in UTC. + ///Any optional parameters or state data passed to the method. + ///The method to call when the asynchronous request is complete. + + var result = new Office._Mailbox_AsyncResult(); + if (arguments.length == 2) { callback = options; } + callback(result); + } +} +Office._context_mailbox_userProfile = function () { + ///Gets the user's display name. + ///Gets the user's SMTP email address. + ///Gets the user's local time zone. + this.displayName = {}; + this.emailAddress = {}; + this.timeZone = {}; +} + +Office._context_mailbox_selectedDataResult = function () { + ///The selected text. + ///Indicates whether the data is from the item's subject line or body. + this.data = {}; + this.sourceProperty = {}; +} + +Office._Mailbox_AsyncResult = function (method) { + ///The userContext parameter passed to the callback function. + ///Any error that occured while processing the asynchronous request. + ///The status of the asynchronous request. + this.asyncContext = {}; + this.error = {}; + this.status = {}; + + if (method == "attachmentAsync") { + this.value = {} + intellisense.annotate(this, { + ///The identifier of the attachment. + value: null + }); + } + + if (method == "getCallbackTokenAsync") { + this.value = {}; + intellisense.annotate(this, { + ///The EWS callback token. + value: null + }); + } + + if (method == "getUserIdentityTokenAsync") { + this.value = {} + intellisense.annotate(this, { + ///A JSON Web token that identifies the current user. + value: null + }); + } + + if (method == "makeEwsRequestAsync") { + this.value = {}; + intellisense.annotate(this, { + ///The XML response from the EWS operation. + value: null + }); + } + + if (method == "loadCustomPropertiesAsync") { + this.value = new Office._context_mailbox_item_customProperties(); + intellisense.annotate(this, { + ///The custom properties + value: null + }); + } + + if (method == "bodyGetTypeAsync") { + this.value = {}; + annotate(this, { + ///A value that indicates whether the body is text or HTML. + value: undefined + }); + } + + if (method == "locationGetAsync") { + this.value = {}; + intellisense.annotate(this, { + ///The location of the appointment. + value: undefined + }); + } + + if (method == "recipientGetAsync") { + this.value = {}; + intellisense.annotate(this, { + ///An array of EmailAddressDetails objects containt the recipients of the item. + value: undefined + }); + } + + if (method == "subjectGetAsync") { + this.value = {}; + intellisense.annotate(this, { + ///The subject of the item. + value: undefined + }); + } + + if (method == "getSelectedDataAsync") { + this.value = new Office._context_mailbox_selectedDataResult(); + intellisense.annotate(this, { + ///The selected data. + value:undefined + }); + } +} + +Office._MailboxEnums = function () { + this.AttachmentType = { + ///Specifies that the attachment is a file. + File: "file", + ///Specifies that the attachment is an email message, appointment, or task. + Item: "item" + }; + this.BodyType = { + ///Specifies that the item body is in HTML format. + HTML: "HTML", + ///Specifies that the item body is text format. + Text: "text" + }; + this.EntityType = { + ///Specifies that the entity is a meeting suggestion. + MeetingSuggestion: "meetingSuggestion", + ///Specifies that the entity is a task suggestion. + TaskSuggestion: "taskSuggestion", + ///Specifies that the entity is a postal address. + Address: "address", + ///Specifies that the entity is SMTP email address. + EmailAddress: "emailAddress", + ///Specifies that the entity is an Internet URL. + Url: "url", + ///Specifies that the entity is US phone number. + PhoneNumber: "phoneNumber", + ///Specifies that the entity is a contact. + Contact: "contact" + }; + this.ItemType = { + ///Specifies a message item. This is an IPM.Note type. + Message: "message", + ///Specifies an appointment item. This is an IPM.Appointment type. + Appointment: "appointment" + }; + this.SourceProperty = { + ///Specifies that the source of the text is the body of an appointment or message. + MailBody: "mailBody", + ///Specifies that the source of the text is the subject of an appointment or message. + MailSubject: "mailSubject" + }; + this.RecipientType = { + ///Specifies that the recipient is not one of the other recipient types. + Other: "other", + ///Specifies that the recipient is a distribution list containing a list of email addresses. + DistributionList: "distributionList", + ///Specifies that the recipient is an SMTP email address that is on the Exchange server. + User: "user", + ///Specifies that the recipient is an SMTP email address that is not on the Exchange server. + ExternalUser: "externalUser" + }; + this.ResponseType = { + ///Specifies that no response has been received. + None: "none", + ///Specifies that you are the meeting organizer. + Organizer: "organizer", + ///Specifies that the attendee is tentatively attending. + Tentative: "tentative", + ///Specifies that the attendee is attending. + Accepted: "accepted", + ///Specifies that the attendee is not attending. + Declined: "declined" + }; +}; \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.01.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.01.debug.js new file mode 100644 index 000000000..fc13ca9c0 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.01.debug.js @@ -0,0 +1,3377 @@ +/* Outlook web application specific API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +; +Type.registerNamespace('Microsoft.Office.WebExtension.MailboxEnums'); +Microsoft.Office.WebExtension.MailboxEnums.EntityType={ + MeetingSuggestion: "meetingSuggestion", TaskSuggestion: "taskSuggestion", Address: "address", EmailAddress: "emailAddress", Url: "url", PhoneNumber: "phoneNumber", Contact: "contact" +}; +Microsoft.Office.WebExtension.MailboxEnums.ItemType={ + Message: 'message', Appointment: 'appointment' +}; +Microsoft.Office.WebExtension.MailboxEnums.ResponseType={ + None: "none", Organizer: "organizer", Tentative: "tentative", Accepted: "accepted", Declined: "declined" +}; +Microsoft.Office.WebExtension.MailboxEnums.RecipientType={ + Other: "other", DistributionList: "distributionList", User: "user", ExternalUser: "externalUser" +}; +Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={ + File: "file", Item: "item" +}; +Microsoft.Office.WebExtension.MailboxEnums.BodyType={ + Text: "text", Html: "html" +}; +Microsoft.Office.WebExtension.CoercionType={ + Text: "text", Html: "html" +}; +; +Type.registerNamespace('OSF.DDA'); +OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(officeAppContext, targetWindow, appReadyCallback) +{ + this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this, this._callAppReadyCallback$p$0); + this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this, this._displayNewAppointmentFormApi$p$0); + this.$$d_windowOpenOverrideHandler=Function.createDelegate(this, this.windowOpenOverrideHandler); + this.$$d__getEwsUrl$p$0=Function.createDelegate(this, this._getEwsUrl$p$0); + this.$$d__getDiagnostics$p$0=Function.createDelegate(this, this._getDiagnostics$p$0); + this.$$d__getUserProfile$p$0=Function.createDelegate(this, this._getUserProfile$p$0); + this.$$d__getItem$p$0=Function.createDelegate(this, this._getItem$p$0); + this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this, this._getInitialDataResponseHandler$p$0); + OSF.DDA.OutlookAppOm._instance$p=this; + this._officeAppContext$p$0=officeAppContext; + this._appReadyCallback$p$0=appReadyCallback; + var $$t_4=this; + var stringLoadedCallback=function() + { + if (appReadyCallback) + { + $$t_4._invokeHostMethod$i$0(1, 'GetInitialData', null, $$t_4.$$d__getInitialDataResponseHandler$p$0) + } + }; + if (this._areStringsLoaded$p$0()) + { + stringLoadedCallback() + } + else + { + this._loadLocalizedScript$p$0(stringLoadedCallback) + } +}; +OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function OSF_DDA_OutlookAppOm$_throwOnPropertyAccessForRestrictedPermission$i(currentPermissionLevel) +{ + if (!currentPermissionLevel) + { + throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text); + } +}; +OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function OSF_DDA_OutlookAppOm$_throwOnOutOfRange$i(value, minValue, maxValue, argumentName) +{ + if (value < minValue || value > maxValue) + { + throw Error.argumentOutOfRange(argumentName); + } +}; +OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function OSF_DDA_OutlookAppOm$_throwOnArgumentType$p(value, expectedType, argumentName) +{ + if (Object.getType(value) !==expectedType) + { + throw Error.argumentType(argumentName); + } +}; +OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function OSF_DDA_OutlookAppOm$_validateOptionalStringParameter$p(value, minLength, maxLength, name) +{ + if ($h.ScriptHelpers.isNullOrUndefined(value)) + { + return + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value, String, name); + var stringValue=value; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(stringValue.length, minLength, maxLength, name) +}; +OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function OSF_DDA_OutlookAppOm$_convertToOutlookParameters$p(dispid, data) +{ + var executeParameters=null; + switch (dispid) + { + case 1: + case 2: + case 12: + case 3: + case 14: + case 18: + case 26: + break; + case 4: + var jsonProperty=JSON.stringify(data['customProperties']); + executeParameters=[jsonProperty]; + break; + case 5: + executeParameters=[data['body']]; + break; + case 8: + case 9: + executeParameters=[data['itemId']]; + break; + case 7: + executeParameters=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['requiredAttendees']), OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['optionalAttendees']), data['start'], data['end'], data['location'], OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['resources']), data['subject'], data['body']]; + break; + case 11: + case 10: + executeParameters=[data['htmlBody']]; + break; + case 23: + case 13: + executeParameters=[data['data'], data['coercionType'] || null]; + break; + case 17: + executeParameters=[data['subject']]; + break; + case 15: + executeParameters=[data['recipientField']]; + break; + case 22: + case 21: + executeParameters=[data['recipientField'], OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(data['recipientArray'])]; + break; + case 19: + executeParameters=[data['itemId'], data['name']]; + break; + case 16: + executeParameters=[data['uri'], data['name']]; + break; + case 20: + executeParameters=[data['attachmentIndex']]; + break; + case 25: + executeParameters=[data['TimeProperty'], data['time']]; + break; + case 24: + executeParameters=[data['TimeProperty']]; + break; + case 27: + executeParameters=[data['location']]; + break; + default: + Sys.Debug.fail('Unexpected method dispid'); + break + } + return executeParameters +}; +OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function OSF_DDA_OutlookAppOm$_convertRecipientArrayParameterForOutlookForDisplayApi$p(array) +{ + return (array) ? array.join(';') : null +}; +OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function OSF_DDA_OutlookAppOm$_convertComposeEmailDictionaryParameterForSetApi$p(recipients) +{ + if (!recipients) + { + return null + } + var results=new Array(recipients.length); + for (var i=0; i < recipients.length; i++) + { + results[i]=[recipients[i]['address'], recipients[i]['name']] + } + return results +}; +OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function OSF_DDA_OutlookAppOm$_validateAndNormalizeRecipientEmails$p(emailset, name) +{ + if ($h.ScriptHelpers.isNullOrUndefined(emailset)) + { + return null + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset, Array, name); + var originalAttendees=emailset; + var updatedAttendees=null; + var normalizationNeeded=false; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(originalAttendees.length, 0, OSF.DDA.OutlookAppOm._maxRecipients$p, String.format('{0}.length', name)); + for (var i=0; i < originalAttendees.length; i++) + { + if ($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) + { + normalizationNeeded=true; + break + } + } + if (normalizationNeeded) + { + updatedAttendees=[] + } + for (var i=0; i < originalAttendees.length; i++) + { + if (normalizationNeeded) + { + updatedAttendees[i]=($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) ? (originalAttendees[i]).emailAddress : originalAttendees[i]; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i], String, String.format('{0}[{1}]', name, i)) + } + else + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i], String, String.format('{0}[{1}]', name, i)) + } + } + return updatedAttendees +}; +OSF.DDA.OutlookAppOm.prototype={ + _initialData$p$0: null, _item$p$0: null, _userProfile$p$0: null, _diagnostics$p$0: null, _officeAppContext$p$0: null, _appReadyCallback$p$0: null, _clientEndPoint$p$0: null, get_clientEndPoint: function OSF_DDA_OutlookAppOm$get_clientEndPoint() + { + if (!this._clientEndPoint$p$0) + { + this._clientEndPoint$p$0=OSF._OfficeAppFactory.getClientEndPoint() + } + return this._clientEndPoint$p$0 + }, set_clientEndPoint: function OSF_DDA_OutlookAppOm$set_clientEndPoint(value) + { + this._clientEndPoint$p$0=value; + return value + }, get_initialData: function OSF_DDA_OutlookAppOm$get_initialData() + { + return this._initialData$p$0 + }, get__appName$i$0: function OSF_DDA_OutlookAppOm$get__appName$i$0() + { + return this._officeAppContext$p$0.get_appName() + }, initialize: function OSF_DDA_OutlookAppOm$initialize(initialData) + { + var ItemTypeKey='itemType'; + this._initialData$p$0=new $h.InitialData(initialData); + if (1===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.Message(this._initialData$p$0) + } + else if (3===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.MeetingRequest(this._initialData$p$0) + } + else if (2===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.Appointment(this._initialData$p$0) + } + else if (4===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.MessageCompose(this._initialData$p$0) + } + else if (5===initialData[ItemTypeKey]) + { + this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0) + } + else + { + Sys.Debug.trace('Unexpected item type was received from the host.') + } + this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0); + this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0, this._officeAppContext$p$0.get_appName()); + this._initializeMethods$p$0(); + $h.InitialData._defineReadOnlyProperty$i(this, 'item', this.$$d__getItem$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'userProfile', this.$$d__getUserProfile$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'diagnostics', this.$$d__getDiagnostics$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'ewsUrl', this.$$d__getEwsUrl$p$0); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + { + if (this._initialData$p$0.get__overrideWindowOpen$i$0()) + { + window.open=this.$$d_windowOpenOverrideHandler + } + } + }, windowOpenOverrideHandler: function OSF_DDA_OutlookAppOm$windowOpenOverrideHandler(url, targetName, features, replace) + { + this._invokeHostMethod$i$0(0, 'LaunchPalUrl', {launchUrl: url}, null) + }, makeEwsRequestAsync: function OSF_DDA_OutlookAppOm$makeEwsRequestAsync(data) + { + var args=[]; + for (var $$pai_5=1; $$pai_5 < arguments.length;++$$pai_5) + { + args[$$pai_5 - 1]=arguments[$$pai_5] + } + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + if (data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) + { + throw Error.argument('data', _u.ExtensibilityStrings.l_EwsRequestOversized_Text); + } + this._throwOnMethodCallForInsufficientPermission$i$0(3, 'makeEwsRequestAsync'); + var parameters=$h.CommonParameters.parse(args, true, true); + var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0); + var $$t_4=this; + ewsRequest.onreadystatechange=function() + { + if (4===ewsRequest.get__requestState$i$1()) + { + parameters.get_callback()(ewsRequest._asyncResult$p$0) + } + }; + ewsRequest.send(data) + }, recordDataPoint: function OSF_DDA_OutlookAppOm$recordDataPoint(data) + { + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordDataPoint', data, null) + }, recordTrace: function OSF_DDA_OutlookAppOm$recordTrace(data) + { + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordTrace', data, null) + }, trackCtq: function OSF_DDA_OutlookAppOm$trackCtq(data) + { + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'TrackCtq', data, null) + }, convertToLocalClientTime: function OSF_DDA_OutlookAppOm$convertToLocalClientTime(timeValue) + { + var date=new Date(timeValue.getTime()); + var offset=date.getTimezoneOffset() * -1; + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + date.setUTCMinutes(date.getUTCMinutes() - offset); + offset=this._findOffset$p$0(date); + date.setUTCMinutes(date.getUTCMinutes()+offset) + } + var retValue=this._dateToDictionary$i$0(date); + retValue['timezoneOffset']=offset; + return retValue + }, convertToUtcClientTime: function OSF_DDA_OutlookAppOm$convertToUtcClientTime(input) + { + var retValue=this._dictionaryToDate$i$0(input); + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) + { + var offset=this._findOffset$p$0(retValue); + retValue.setUTCMinutes(retValue.getUTCMinutes() - offset); + offset=(!input['timezoneOffset']) ? retValue.getTimezoneOffset() * -1 : input['timezoneOffset']; + retValue.setUTCMinutes(retValue.getUTCMinutes()+offset) + } + return retValue + }, getUserIdentityTokenAsync: function OSF_DDA_OutlookAppOm$getUserIdentityTokenAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + this._throwOnMethodCallForInsufficientPermission$i$0(1, 'getUserIdentityTokenAsync'); + var parameters=$h.CommonParameters.parse(args, true, true); + this._invokeGetTokenMethodAsync$p$0(2, 'GetUserIdentityToken', parameters.get_callback(), parameters._asyncContext$p$0) + }, getCallbackTokenAsync: function OSF_DDA_OutlookAppOm$getCallbackTokenAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + this._throwOnMethodCallForInsufficientPermission$i$0(1, 'getCallbackTokenAsync'); + var parameters=$h.CommonParameters.parse(args, true, true); + this._invokeGetTokenMethodAsync$p$0(12, 'GetCallbackToken', parameters.get_callback(), parameters._asyncContext$p$0) + }, displayMessageForm: function OSF_DDA_OutlookAppOm$displayMessageForm(itemId) + { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) + { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(8, 'DisplayExistingMessageForm', {itemId: itemId}, null) + }, displayAppointmentForm: function OSF_DDA_OutlookAppOm$displayAppointmentForm(itemId) + { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) + { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(9, 'DisplayExistingAppointmentForm', {itemId: itemId}, null) + }, createAsyncResult: function OSF_DDA_OutlookAppOm$createAsyncResult(value, errorCode, errorDescription, userContext) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if (0 !==errorCode) + { + errorArgs={}; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorCode; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorDescription + } + return new OSF.DDA.AsyncResult(initArgs, errorArgs) + }, standardCreateAsyncResult: function OSF_DDA_OutlookAppOm$standardCreateAsyncResult(value, errorCode, detailedErrorCode, userContext) + { + var initArgs={}; + var errorArgs=null; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value; + initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext; + if (0 !==errorCode) + { + errorArgs={}; + var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorProperties['name']; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorProperties['message']; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=detailedErrorCode + } + return new OSF.DDA.AsyncResult(initArgs, errorArgs) + }, _throwOnMethodCallForInsufficientPermission$i$0: function OSF_DDA_OutlookAppOm$_throwOnMethodCallForInsufficientPermission$i$0(requiredPermissionLevel, methodName) + { + if (this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel) + { + throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text, methodName)); + } + }, _displayReplyForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyForm$i$0(htmlBody) + { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody') + } + this._invokeHostMethod$i$0(10, 'DisplayReplyForm', {htmlBody: htmlBody}, null) + }, _displayReplyAllForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyAllForm$i$0(htmlBody) + { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody') + } + this._invokeHostMethod$i$0(11, 'DisplayReplyAllForm', {htmlBody: htmlBody}, null) + }, _standardInvokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_standardInvokeHostMethod$i$0(dispid, name, data, format, userContext, callback) + { + var $$t_C=this; + this._invokeHostMethod$i$0(dispid, name, data, function(resultCode, response) + { + if (callback) + { + var asyncResult=null; + if (Object.isInstanceOfType(response)) + { + var responseDictionary=response; + if (('error' in responseDictionary) || ('data' in responseDictionary) || ('errorCode' in responseDictionary)) + { + if (!responseDictionary['error']) + { + var formattedData=(format) ? format(responseDictionary['data']) : responseDictionary['data']; + asyncResult=$$t_C.standardCreateAsyncResult(formattedData, 0, 0, userContext) + } + else + { + var errorCode=responseDictionary['errorCode']; + asyncResult=$$t_C.standardCreateAsyncResult(null, 1, errorCode, userContext) + } + } + } + if (!asyncResult && resultCode) + { + asyncResult=$$t_C.standardCreateAsyncResult(null, 1, 9002, userContext) + } + callback(asyncResult) + } + }) + }, _invokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_invokeHostMethod$i$0(dispid, name, data, responseCallback) + { + if (64===this._officeAppContext$p$0.get_appName()) + { + this.get_clientEndPoint().invoke(name, responseCallback, data) + } + else if (dispid) + { + var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid, data); + var $$t_B=this; + window.external.Execute(dispid, executeParameters, function(nativeData, resultCode) + { + if (responseCallback) + { + var responseData=nativeData.toArray(); + var rawData=JSON.parse(responseData[0]); + if (Object.isInstanceOfType(rawData)) + { + var deserializedData=rawData; + if (responseData.length > 1 && responseData[1]) + { + deserializedData['error']=true; + deserializedData['errorCode']=responseData[1] + } + else + { + deserializedData['error']=false + } + responseCallback(resultCode, deserializedData) + } + else if (Number.isInstanceOfType(rawData)) + { + var returnDict={}; + returnDict['error']=true; + returnDict['errorCode']=rawData; + responseCallback(resultCode, returnDict) + } + else + { + throw Error.notImplemented('Return data type from host must be Dictionary or int'); + } + } + }) + } + else if (responseCallback) + { + responseCallback(-2, null) + } + }, _dictionaryToDate$i$0: function OSF_DDA_OutlookAppOm$_dictionaryToDate$i$0(input) + { + var retValue=new Date(input['year'], input['month'], input['date'], input['hours'], input['minutes'], input['seconds'], (!input['milliseconds']) ? 0 : input['milliseconds']); + if (isNaN(retValue.getTime())) + { + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + } + return retValue + }, _dateToDictionary$i$0: function OSF_DDA_OutlookAppOm$_dateToDictionary$i$0(input) + { + var retValue={}; + retValue['month']=input.getMonth(); + retValue['date']=input.getDate(); + retValue['year']=input.getFullYear(); + retValue['hours']=input.getHours(); + retValue['minutes']=input.getMinutes(); + retValue['seconds']=input.getSeconds(); + retValue['milliseconds']=input.getMilliseconds(); + return retValue + }, _displayNewAppointmentFormApi$p$0: function OSF_DDA_OutlookAppOm$_displayNewAppointmentFormApi$p$0(parameters) + { + var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['requiredAttendees'], 'requiredAttendees'); + var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['optionalAttendees'], 'optionalAttendees'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['location'], 0, OSF.DDA.OutlookAppOm._maxLocationLength$p, 'location'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['body'], 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'body'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['subject'], 0, OSF.DDA.OutlookAppOm._maxSubjectLength$p, 'subject'); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['start'])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['start'], Date, 'start'); + var startDateTime=parameters['start']; + parameters['start']=startDateTime.getTime(); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['end'])) + { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['end'], Date, 'end'); + var endDateTime=parameters['end']; + if (endDateTime < startDateTime) + { + throw Error.argumentOutOfRange('end', endDateTime, _u.ExtensibilityStrings.l_InvalidEventDates_Text); + } + parameters['end']=endDateTime.getTime() + } + } + var updatedParameters=null; + if (normalizedRequiredAttendees || normalizedOptionalAttendees) + { + updatedParameters={}; + var $$dict_6=parameters; + for (var $$key_7 in $$dict_6) + { + var entry={ + key: $$key_7, value: $$dict_6[$$key_7] + }; + updatedParameters[entry.key]=entry.value + } + if (normalizedRequiredAttendees) + { + updatedParameters['requiredAttendees']=normalizedRequiredAttendees + } + if (normalizedOptionalAttendees) + { + updatedParameters['optionalAttendees']=normalizedOptionalAttendees + } + } + this._invokeHostMethod$i$0(7, 'DisplayNewAppointmentForm', updatedParameters || parameters, null) + }, _initializeMethods$p$0: function OSF_DDA_OutlookAppOm$_initializeMethods$p$0() + { + var currentInstance=this; + if ($h.Item.isInstanceOfType(this._item$p$0)) + { + currentInstance.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0 + } + }, _getInitialDataResponseHandler$p$0: function OSF_DDA_OutlookAppOm$_getInitialDataResponseHandler$p$0(resultCode, data) + { + if (resultCode) + { + return + } + this.initialize(data); + (this).displayName='mailbox'; + window.setTimeout(this.$$d__callAppReadyCallback$p$0, 0) + }, _callAppReadyCallback$p$0: function OSF_DDA_OutlookAppOm$_callAppReadyCallback$p$0() + { + this._appReadyCallback$p$0() + }, _invokeGetTokenMethodAsync$p$0: function OSF_DDA_OutlookAppOm$_invokeGetTokenMethodAsync$p$0(outlookDispid, methodName, callback, userContext) + { + if ($h.ScriptHelpers.isNullOrUndefined(callback)) + { + throw Error.argumentNull('callback'); + } + var $$t_8=this; + this._invokeHostMethod$i$0(outlookDispid, methodName, null, function(resultCode, response) + { + var asyncResult; + if (resultCode) + { + asyncResult=$$t_8.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext) + } + else + { + var responseDictionary=response; + if (responseDictionary['wasSuccessful']) + { + asyncResult=$$t_8.createAsyncResult(responseDictionary['token'], 0, null, userContext) + } + else + { + asyncResult=$$t_8.createAsyncResult(null, 1, responseDictionary['errorMessage'], userContext) + } + } + callback(asyncResult) + }) + }, _getItem$p$0: function OSF_DDA_OutlookAppOm$_getItem$p$0() + { + return this._item$p$0 + }, _getUserProfile$p$0: function OSF_DDA_OutlookAppOm$_getUserProfile$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._userProfile$p$0 + }, _getDiagnostics$p$0: function OSF_DDA_OutlookAppOm$_getDiagnostics$p$0() + { + return this._diagnostics$p$0 + }, _getEwsUrl$p$0: function OSF_DDA_OutlookAppOm$_getEwsUrl$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0); + return this._initialData$p$0.get__ewsUrl$i$0() + }, _findOffset$p$0: function OSF_DDA_OutlookAppOm$_findOffset$p$0(value) + { + var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0(); + for (var r=0; r < ranges.length; r++) + { + var range=ranges[r]; + var start=parseInt(range['start']); + var end=parseInt(range['end']); + if (value.getTime() - start >=0 && value.getTime() - end < 0) + { + return parseInt(range['offset']) + } + } + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + }, _areStringsLoaded$p$0: function OSF_DDA_OutlookAppOm$_areStringsLoaded$p$0() + { + var stringsLoaded=false; + try + { + stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text) + } + catch($$e_1) {} + return stringsLoaded + }, _loadLocalizedScript$p$0: function OSF_DDA_OutlookAppOm$_loadLocalizedScript$p$0(stringLoadedCallback) + { + var url=null; + var baseUrl=''; + var scripts=document.getElementsByTagName('script'); + for (var i=scripts.length - 1; i >=0; i--) + { + var filename=null; + var attributes=scripts[i].attributes; + if (attributes) + { + var attribute=attributes.getNamedItem('src'); + if (attribute) + { + filename=attribute.value + } + if (filename) + { + var debug=false; + filename=filename.toLowerCase(); + var officeIndex=filename.indexOf('office_strings.js'); + if (officeIndex < 0) + { + officeIndex=filename.indexOf('office_strings.debug.js'); + debug=true + } + if ((officeIndex > 0) && (officeIndex < filename.length)) + { + url=filename.replace((debug) ? 'office_strings.debug.js' : 'office_strings.js', 'outlook_strings.js'); + var languageUrl=filename.substring(0, officeIndex); + var lastIndexOfSlash=languageUrl.lastIndexOf('/', languageUrl.length - 2); + if (lastIndexOfSlash===-1) + { + lastIndexOfSlash=languageUrl.lastIndexOf('\\', languageUrl.length - 2) + } + if (lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) + { + baseUrl=languageUrl.substring(0, lastIndexOfSlash+1) + } + break + } + } + } + } + if (url) + { + var head=document.getElementsByTagName('head')[0]; + var scriptElement=null; + var $$t_H=this; + var scriptElementCallback=function() + { + if (stringLoadedCallback && (!scriptElement.readyState || (scriptElement.readyState && (scriptElement.readyState==='loaded' || scriptElement.readyState==='complete')))) + { + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + stringLoadedCallback() + } + }; + var $$t_I=this; + var failureCallback=function() + { + if (!$$t_I._areStringsLoaded$p$0()) + { + var fallbackUrl=baseUrl+'en-us/'+'outlook_strings.js'; + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + head.appendChild(scriptElement) + } + }; + scriptElement=this._createScriptElement$p$0(url); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + window.setTimeout(failureCallback, 2000); + head.appendChild(scriptElement) + } + }, _createScriptElement$p$0: function OSF_DDA_OutlookAppOm$_createScriptElement$p$0(url) + { + var scriptElement=document.createElement('script'); + scriptElement.type='text/javascript'; + scriptElement.src=url; + return scriptElement + } +}; +OSF.DDA.Settings=function OSF_DDA_Settings(data) +{ + this._rawData$p$0=data +}; +OSF.DDA.Settings._convertFromRawSettings$p=function OSF_DDA_Settings$_convertFromRawSettings$p(rawSettings) +{ + if (!rawSettings) + { + return {} + } + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) + { + var outlookSettings=rawSettings['SettingsKey']; + if (outlookSettings) + { + return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings) + } + } + return rawSettings +}; +OSF.DDA.Settings.prototype={ + _rawData$p$0: null, _settingsData$p$0: null, get__data$p$0: function OSF_DDA_Settings$get__data$p$0() + { + if (!this._settingsData$p$0) + { + this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0); + this._rawData$p$0=null + } + return this._settingsData$p$0 + }, get: function OSF_DDA_Settings$get(name) + { + return this.get__data$p$0()[name] + }, set: function OSF_DDA_Settings$set(name, value) + { + this.get__data$p$0()[name]=value + }, remove: function OSF_DDA_Settings$remove(name) + { + delete this.get__data$p$0()[name] + }, saveAsync: function OSF_DDA_Settings$saveAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + var commonParameters=$h.CommonParameters.parse(args, false); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) + { + this._saveSettingsForOwa$p$0(commonParameters.get_callback(), commonParameters._asyncContext$p$0) + } + else + { + this._saveSettingsForOutlook$p$0(commonParameters.get_callback(), commonParameters._asyncContext$p$0) + } + }, _saveSettingsForOutlook$p$0: function OSF_DDA_Settings$_saveSettingsForOutlook$p$0(callback, userContext) + { + var storedException=null; + try + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var jsonSettings=JSON.stringify(serializedSettings); + var settingsObjectToSave={SettingsKey: jsonSettings}; + OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave) + } + catch(ex) + { + storedException=ex + } + if (callback) + { + var asyncResult; + if (storedException) + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, storedException.message, userContext) + } + else + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 0, null, userContext) + } + callback(asyncResult) + } + }, _saveSettingsForOwa$p$0: function OSF_DDA_Settings$_saveSettingsForOwa$p$0(callback, userContext) + { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var $$t_7=this; + OSF._OfficeAppFactory.getClientEndPoint().invoke('saveSettingsAsync', function(resultCode, response) + { + if (callback) + { + var asyncResult; + if (resultCode) + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext) + } + else + { + var responseDictionary=response; + if (!(responseDictionary['error'])) + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 0, null, userContext) + } + else + { + asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, responseDictionary['errorMessage'], userContext) + } + } + callback(asyncResult) + } + }, [serializedSettings]) + } +}; +Type.registerNamespace('$h'); +Type.registerNamespace('Office.cast'); +$h.Appointment=function $h_Appointment(dataDictionary) +{ + this.$$d__getOrganizer$p$2=Function.createDelegate(this, this._getOrganizer$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this, this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this, this._getSubject$p$2); + this.$$d__getResources$p$2=Function.createDelegate(this, this._getResources$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2); + this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2); + $h.Appointment.initializeBase(this, [dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'resources', this.$$d__getResources$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'organizer', this.$$d__getOrganizer$p$2) +}; +$h.Appointment.prototype={ + getEntities: function $h_Appointment$getEntities() + { + return this._data$p$0._getEntities$i$0() + }, getEntitiesByType: function $h_Appointment$getEntitiesByType(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, getRegExMatches: function $h_Appointment$getRegExMatches() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0() + }, getFilteredEntitiesByName: function $h_Appointment$getFilteredEntitiesByName(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, getRegExMatchesByName: function $h_Appointment$getRegExMatchesByName(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, displayReplyForm: function $h_Appointment$displayReplyForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody) + }, displayReplyAllForm: function $h_Appointment$displayReplyAllForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody) + }, getItemType: function $h_Appointment$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, _getStart$p$2: function $h_Appointment$_getStart$p$2() + { + return this._data$p$0.get__start$i$0() + }, _getEnd$p$2: function $h_Appointment$_getEnd$p$2() + { + return this._data$p$0.get__end$i$0() + }, _getLocation$p$2: function $h_Appointment$_getLocation$p$2() + { + return this._data$p$0.get__location$i$0() + }, _getOptionalAttendees$p$2: function $h_Appointment$_getOptionalAttendees$p$2() + { + return this._data$p$0.get__cc$i$0() + }, _getRequiredAttendees$p$2: function $h_Appointment$_getRequiredAttendees$p$2() + { + return this._data$p$0.get__to$i$0() + }, _getResources$p$2: function $h_Appointment$_getResources$p$2() + { + return this._data$p$0.get__resources$i$0() + }, _getSubject$p$2: function $h_Appointment$_getSubject$p$2() + { + return this._data$p$0.get__subject$i$0() + }, _getNormalizedSubject$p$2: function $h_Appointment$_getNormalizedSubject$p$2() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, _getOrganizer$p$2: function $h_Appointment$_getOrganizer$p$2() + { + return this._data$p$0.get__organizer$i$0() + } +}; +$h.AppointmentCompose=function $h_AppointmentCompose(data) +{ + this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2); + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2); + $h.AppointmentCompose.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2) +}; +$h.AppointmentCompose.prototype={ + _requiredAttendees$p$2: null, _optionalAttendees$p$2: null, _start$p$2: null, _end$p$2: null, _location$p$2: null, getItemType: function $h_AppointmentCompose$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment + }, _getRequiredAttendees$p$2: function $h_AppointmentCompose$_getRequiredAttendees$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._requiredAttendees$p$2) + { + this._requiredAttendees$p$2=new $h.ComposeRecipient(0, 'requiredAttendees') + } + return this._requiredAttendees$p$2 + }, _getOptionalAttendees$p$2: function $h_AppointmentCompose$_getOptionalAttendees$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._optionalAttendees$p$2) + { + this._optionalAttendees$p$2=new $h.ComposeRecipient(1, 'optionalAttendees') + } + return this._optionalAttendees$p$2 + }, _getStart$p$2: function $h_AppointmentCompose$_getStart$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._start$p$2) + { + this._start$p$2=new $h.ComposeTime(1) + } + return this._start$p$2 + }, _getEnd$p$2: function $h_AppointmentCompose$_getEnd$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._end$p$2) + { + this._end$p$2=new $h.ComposeTime(2) + } + return this._end$p$2 + }, _getLocation$p$2: function $h_AppointmentCompose$_getLocation$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._location$p$2) + { + this._location$p$2=new $h.ComposeLocation + } + return this._location$p$2 + } +}; +$h.AttachmentDetails=function $h_AttachmentDetails(data) +{ + this.$$d__getIsInline$p$0=Function.createDelegate(this, this._getIsInline$p$0); + this.$$d__getAttachmentType$p$0=Function.createDelegate(this, this._getAttachmentType$p$0); + this.$$d__getSize$p$0=Function.createDelegate(this, this._getSize$p$0); + this.$$d__getContentType$p$0=Function.createDelegate(this, this._getContentType$p$0); + this.$$d__getName$p$0=Function.createDelegate(this, this._getName$p$0); + this.$$d__getId$p$0=Function.createDelegate(this, this._getId$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'id', this.$$d__getId$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'name', this.$$d__getName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contentType', this.$$d__getContentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'size', this.$$d__getSize$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attachmentType', this.$$d__getAttachmentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'isInline', this.$$d__getIsInline$p$0) +}; +$h.AttachmentDetails.prototype={ + _data$p$0: null, _getId$p$0: function $h_AttachmentDetails$_getId$p$0() + { + return this._data$p$0['id'] + }, _getName$p$0: function $h_AttachmentDetails$_getName$p$0() + { + return this._data$p$0['name'] + }, _getContentType$p$0: function $h_AttachmentDetails$_getContentType$p$0() + { + return this._data$p$0['contentType'] + }, _getSize$p$0: function $h_AttachmentDetails$_getSize$p$0() + { + return this._data$p$0['size'] + }, _getAttachmentType$p$0: function $h_AttachmentDetails$_getAttachmentType$p$0() + { + var response=this._data$p$0['attachmentType']; + return (response < $h.AttachmentDetails._attachmentTypeMap$p.length) ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File + }, _getIsInline$p$0: function $h_AttachmentDetails$_getIsInline$p$0() + { + return this._data$p$0['isInline'] + } +}; +$h.ComposeBody=function $h_ComposeBody(){}; +$h.ComposeBody._createParameterDictionaryToHost$p=function $h_ComposeBody$_createParameterDictionaryToHost$p(data, parameters) +{ + var dataToHost={data: data}; + if (parameters._options$p$0 && parameters._options$p$0['coercionType']) + { + var hostCoercionType; + var $$t_4, + $$t_5; + if (!(($$t_5=$h.ComposeBody._tryMapToHostCoercionType$p(parameters._options$p$0['coercionType'], ($$t_4={val: hostCoercionType}))), hostCoercionType=$$t_4.val, $$t_5)) + { + if (parameters.get_callback()) + { + parameters.get_callback()(OSF.DDA.OutlookAppOm._instance$p.standardCreateAsyncResult(null, 1, 1000, parameters._asyncContext$p$0)) + } + return null + } + dataToHost['coercionType']=hostCoercionType + } + else + { + dataToHost['coercionType']=0 + } + return dataToHost +}; +$h.ComposeBody._tryMapToHostCoercionType$p=function $h_ComposeBody$_tryMapToHostCoercionType$p(coercionType, hostCoercionType) +{ + hostCoercionType.val=undefined; + if (coercionType===Microsoft.Office.WebExtension.CoercionType.Html) + { + hostCoercionType.val=3 + } + else if (coercionType===Microsoft.Office.WebExtension.CoercionType.Text) + { + hostCoercionType.val=0 + } + else + { + return false + } + return true +}; +$h.ComposeBody.prototype={ + getTypeAsync: function $h_ComposeBody$getTypeAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'body.getTypeAsync'); + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14, 'GetBodyTypeAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, setSelectedDataAsync: function $h_ComposeBody$setSelectedDataAsync(data) + { + var args=[]; + for (var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + { + args[$$pai_4 - 1]=arguments[$$pai_4] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'body.setSelectedDataAsync'); + var parameters=$h.CommonParameters.parse(args, false); + if (!(String.isInstanceOfType(data))) + { + throw Error.argumentType('data', Object.getType(data), String); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 1000000, 'data'); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$p(data, parameters); + if (!dataToHost) + { + return + } + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13, 'BodySetSelectedDataAsync', dataToHost, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, prependAsync: function $h_ComposeBody$prependAsync(data) + { + var args=[]; + for (var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4) + { + args[$$pai_4 - 1]=arguments[$$pai_4] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'body.prependAsync'); + var parameters=$h.CommonParameters.parse(args, false); + if (!(String.isInstanceOfType(data))) + { + throw Error.argumentType('data', Object.getType(data), String); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 1000000, 'data'); + var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$p(data, parameters); + if (!dataToHost) + { + return + } + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23, 'BodyPrependAsync', dataToHost, null, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeItem=function $h_ComposeItem(data) +{ + this.$$d__getBody$p$1=Function.createDelegate(this, this._getBody$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1); + $h.ComposeItem.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'body', this.$$d__getBody$p$1) +}; +$h.ComposeItem.prototype={ + _subject$p$1: null, _body$p$1: null, addFileAttachmentAsync: function $h_ComposeItem$addFileAttachmentAsync(uri, attachmentName) + { + var args=[]; + for (var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + { + args[$$pai_5 - 2]=arguments[$$pai_5] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'addFileAttachmentAsync'); + if (!$h.ScriptHelpers.isNonEmptyString(uri)) + { + throw Error.argument('uri'); + } + if (!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + { + throw Error.argument('attachmentName'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(uri.length, 0, 2048, 'uri'); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length, 0, 255, 'attachmentName'); + var commonParameters=$h.CommonParameters.parse(args, false); + var parameters={ + uri: uri, name: attachmentName, __timeout__: 600000 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16, 'AddFileAttachmentAsync', parameters, null, commonParameters._asyncContext$p$0, commonParameters.get_callback()) + }, addItemAttachmentAsync: function $h_ComposeItem$addItemAttachmentAsync(itemId, attachmentName) + { + var args=[]; + for (var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5) + { + args[$$pai_5 - 2]=arguments[$$pai_5] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'addItemAttachmentAsync'); + if (!$h.ScriptHelpers.isNonEmptyString(itemId)) + { + throw Error.argument('itemId'); + } + if (!$h.ScriptHelpers.isNonEmptyString(attachmentName)) + { + throw Error.argument('attachmentName'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(itemId.length, 0, 200, 'itemId'); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length, 0, 255, 'attachmentName'); + var commonParameters=$h.CommonParameters.parse(args, false); + var parameters={ + itemId: itemId, name: attachmentName, __timeout__: 600000 + }; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19, 'AddItemAttachmentAsync', parameters, null, commonParameters._asyncContext$p$0, commonParameters.get_callback()) + }, removeAttachmentAsync: function $h_ComposeItem$removeAttachmentAsync(attachmentId) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'removeAttachmentAsync'); + if (!$h.ScriptHelpers.isNonEmptyString(attachmentId)) + { + throw Error.argument('attachmentId'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentId.length, 0, 200, 'attachmentId'); + var commonParameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20, 'RemoveAttachmentAsync', {attachmentIndex: attachmentId}, null, commonParameters._asyncContext$p$0, commonParameters.get_callback()) + }, _getBody$p$1: function $h_ComposeItem$_getBody$p$1() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._body$p$1) + { + this._body$p$1=new $h.ComposeBody + } + return this._body$p$1 + }, _getSubject$p$1: function $h_ComposeItem$_getSubject$p$1() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._subject$p$1) + { + this._subject$p$1=new $h.ComposeSubject + } + return this._subject$p$1 + } +}; +$h.ComposeRecipient=function $h_ComposeRecipient(type, propertyName) +{ + this._type$p$0=type; + this._propertyName$p$0=propertyName +}; +$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function $h_ComposeRecipient$_throwOnInvalidDisplayNameOrEmail$p(displayName, emailAddress) +{ + if (!displayName && !emailAddress) + { + throw Error.argument('recipients'); + } + if (displayName && displayName.length > 255) + { + throw Error.argumentOutOfRange('recipients', displayName.length, _u.ExtensibilityStrings.l_DisplayNameTooLong_Text); + } + if (emailAddress && emailAddress.length > 571) + { + throw Error.argumentOutOfRange('recipients', emailAddress.length, _u.ExtensibilityStrings.l_EmailAddressTooLong_Text); + } +}; +$h.ComposeRecipient._getAsyncFormatter$p=function $h_ComposeRecipient$_getAsyncFormatter$p(rawInput) +{ + var input=rawInput; + var output=[]; + for (var i=0; i < input.length; i++) + { + var email=new $h.EmailAddressDetails(input[i]); + output[i]=email + } + return output +}; +$h.ComposeRecipient._createEmailDictionaryForHost$p=function $h_ComposeRecipient$_createEmailDictionaryForHost$p(address, name) +{ + return { + address: address, name: name + } +}; +$h.ComposeRecipient.prototype={ + _propertyName$p$0: null, _type$p$0: 0, getAsync: function $h_ComposeRecipient$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, this._propertyName$p$0+'.getAsync'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15, 'GetRecipientsAsync', {recipientField: this._type$p$0}, $h.ComposeRecipient._getAsyncFormatter$p, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeRecipient$setAsync(recipients) + { + var args=[]; + for (var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2 - 1]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._propertyName$p$0+'.setAsync'); + this.setAddHelper(recipients, args, true) + }, addAsync: function $h_ComposeRecipient$addAsync(recipients) + { + var args=[]; + for (var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2 - 1]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._propertyName$p$0+'.addAsync'); + this.setAddHelper(recipients, args, false) + }, setAddHelper: function $h_ComposeRecipient$setAddHelper(recipients, args, isSet) + { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(recipients.length, 0, 100, 'recipients'); + var parameters=$h.CommonParameters.parse(args, false); + var recipientData=[]; + if (Array.isInstanceOfType(recipients)) + { + for (var i=0; i < recipients.length; i++) + { + if (String.isInstanceOfType(recipients[i])) + { + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i], recipients[i]); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i], recipients[i]) + } + else if ($h.EmailAddressDetails.isInstanceOfType(recipients[i])) + { + var address=recipients[i]; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address.displayName, address.emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address.emailAddress, address.displayName) + } + else if (Object.isInstanceOfType(recipients[i])) + { + var input=recipients[i]; + var emailAddress=input['emailAddress']; + var displayName=input['displayName']; + $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName, emailAddress); + recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress, displayName) + } + else + { + throw Error.argument('recipients'); + } + } + } + else + { + throw Error.argument('recipients'); + } + var $$t_B=this; + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0((isSet) ? 21 : 22, (isSet) ? 'SetRecipientsAsync' : 'AddRecipientsAsync', { + recipientField: this._type$p$0, recipientArray: recipientData + }, function(rawInput) + { + return rawInput + }, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeRecipient.RecipientField=function(){}; +$h.ComposeRecipient.RecipientField.prototype={ + to: 0, cc: 1, bcc: 2, requiredAttendees: 0, optionalAttendees: 1 +}; +$h.ComposeRecipient.RecipientField.registerEnum('$h.ComposeRecipient.RecipientField', false); +$h.ComposeLocation=function $h_ComposeLocation(){}; +$h.ComposeLocation.prototype={ + getAsync: function $h_ComposeLocation$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'location.getAsync'); + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26, 'GetLocationAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeLocation$setAsync(location) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'location.setAsync'); + var parameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(location.length, 0, 255, 'location'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27, 'SetLocationAsync', {location: location}, null, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeSubject=function $h_ComposeSubject(){}; +$h.ComposeSubject.prototype={ + getAsync: function $h_ComposeSubject$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'subject.getAsync'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18, 'GetSubjectAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeSubject$setAsync(data) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + var parameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'subject.setAsync'); + if (!(String.isInstanceOfType(data))) + { + throw Error.argument('data'); + } + OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 255, 'data'); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17, 'SetSubjectAsync', {subject: data}, null, parameters._asyncContext$p$0, parameters.get_callback()) + } +}; +$h.ComposeTime=function $h_ComposeTime(type) +{ + this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this, this._ticksToDateFormatter$p$0); + this._timeType$p$0=type +}; +$h.ComposeTime.prototype={ + _timeType$p$0: 0, getAsync: function $h_ComposeTime$getAsync() + { + var args=[]; + for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2) + { + args[$$pai_2]=arguments[$$pai_2] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, this._getPropertyName$p$0()+'.getAsync'); + var parameters=$h.CommonParameters.parse(args, true); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24, 'GetTimeAsync', {TimeProperty: this._timeType$p$0}, this.$$d__ticksToDateFormatter$p$0, parameters._asyncContext$p$0, parameters.get_callback()) + }, setAsync: function $h_ComposeTime$setAsync(dateTime) + { + var args=[]; + for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3 - 1]=arguments[$$pai_3] + } + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._getPropertyName$p$0()+'.setAsync'); + if (!(Date.isInstanceOfType(dateTime))) + { + throw Error.argumentType('dateTime', Object.getType(dateTime), Date); + } + var parameters=$h.CommonParameters.parse(args, false); + OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25, 'SetTimeAsync', { + TimeProperty: this._timeType$p$0, time: dateTime.getTime() + }, null, parameters._asyncContext$p$0, parameters.get_callback()) + }, _ticksToDateFormatter$p$0: function $h_ComposeTime$_ticksToDateFormatter$p$0(rawInput) + { + var ticks=rawInput; + return new Date(ticks) + }, _getPropertyName$p$0: function $h_ComposeTime$_getPropertyName$p$0() + { + return (this._timeType$p$0===1) ? 'start' : 'end' + } +}; +$h.ComposeTime.TimeType=function(){}; +$h.ComposeTime.TimeType.prototype={ + start: 1, end: 2 +}; +$h.ComposeTime.TimeType.registerEnum('$h.ComposeTime.TimeType', false); +$h.Contact=function $h_Contact(data) +{ + this.$$d__getContactString$p$0=Function.createDelegate(this, this._getContactString$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getBusinessName$p$0=Function.createDelegate(this, this._getBusinessName$p$0); + this.$$d__getPersonName$p$0=Function.createDelegate(this, this._getPersonName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'personName', this.$$d__getPersonName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'businessName', this.$$d__getBusinessName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contactString', this.$$d__getContactString$p$0) +}; +$h.Contact.prototype={ + _data$p$0: null, _phoneNumbers$p$0: null, _getPersonName$p$0: function $h_Contact$_getPersonName$p$0() + { + return this._data$p$0['PersonName'] + }, _getBusinessName$p$0: function $h_Contact$_getBusinessName$p$0() + { + return this._data$p$0['BusinessName'] + }, _getAddresses$p$0: function $h_Contact$_getAddresses$p$0() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses') + }, _getEmailAddresses$p$0: function $h_Contact$_getEmailAddresses$p$0() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses') + }, _getUrls$p$0: function $h_Contact$_getUrls$p$0() + { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls') + }, _getPhoneNumbers$p$0: function $h_Contact$_getPhoneNumbers$p$0() + { + if (!this._phoneNumbers$p$0) + { + var $$t_1=this; + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', function(data) + { + return new $h.PhoneNumber(data) + }) + } + return this._phoneNumbers$p$0 + }, _getContactString$p$0: function $h_Contact$_getContactString$p$0() + { + return this._data$p$0['ContactString'] + } +}; +$h.CustomProperties=function $h_CustomProperties(data) +{ + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + throw Error.argumentNull('data'); + } + if (Array.isInstanceOfType(data)) + { + var customPropertiesArray=data; + if (customPropertiesArray.length > 0) + { + this._data$p$0=customPropertiesArray[0] + } + else + { + throw Error.argument('data'); + } + } + else + { + this._data$p$0=data + } +}; +$h.CustomProperties.prototype={ + _data$p$0: null, get: function $h_CustomProperties$get(name) + { + var value=this._data$p$0[name]; + if (typeof(value)==='string') + { + var valueString=value; + if (valueString.length > 6 && valueString.startsWith('Date(') && valueString.endsWith(')')) + { + var ticksString=valueString.substring(5, valueString.length - 1); + var ticks=parseInt(ticksString); + if (!isNaN(ticks)) + { + var dateTimeValue=new Date(ticks); + if (dateTimeValue) + { + value=dateTimeValue + } + } + } + } + return value + }, set: function $h_CustomProperties$set(name, value) + { + if (OSF.OUtil.isDate(value)) + { + value='Date('+(value).getTime()+')' + } + this._data$p$0[name]=value + }, remove: function $h_CustomProperties$remove(name) + { + delete this._data$p$0[name] + }, saveAsync: function $h_CustomProperties$saveAsync() + { + var args=[]; + for (var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) + { + args[$$pai_4]=arguments[$$pai_4] + } + var MaxCustomPropertiesLength=2500; + if (JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) + { + throw Error.argument(); + } + var parameters=$h.CommonParameters.parse(args, false, true); + var saveCustomProperties=new $h._saveDictionaryRequest(parameters.get_callback(), parameters._asyncContext$p$0); + saveCustomProperties._sendRequest$i$0(4, 'SaveCustomProperties', {customProperties: this._data$p$0}) + } +}; +$h.Diagnostics=function $h_Diagnostics(data, appName) +{ + this.$$d__getOwaView$p$0=Function.createDelegate(this, this._getOwaView$p$0); + this.$$d__getHostVersion$p$0=Function.createDelegate(this, this._getHostVersion$p$0); + this.$$d__getHostName$p$0=Function.createDelegate(this, this._getHostName$p$0); + this._data$p$0=data; + this._appName$p$0=appName; + $h.InitialData._defineReadOnlyProperty$i(this, 'hostName', this.$$d__getHostName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'hostVersion', this.$$d__getHostVersion$p$0); + if (64===this._appName$p$0) + { + $h.InitialData._defineReadOnlyProperty$i(this, 'OWAView', this.$$d__getOwaView$p$0) + } +}; +$h.Diagnostics.prototype={ + _data$p$0: null, _appName$p$0: 0, _getHostName$p$0: function $h_Diagnostics$_getHostName$p$0() + { + if (8===this._appName$p$0) + { + return 'Outlook' + } + else if (64===this._appName$p$0) + { + return 'OutlookWebApp' + } + return null + }, _getHostVersion$p$0: function $h_Diagnostics$_getHostVersion$p$0() + { + return this._data$p$0.get__hostVersion$i$0() + }, _getOwaView$p$0: function $h_Diagnostics$_getOwaView$p$0() + { + return this._data$p$0.get__owaView$i$0() + } +}; +$h.EmailAddressDetails=function $h_EmailAddressDetails(data) +{ + this.$$d__getRecipientType$p$0=Function.createDelegate(this, this._getRecipientType$p$0); + this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this, this._getAppointmentResponse$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'appointmentResponse')) + { + $h.InitialData._defineReadOnlyProperty$i(this, 'appointmentResponse', this.$$d__getAppointmentResponse$p$0) + } + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'recipientType')) + { + $h.InitialData._defineReadOnlyProperty$i(this, 'recipientType', this.$$d__getRecipientType$p$0) + } +}; +$h.EmailAddressDetails._createFromEmailUserDictionary$i=function $h_EmailAddressDetails$_createFromEmailUserDictionary$i(data) +{ + var emailAddressDetailsDictionary={}; + var displayName=data['Name']; + var emailAddress=data['UserId']; + emailAddressDetailsDictionary['name']=displayName || $h.EmailAddressDetails._emptyString$p; + emailAddressDetailsDictionary['address']=emailAddress || $h.EmailAddressDetails._emptyString$p; + return new $h.EmailAddressDetails(emailAddressDetailsDictionary) +}; +$h.EmailAddressDetails.prototype={ + _data$p$0: null, toJSON: function $h_EmailAddressDetails$toJSON() + { + var result={}; + result['emailAddress']=this._getEmailAddress$p$0(); + result['displayName']=this._getDisplayName$p$0(); + if ($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0, 'appointmentResponse')) + { + result['appointmentResponse']=this._getAppointmentResponse$p$0() + } + if ($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0, 'recipientType')) + { + result['recipientType']=this._getRecipientType$p$0() + } + return result + }, _getEmailAddress$p$0: function $h_EmailAddressDetails$_getEmailAddress$p$0() + { + return this._data$p$0['address'] + }, _getDisplayName$p$0: function $h_EmailAddressDetails$_getDisplayName$p$0() + { + return this._data$p$0['name'] + }, _getAppointmentResponse$p$0: function $h_EmailAddressDetails$_getAppointmentResponse$p$0() + { + var response=this._data$p$0['appointmentResponse']; + return (response < $h.EmailAddressDetails._responseTypeMap$p.length) ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None + }, _getRecipientType$p$0: function $h_EmailAddressDetails$_getRecipientType$p$0() + { + var response=this._data$p$0['recipientType']; + return (response < $h.EmailAddressDetails._recipientTypeMap$p.length) ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other + } +}; +$h.Entities=function $h_Entities(data, filteredEntitiesData, timeSent, permissionLevel) +{ + this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this, this._createMeetingSuggestion$p$0); + this.$$d__getContacts$p$0=Function.createDelegate(this, this._getContacts$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this, this._getMeetingSuggestions$p$0); + this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this, this._getTaskSuggestions$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this._data$p$0=data || {}; + this._filteredData$p$0=filteredEntitiesData || {}; + this._dateTimeSent$p$0=timeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'taskSuggestions', this.$$d__getTaskSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingSuggestions', this.$$d__getMeetingSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contacts', this.$$d__getContacts$p$0); + this._permissionLevel$p$0=permissionLevel +}; +$h.Entities._getExtractedObjects$i=function $h_Entities$_getExtractedObjects$i(T, data, name, creator, removeDuplicates, stringPropertyName) +{ + var results=null; + var extractedObjects=data[name]; + if (!extractedObjects) + { + return new Array(0) + } + if (removeDuplicates) + { + extractedObjects=$h.Entities._removeDuplicate$p(Object, extractedObjects, $h.Entities._entityDictionaryEquals$p, stringPropertyName) + } + results=new Array(extractedObjects.length); + var count=0; + for (var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) + { + var extractedObject=$$arr_9[$$idx_B]; + results[count++]=creator(extractedObject) + } + return results +}; +$h.Entities._getExtractedStringProperty$i=function $h_Entities$_getExtractedStringProperty$i(data, name, removeDuplicate) +{ + var extractedProperties=data[name]; + if (!extractedProperties) + { + return new Array(0) + } + if (removeDuplicate) + { + extractedProperties=$h.Entities._removeDuplicate$p(String, extractedProperties, $h.Entities._stringEquals$p, null) + } + return extractedProperties +}; +$h.Entities._createContact$p=function $h_Entities$_createContact$p(data) +{ + return new $h.Contact(data) +}; +$h.Entities._createTaskSuggestion$p=function $h_Entities$_createTaskSuggestion$p(data) +{ + return new $h.TaskSuggestion(data) +}; +$h.Entities._createPhoneNumber$p=function $h_Entities$_createPhoneNumber$p(data) +{ + return new $h.PhoneNumber(data) +}; +$h.Entities._entityDictionaryEquals$p=function $h_Entities$_entityDictionaryEquals$p(dictionary1, dictionary2, entityPropertyIdentifier) +{ + if (dictionary1===dictionary2) + { + return true + } + if (!dictionary1 || !dictionary2) + { + return false + } + if (dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) + { + return true + } + return false +}; +$h.Entities._stringEquals$p=function $h_Entities$_stringEquals$p(string1, string2, entityProperty) +{ + return string1===string2 +}; +$h.Entities._removeDuplicate$p=function $h_Entities$_removeDuplicate$p(T, array, entityEquals, entityPropertyIdentifier) +{ + for (var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) + { + var removeMatch=false; + for (var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) + { + if (entityEquals(array[matchIndex1], array[matchIndex2], entityPropertyIdentifier)) + { + removeMatch=true; + break + } + } + if (removeMatch) + { + Array.removeAt(array, matchIndex1) + } + } + return array +}; +$h.Entities.prototype={ + _dateTimeSent$p$0: null, _data$p$0: null, _filteredData$p$0: null, _filteredEntitiesCache$p$0: null, _permissionLevel$p$0: 0, _taskSuggestions$p$0: null, _meetingSuggestions$p$0: null, _phoneNumbers$p$0: null, _contacts$p$0: null, _addresses$p$0: null, _emailAddresses$p$0: null, _urls$p$0: null, _getByType$i$0: function $h_Entities$_getByType$i$0(entityType) + { + if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) + { + return this._getMeetingSuggestions$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) + { + return this._getTaskSuggestions$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) + { + return this._getAddresses$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) + { + return this._getPhoneNumbers$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) + { + return this._getEmailAddresses$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) + { + return this._getUrls$p$0() + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) + { + return this._getContacts$p$0() + } + return null + }, _getFilteredEntitiesByName$i$0: function $h_Entities$_getFilteredEntitiesByName$i$0(name) + { + if (!this._filteredEntitiesCache$p$0) + { + this._filteredEntitiesCache$p$0={} + } + if (!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0, name)) + { + var found=false; + for (var i=0; i < $h.Entities._allEntityKeys$p.length; i++) + { + var entityTypeKey=$h.Entities._allEntityKeys$p[i]; + var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey]; + if (!perEntityTypeDictionary) + { + continue + } + if ($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary, name)) + { + switch (entityTypeKey) + { + case'EmailAddresses': + case'Urls': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name); + break; + case'Addresses': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name, true); + break; + case'PhoneNumbers': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber, perEntityTypeDictionary, name, $h.Entities._createPhoneNumber$p, false, null); + break; + case'TaskSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, perEntityTypeDictionary, name, $h.Entities._createTaskSuggestion$p, true, 'TaskString'); + break; + case'MeetingSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, perEntityTypeDictionary, name, this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString'); + break; + case'Contacts': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact, perEntityTypeDictionary, name, $h.Entities._createContact$p, true, 'ContactString'); + break + } + found=true; + break + } + } + if (!found) + { + this._filteredEntitiesCache$p$0[name]=null + } + } + return this._filteredEntitiesCache$p$0[name] + }, _createMeetingSuggestion$p$0: function $h_Entities$_createMeetingSuggestion$p$0(data) + { + return new $h.MeetingSuggestion(data, this._dateTimeSent$p$0) + }, _getAddresses$p$0: function $h_Entities$_getAddresses$p$0() + { + if (!this._addresses$p$0) + { + this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses', true) + } + return this._addresses$p$0 + }, _getEmailAddresses$p$0: function $h_Entities$_getEmailAddresses$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._emailAddresses$p$0) + { + this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses', false) + } + return this._emailAddresses$p$0 + }, _getUrls$p$0: function $h_Entities$_getUrls$p$0() + { + if (!this._urls$p$0) + { + this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls', false) + } + return this._urls$p$0 + }, _getPhoneNumbers$p$0: function $h_Entities$_getPhoneNumbers$p$0() + { + if (!this._phoneNumbers$p$0) + { + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', $h.Entities._createPhoneNumber$p) + } + return this._phoneNumbers$p$0 + }, _getTaskSuggestions$p$0: function $h_Entities$_getTaskSuggestions$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._taskSuggestions$p$0) + { + this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, this._data$p$0, 'TaskSuggestions', $h.Entities._createTaskSuggestion$p, true, 'TaskString') + } + return this._taskSuggestions$p$0 + }, _getMeetingSuggestions$p$0: function $h_Entities$_getMeetingSuggestions$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._meetingSuggestions$p$0) + { + this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, this._data$p$0, 'MeetingSuggestions', this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString') + } + return this._meetingSuggestions$p$0 + }, _getContacts$p$0: function $h_Entities$_getContacts$p$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._contacts$p$0) + { + this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact, this._data$p$0, 'Contacts', $h.Entities._createContact$p, true, 'ContactString') + } + return this._contacts$p$0 + } +}; +Office.cast.item=function Office_cast_item(){}; +Office.cast.item.toItemRead=function Office_cast_item$toItemRead(item) +{ + if ($h.Item.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toItemCompose=function Office_cast_item$toItemCompose(item) +{ + if ($h.ComposeItem.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toMessage=function Office_cast_item$toMessage(item) +{ + return Office.cast.item.toMessageRead(item) +}; +Office.cast.item.toMessageRead=function Office_cast_item$toMessageRead(item) +{ + if ($h.Message.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toMessageCompose=function Office_cast_item$toMessageCompose(item) +{ + if ($h.MessageCompose.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toMeetingRequest=function Office_cast_item$toMeetingRequest(item) +{ + if ($h.MeetingRequest.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toAppointment=function Office_cast_item$toAppointment(item) +{ + return Office.cast.item.toAppointmentRead(item) +}; +Office.cast.item.toAppointmentRead=function Office_cast_item$toAppointmentRead(item) +{ + if ($h.Appointment.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +Office.cast.item.toAppointmentCompose=function Office_cast_item$toAppointmentCompose(item) +{ + if ($h.AppointmentCompose.isInstanceOfType(item)) + { + return item + } + throw Error.argumentType(); +}; +$h.Item=function $h_Item(data) +{ + this.$$d__getAttachments$p$1=Function.createDelegate(this, this._getAttachments$p$1); + this.$$d__getItemClass$p$1=Function.createDelegate(this, this._getItemClass$p$1); + this.$$d__getItemId$p$1=Function.createDelegate(this, this._getItemId$p$1); + this.$$d__getDateTimeModified$p$1=Function.createDelegate(this, this._getDateTimeModified$p$1); + this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this, this._getDateTimeCreated$p$1); + $h.Item.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeCreated', this.$$d__getDateTimeCreated$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeModified', this.$$d__getDateTimeModified$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemId', this.$$d__getItemId$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemClass', this.$$d__getItemClass$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'attachments', this.$$d__getAttachments$p$1) +}; +$h.Item.prototype={ + _getItemId$p$1: function $h_Item$_getItemId$p$1() + { + return this._data$p$0.get__itemId$i$0() + }, _getItemClass$p$1: function $h_Item$_getItemClass$p$1() + { + return this._data$p$0.get__itemClass$i$0() + }, _getDateTimeCreated$p$1: function $h_Item$_getDateTimeCreated$p$1() + { + return this._data$p$0.get__dateTimeCreated$i$0() + }, _getDateTimeModified$p$1: function $h_Item$_getDateTimeModified$p$1() + { + return this._data$p$0.get__dateTimeModified$i$0() + }, _getAttachments$p$1: function $h_Item$_getAttachments$p$1() + { + return this._data$p$0.get__attachments$i$0() + } +}; +$h.ItemBase=function $h_ItemBase(data) +{ + this.$$d__createCustomProperties$i$0=Function.createDelegate(this, this._createCustomProperties$i$0); + this.$$d_getItemType=Function.createDelegate(this, this.getItemType); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'itemType', this.$$d_getItemType) +}; +$h.ItemBase.prototype={ + _data$p$0: null, get_data: function $h_ItemBase$get_data() + { + return this._data$p$0 + }, loadCustomPropertiesAsync: function $h_ItemBase$loadCustomPropertiesAsync() + { + var args=[]; + for (var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3) + { + args[$$pai_3]=arguments[$$pai_3] + } + var parameters=$h.CommonParameters.parse(args, true, true); + var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0, 'customProperties', parameters.get_callback(), parameters._asyncContext$p$0); + loadCustomProperties._sendRequest$i$0(3, 'LoadCustomProperties', {}) + }, _createCustomProperties$i$0: function $h_ItemBase$_createCustomProperties$i$0(data) + { + return new $h.CustomProperties(data) + } +}; +$h.MeetingRequest=function $h_MeetingRequest(data) +{ + this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this, this._getRequiredAttendees$p$3); + this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this, this._getOptionalAttendees$p$3); + this.$$d__getLocation$p$3=Function.createDelegate(this, this._getLocation$p$3); + this.$$d__getEnd$p$3=Function.createDelegate(this, this._getEnd$p$3); + this.$$d__getStart$p$3=Function.createDelegate(this, this._getStart$p$3); + $h.MeetingRequest.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$3); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$3) +}; +$h.MeetingRequest.prototype={ + _getStart$p$3: function $h_MeetingRequest$_getStart$p$3() + { + return this._data$p$0.get__start$i$0() + }, _getEnd$p$3: function $h_MeetingRequest$_getEnd$p$3() + { + return this._data$p$0.get__end$i$0() + }, _getLocation$p$3: function $h_MeetingRequest$_getLocation$p$3() + { + return this._data$p$0.get__location$i$0() + }, _getOptionalAttendees$p$3: function $h_MeetingRequest$_getOptionalAttendees$p$3() + { + return this._data$p$0.get__cc$i$0() + }, _getRequiredAttendees$p$3: function $h_MeetingRequest$_getRequiredAttendees$p$3() + { + return this._data$p$0.get__to$i$0() + } +}; +$h.MeetingSuggestion=function $h_MeetingSuggestion(data, dateTimeSent) +{ + this.$$d__getEndTime$p$0=Function.createDelegate(this, this._getEndTime$p$0); + this.$$d__getStartTime$p$0=Function.createDelegate(this, this._getStartTime$p$0); + this.$$d__getSubject$p$0=Function.createDelegate(this, this._getSubject$p$0); + this.$$d__getLocation$p$0=Function.createDelegate(this, this._getLocation$p$0); + this.$$d__getAttendees$p$0=Function.createDelegate(this, this._getAttendees$p$0); + this.$$d__getMeetingString$p$0=Function.createDelegate(this, this._getMeetingString$p$0); + this._data$p$0=data; + this._dateTimeSent$p$0=dateTimeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingString', this.$$d__getMeetingString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attendees', this.$$d__getAttendees$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStartTime$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEndTime$p$0) +}; +$h.MeetingSuggestion.prototype={ + _dateTimeSent$p$0: null, _data$p$0: null, _attendees$p$0: null, _getMeetingString$p$0: function $h_MeetingSuggestion$_getMeetingString$p$0() + { + return this._data$p$0['MeetingString'] + }, _getLocation$p$0: function $h_MeetingSuggestion$_getLocation$p$0() + { + return this._data$p$0['Location'] + }, _getSubject$p$0: function $h_MeetingSuggestion$_getSubject$p$0() + { + return this._data$p$0['Subject'] + }, _getStartTime$p$0: function $h_MeetingSuggestion$_getStartTime$p$0() + { + var time=this._createDateTimeFromParameter$p$0('StartTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) + { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)) + } + return time + }, _getEndTime$p$0: function $h_MeetingSuggestion$_getEndTime$p$0() + { + var time=this._createDateTimeFromParameter$p$0('EndTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) + { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)) + } + return time + }, _createDateTimeFromParameter$p$0: function $h_MeetingSuggestion$_createDateTimeFromParameter$p$0(keyName) + { + var dateTimeString=this._data$p$0[keyName]; + if (!dateTimeString) + { + return null + } + return new Date(dateTimeString) + }, _getAttendees$p$0: function $h_MeetingSuggestion$_getAttendees$p$0() + { + if (!this._attendees$p$0) + { + var $$t_1=this; + this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Attendees', function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._attendees$p$0 + } +}; +$h.MeetingSuggestionTimeDecoder=function $h_MeetingSuggestionTimeDecoder(){}; +$h.MeetingSuggestionTimeDecoder.resolve=function $h_MeetingSuggestionTimeDecoder$resolve(inTime, sentTime) +{ + if (!sentTime) + { + return inTime + } + try + { + var tod; + var outDate; + var extractedDate; + var sentDate=new Date(sentTime.getFullYear(), sentTime.getMonth(), sentTime.getDate(), 0, 0, 0, 0); + var $$t_7, + $$t_8, + $$t_9; + if (!(($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime, ($$t_7={val: extractedDate}), ($$t_8={val: tod}))), extractedDate=$$t_7.val, tod=$$t_8.val, $$t_9)) + { + return inTime + } + else + { + if ($h._preciseDate.isInstanceOfType(extractedDate)) + { + outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate, extractedDate) + } + else + { + if ($h._relativeDate.isInstanceOfType(extractedDate)) + { + outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate, extractedDate) + } + else + { + outDate=sentDate + } + } + if (isNaN(outDate.getTime())) + { + return sentTime + } + outDate.setMilliseconds(outDate.getMilliseconds()+tod); + return outDate + } + } + catch($$e_6) + { + return sentTime + } +}; +$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function $h_MeetingSuggestionTimeDecoder$_isNullOrUndefined$i(value) +{ + return null===value || value===undefined +}; +$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_resolvePreciseDate$p(sentDate, precise) +{ + var year=precise._year$i$1; + var month=(!precise._month$i$1) ? sentDate.getMonth() : precise._month$i$1 - 1; + var day=precise._day$i$1; + if (!day) + { + return sentDate + } + var candidate; + if ($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + candidate=new Date(sentDate.getFullYear(), month, day); + if (candidate.getTime() < sentDate.getTime()) + { + candidate=new Date(sentDate.getFullYear()+1, month, day) + } + } + else + { + candidate=new Date((year < 50) ? 2000+year : 1900+year, month, day) + } + if (candidate.getMonth() !==month) + { + return sentDate + } + return candidate +}; +$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_resolveRelativeDate$p(sentDate, relative) +{ + var date; + switch (relative._unit$i$1) + { + case 0: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(date.getDate()+relative._offset$i$1); + return date; + case 5: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate, relative._offset$i$1, relative._tag$i$1); + case 2: + var days=1; + switch (relative._modifier$i$1) + { + case 1: + break; + case 2: + days=16; + break; + default: + if (!relative._offset$i$1) + { + days=sentDate.getDate() + } + break + } + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), days); + date.setMonth(date.getMonth()+relative._offset$i$1); + if (date.getTime() < sentDate.getTime()) + { + date.setDate(date.getDate()+sentDate.getDate() - 1) + } + return date; + case 1: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(sentDate.getDate()+(7 * relative._offset$i$1)); + if (relative._modifier$i$1===1 || !relative._modifier$i$1) + { + date.setDate(date.getDate()+1 - date.getDay()); + if (date.getTime() < sentDate.getTime()) + { + return sentDate + } + return date + } + else if (relative._modifier$i$1===2) + { + date.setDate(date.getDate()+5 - date.getDay()); + return date + } + break; + case 4: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate, relative); + case 3: + if (relative._offset$i$1 > 0) + { + return new Date(sentDate.getFullYear()+relative._offset$i$1, 0, 1) + } + break; + default: + break + } + return sentDate +}; +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekDate$p(sentDate, offset, tag) +{ + if (offset > -5 && offset < 5) + { + var dayOfWeek; + var days; + dayOfWeek=((tag+6) % 7)+1; + days=(7 * offset)+(dayOfWeek - sentDate.getDay()); + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } + else + { + var days=(tag - sentDate.getDay()) % 7; + if (days < 0) + { + days+=7 + } + sentDate.setDate(sentDate.getDate()+days); + return sentDate + } +}; +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekOfMonthDate$p(sentDate, relative) +{ + var date; + var firstDay; + var newDate; + date=sentDate; + if (relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) + { + return sentDate + } + var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12; + firstDay=new Date(date.getFullYear(), date.getMonth()+monthOffset, 1); + if (relative._modifier$i$1===1) + { + if (relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay() !==0) + { + return firstDay + } + else + { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), firstDay.getDate()); + newDate.setDate(newDate.getDate()+((7+(1 - firstDay.getDay())) % 7)); + if (firstDay.getDay() !==6 && firstDay.getDay() !==0 && firstDay.getDay() !==1) + { + newDate.setDate(newDate.getDate() - 7) + } + newDate.setDate(newDate.getDate()+(7 * (relative._offset$i$1 - 1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) + { + return sentDate + } + return newDate + } + } + else + { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), $h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(), firstDay.getFullYear())); + var offset=1 - newDate.getDay(); + if (offset > 0) + { + offset=offset - 7 + } + newDate.setDate(newDate.getDate()+offset); + newDate.setDate(newDate.getDate()+(7 * (1 - relative._offset$i$1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) + { + if (firstDay.getDay() !==6 && firstDay.getDay() !==0) + { + return firstDay + } + else + { + return sentDate + } + } + else + { + return newDate + } + } +}; +$h.MeetingSuggestionTimeDecoder._decode$p=function $h_MeetingSuggestionTimeDecoder$_decode$p(inDate, date, time) +{ + var DateValueMask=32767; + date.val=null; + time.val=0; + if (!inDate) + { + return false + } + time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate); + var inDateAtMidnight=inDate.getTime() - time.val; + var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 86400000; + if (value < 0) + { + return false + } + else if (value >=262144) + { + return false + } + else + { + var type=value >> 15; + value=value & DateValueMask; + switch (type) + { + case 0: + return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value, date); + case 1: + return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value, date); + default: + return false + } + } +}; +$h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_decodePreciseDate$p(value, date) +{ + var c_SubTypeMask=7; + var c_MonthMask=15; + var c_DayMask=31; + var c_YearMask=127; + var year=null; + var month=0; + var day=0; + date.val=null; + var subType=(value >> 12) & c_SubTypeMask; + if ((subType & 4)===4) + { + year=(value >> 5) & c_YearMask; + if ((subType & 2)===2) + { + if ((subType & 1)===1) + { + return false + } + month=(value >> 1) & c_MonthMask + } + } + else + { + if ((subType & 2)===2) + { + month=(value >> 8) & c_MonthMask + } + if ((subType & 1)===1) + { + day=(value >> 3) & c_DayMask + } + } + date.val=new $h._preciseDate(day, month, year); + return true +}; +$h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_decodeRelativeDate$p(value, date) +{ + var TagMask=15; + var OffsetMask=63; + var UnitMask=7; + var ModifierMask=3; + var tag=value & TagMask; + value >>=4; + var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask, 6); + value >>=6; + var unit=value & UnitMask; + value >>=3; + var modifier=value & ModifierMask; + try + { + date.val=new $h._relativeDate(modifier, offset, unit, tag); + return true + } + catch($$e_A) + { + date.val=null; + return false + } +}; +$h.MeetingSuggestionTimeDecoder._fromComplement$p=function $h_MeetingSuggestionTimeDecoder$_fromComplement$p(value, n) +{ + var signed=1 << (n - 1); + var mask=(1 << n) - 1; + if ((value & signed)===signed) + { + return -((value ^ mask)+1) + } + else + { + return value + } +}; +$h.MeetingSuggestionTimeDecoder._daysInMonth$p=function $h_MeetingSuggestionTimeDecoder$_daysInMonth$p(month, year) +{ + return 32 - new Date(year, month, 32).getDate() +}; +$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function $h_MeetingSuggestionTimeDecoder$_getTimeOfDayInMillisecondsUTC$p(inputTime) +{ + var timeOfDay=0; + timeOfDay+=inputTime.getUTCHours() * 3600; + timeOfDay+=inputTime.getUTCMinutes() * 60; + timeOfDay+=inputTime.getUTCSeconds(); + timeOfDay *=1000; + timeOfDay+=inputTime.getUTCMilliseconds(); + return timeOfDay +}; +$h._extractedDate=function $h__extractedDate(){}; +$h._preciseDate=function $h__preciseDate(day, month, year) +{ + $h._preciseDate.initializeBase(this); + if (day < 0 || day > 31) + { + throw Error.argumentOutOfRange('day'); + } + if (month < 0 || month > 12) + { + throw Error.argumentOutOfRange('month'); + } + this._day$i$1=day; + this._month$i$1=month; + if (!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) + { + if (!month && day) + { + throw Error.argument('Invalid arguments'); + } + if (year < 0 || year > 2099) + { + throw Error.argumentOutOfRange('year'); + } + this._year$i$1=year % 100 + } + else if (!this._month$i$1 && !this._day$i$1) + { + throw Error.argument('Invalid datetime'); + } +}; +$h._preciseDate.prototype={ + _day$i$1: 0, _month$i$1: 0, _year$i$1: null +}; +$h._relativeDate=function $h__relativeDate(modifier, offset, unit, tag) +{ + $h._relativeDate.initializeBase(this); + if (offset < -32 || offset > 31) + { + throw Error.argumentOutOfRange('offset'); + } + if (tag < 0 || tag > 15) + { + throw Error.argumentOutOfRange('tag'); + } + if (!unit && offset < 0) + { + throw Error.argument('unit & offset do not form a valid date'); + } + this._modifier$i$1=modifier; + this._offset$i$1=offset; + this._unit$i$1=unit; + this._tag$i$1=tag +}; +$h._relativeDate.prototype={ + _modifier$i$1: 0, _offset$i$1: 0, _unit$i$1: 0, _tag$i$1: 0 +}; +$h.Message=function $h_Message(dataDictionary) +{ + this.$$d__getConversationId$p$2=Function.createDelegate(this, this._getConversationId$p$2); + this.$$d__getInternetMessageId$p$2=Function.createDelegate(this, this._getInternetMessageId$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this, this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this, this._getTo$p$2); + this.$$d__getFrom$p$2=Function.createDelegate(this, this._getFrom$p$2); + this.$$d__getSender$p$2=Function.createDelegate(this, this._getSender$p$2); + this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this, this._getNormalizedSubject$p$2); + this.$$d__getSubject$p$2=Function.createDelegate(this, this._getSubject$p$2); + $h.Message.initializeBase(this, [dataDictionary]); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'sender', this.$$d__getSender$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'from', this.$$d__getFrom$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'internetMessageId', this.$$d__getInternetMessageId$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$2) +}; +$h.Message.prototype={ + getEntities: function $h_Message$getEntities() + { + return this._data$p$0._getEntities$i$0() + }, getEntitiesByType: function $h_Message$getEntitiesByType(entityType) + { + return this._data$p$0._getEntitiesByType$i$0(entityType) + }, getFilteredEntitiesByName: function $h_Message$getFilteredEntitiesByName(name) + { + return this._data$p$0._getFilteredEntitiesByName$i$0(name) + }, getRegExMatches: function $h_Message$getRegExMatches() + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0() + }, getRegExMatchesByName: function $h_Message$getRegExMatchesByName(name) + { + OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name) + }, displayReplyForm: function $h_Message$displayReplyForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody) + }, displayReplyAllForm: function $h_Message$displayReplyAllForm(htmlBody) + { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody) + }, getItemType: function $h_Message$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, _getSubject$p$2: function $h_Message$_getSubject$p$2() + { + return this._data$p$0.get__subject$i$0() + }, _getNormalizedSubject$p$2: function $h_Message$_getNormalizedSubject$p$2() + { + return this._data$p$0.get__normalizedSubject$i$0() + }, _getSender$p$2: function $h_Message$_getSender$p$2() + { + return this._data$p$0.get__sender$i$0() + }, _getFrom$p$2: function $h_Message$_getFrom$p$2() + { + return this._data$p$0.get__from$i$0() + }, _getTo$p$2: function $h_Message$_getTo$p$2() + { + return this._data$p$0.get__to$i$0() + }, _getCc$p$2: function $h_Message$_getCc$p$2() + { + return this._data$p$0.get__cc$i$0() + }, _getInternetMessageId$p$2: function $h_Message$_getInternetMessageId$p$2() + { + return this._data$p$0.get__internetMessageId$i$0() + }, _getConversationId$p$2: function $h_Message$_getConversationId$p$2() + { + return this._data$p$0.get__conversationId$i$0() + } +}; +$h.MessageCompose=function $h_MessageCompose(data) +{ + this.$$d__getConversationId$p$2=Function.createDelegate(this, this._getConversationId$p$2); + this.$$d__getBcc$p$2=Function.createDelegate(this, this._getBcc$p$2); + this.$$d__getCc$p$2=Function.createDelegate(this, this._getCc$p$2); + this.$$d__getTo$p$2=Function.createDelegate(this, this._getTo$p$2); + $h.MessageCompose.initializeBase(this, [data]); + $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'bcc', this.$$d__getBcc$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$2) +}; +$h.MessageCompose.prototype={ + _to$p$2: null, _cc$p$2: null, _bcc$p$2: null, getItemType: function $h_MessageCompose$getItemType() + { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message + }, _getTo$p$2: function $h_MessageCompose$_getTo$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._to$p$2) + { + this._to$p$2=new $h.ComposeRecipient(0, 'to') + } + return this._to$p$2 + }, _getCc$p$2: function $h_MessageCompose$_getCc$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._cc$p$2) + { + this._cc$p$2=new $h.ComposeRecipient(1, 'cc') + } + return this._cc$p$2 + }, _getBcc$p$2: function $h_MessageCompose$_getBcc$p$2() + { + this._data$p$0._throwOnRestrictedPermissionLevel$i$0(); + if (!this._bcc$p$2) + { + this._bcc$p$2=new $h.ComposeRecipient(2, 'bcc') + } + return this._bcc$p$2 + }, _getConversationId$p$2: function $h_MessageCompose$_getConversationId$p$2() + { + return this._data$p$0.get__conversationId$i$0() + } +}; +$h.OutlookErrorManager=function $h_OutlookErrorManager(){}; +$h.OutlookErrorManager.getErrorArgs=function $h_OutlookErrorManager$getErrorArgs(errorCode) +{ + if (!$h.OutlookErrorManager._isInitialized$p) + { + $h.OutlookErrorManager._initialize$p() + } + return OSF.DDA.ErrorCodeManager.getErrorArgs(errorCode) +}; +$h.OutlookErrorManager._initialize$p=function $h_OutlookErrorManager$_initialize$p() +{ + $h.OutlookErrorManager._addErrorMessage$p(9000, 'AttachmentSizeExceeded', _u.ExtensibilityStrings.l_AttachmentExceededSize_Text); + $h.OutlookErrorManager._addErrorMessage$p(9001, 'NumberOfAttachmentsExceeded', _u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text); + $h.OutlookErrorManager._addErrorMessage$p(9002, 'InternalFormatError', _u.ExtensibilityStrings.l_InternalFormatError_Text); + $h.OutlookErrorManager._addErrorMessage$p(9003, 'InvalidAttachmentId', _u.ExtensibilityStrings.l_InvalidAttachmentId_Text); + $h.OutlookErrorManager._addErrorMessage$p(9004, 'InvalidAttachmentPath', _u.ExtensibilityStrings.l_InvalidAttachmentPath_Text); + $h.OutlookErrorManager._addErrorMessage$p(9005, 'CannotAddAttachmentBeforeUpgrade', _u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text); + $h.OutlookErrorManager._addErrorMessage$p(9006, 'AttachmentDeletedBeforeUploadCompletes', _u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text); + $h.OutlookErrorManager._addErrorMessage$p(9007, 'AttachmentUploadGeneralFailure', _u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9008, 'AttachmentToDeleteDoesNotExist', _u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text); + $h.OutlookErrorManager._addErrorMessage$p(9009, 'AttachmentDeleteGeneralFailure', _u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9010, 'InvalidEndTime', _u.ExtensibilityStrings.l_InvalidEndTime_Text); + $h.OutlookErrorManager._addErrorMessage$p(9011, 'HtmlSanitizationFailure', _u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text); + $h.OutlookErrorManager._addErrorMessage$p(9012, 'NumberOfRecipientsExceeded', String.format(_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text, 100)); + $h.OutlookErrorManager._addErrorMessage$p(9013, 'NoValidRecipientsProvided', _u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text); + $h.OutlookErrorManager._addErrorMessage$p(9014, 'CursorPositionChanged', _u.ExtensibilityStrings.l_CursorPositionChanged_Text); + $h.OutlookErrorManager._isInitialized$p=true +}; +$h.OutlookErrorManager._addErrorMessage$p=function $h_OutlookErrorManager$_addErrorMessage$p(errorCode, errorName, errorMessage) +{ + OSF.DDA.ErrorCodeManager.addErrorMessage(errorCode, { + name: errorName, message: errorMessage + }) +}; +$h.OutlookErrorManager.OutlookErrorCodes=function $h_OutlookErrorManager_OutlookErrorCodes(){}; +$h.OutlookErrorManager.OsfDdaErrorCodes=function $h_OutlookErrorManager_OsfDdaErrorCodes(){}; +$h.PhoneNumber=function $h_PhoneNumber(data) +{ + this.$$d__getPhoneType$p$0=Function.createDelegate(this, this._getPhoneType$p$0); + this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this, this._getOriginalPhoneString$p$0); + this.$$d__getPhoneString$p$0=Function.createDelegate(this, this._getPhoneString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneString', this.$$d__getPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'originalPhoneString', this.$$d__getOriginalPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'type', this.$$d__getPhoneType$p$0) +}; +$h.PhoneNumber.prototype={ + _data$p$0: null, _getPhoneString$p$0: function $h_PhoneNumber$_getPhoneString$p$0() + { + return this._data$p$0['PhoneString'] + }, _getOriginalPhoneString$p$0: function $h_PhoneNumber$_getOriginalPhoneString$p$0() + { + return this._data$p$0['OriginalPhoneString'] + }, _getPhoneType$p$0: function $h_PhoneNumber$_getPhoneType$p$0() + { + return this._data$p$0['Type'] + } +}; +$h.TaskSuggestion=function $h_TaskSuggestion(data) +{ + this.$$d__getAssignees$p$0=Function.createDelegate(this, this._getAssignees$p$0); + this.$$d__getTaskString$p$0=Function.createDelegate(this, this._getTaskString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'taskString', this.$$d__getTaskString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'assignees', this.$$d__getAssignees$p$0) +}; +$h.TaskSuggestion.prototype={ + _data$p$0: null, _assignees$p$0: null, _getTaskString$p$0: function $h_TaskSuggestion$_getTaskString$p$0() + { + return this._data$p$0['TaskString'] + }, _getAssignees$p$0: function $h_TaskSuggestion$_getAssignees$p$0() + { + if (!this._assignees$p$0) + { + var $$t_1=this; + this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Assignees', function(data) + { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data) + }) + } + return this._assignees$p$0 + } +}; +$h.UserProfile=function $h_UserProfile(data) +{ + this.$$d__getTimeZone$p$0=Function.createDelegate(this, this._getTimeZone$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'timeZone', this.$$d__getTimeZone$p$0) +}; +$h.UserProfile.prototype={ + _data$p$0: null, _getDisplayName$p$0: function $h_UserProfile$_getDisplayName$p$0() + { + return this._data$p$0.get__userDisplayName$i$0() + }, _getEmailAddress$p$0: function $h_UserProfile$_getEmailAddress$p$0() + { + return this._data$p$0.get__userEmailAddress$i$0() + }, _getTimeZone$p$0: function $h_UserProfile$_getTimeZone$p$0() + { + return this._data$p$0.get__userTimeZone$i$0() + } +}; +$h.RequestState=function(){}; +$h.RequestState.prototype={ + unsent: 0, opened: 1, headersReceived: 2, loading: 3, done: 4 +}; +$h.RequestState.registerEnum('$h.RequestState', false); +$h.CommonParameters=function $h_CommonParameters(options, callback, asyncContext) +{ + this._options$p$0=options; + this._callback$p$0=callback; + this._asyncContext$p$0=asyncContext +}; +$h.CommonParameters.parse=function $h_CommonParameters$parse(args, isCallbackRequired, tryLegacy) +{ + var legacyParameters; + var $$t_8, + $$t_9; + if (tryLegacy && (($$t_9=$h.CommonParameters._tryParseLegacy$p(args, ($$t_8={val: legacyParameters}))), legacyParameters=$$t_8.val, $$t_9)) + { + return legacyParameters + } + var argsLength=args.length; + var options=null; + var callback=null; + var asyncContext=null; + if (argsLength===1) + { + if (Function.isInstanceOfType(args[0])) + { + callback=args[0] + } + else if (Object.isInstanceOfType(args[0])) + { + options=args[0] + } + else + { + throw Error.argumentType(); + } + } + else if (argsLength===2) + { + if (!(Object.isInstanceOfType(args[0]))) + { + throw Error.argument('options'); + } + if (!(Function.isInstanceOfType(args[1]))) + { + throw Error.argument('callback'); + } + options=args[0]; + callback=args[1] + } + else if (argsLength) + { + throw Error.parameterCount(_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text); + } + if (isCallbackRequired && !callback) + { + throw Error.argumentNull('callback'); + } + if (options && !$h.ScriptHelpers.isNullOrUndefined(options['asyncContext'])) + { + asyncContext=options['asyncContext'] + } + return new $h.CommonParameters(options, callback, asyncContext) +}; +$h.CommonParameters._tryParseLegacy$p=function $h_CommonParameters$_tryParseLegacy$p(args, commonParameters) +{ + commonParameters.val=null; + var argsLength=args.length; + var callback=null; + var userContext=null; + if (!argsLength || argsLength > 2) + { + return false + } + if (!(Function.isInstanceOfType(args[0]))) + { + return false + } + callback=args[0]; + if (argsLength > 1) + { + userContext=args[1] + } + commonParameters.val=new $h.CommonParameters(null, callback, userContext); + return true +}; +$h.CommonParameters.prototype={ + _options$p$0: null, _callback$p$0: null, _asyncContext$p$0: null, get_options: function $h_CommonParameters$get_options() + { + return this._options$p$0 + }, get_callback: function $h_CommonParameters$get_callback() + { + return this._callback$p$0 + }, get_asyncContext: function $h_CommonParameters$get_asyncContext() + { + return this._asyncContext$p$0 + } +}; +$h.EwsRequest=function $h_EwsRequest(userContext) +{ + this.readyState=1; + $h.EwsRequest.initializeBase(this, [userContext]) +}; +$h.EwsRequest.prototype={ + status: 0, statusText: null, onreadystatechange: null, responseText: null, get__statusCode$i$1: function $h_EwsRequest$get__statusCode$i$1() + { + return this.status + }, set__statusCode$i$1: function $h_EwsRequest$set__statusCode$i$1(value) + { + this.status=value; + return value + }, get__statusDescription$i$1: function $h_EwsRequest$get__statusDescription$i$1() + { + return this.statusText + }, set__statusDescription$i$1: function $h_EwsRequest$set__statusDescription$i$1(value) + { + this.statusText=value; + return value + }, get__requestState$i$1: function $h_EwsRequest$get__requestState$i$1() + { + return this.readyState + }, set__requestState$i$1: function $h_EwsRequest$set__requestState$i$1(value) + { + this.readyState=value; + return value + }, get__response$i$1: function $h_EwsRequest$get__response$i$1() + { + return this.responseText + }, set__response$i$1: function $h_EwsRequest$set__response$i$1(value) + { + this.responseText=value; + return value + }, send: function $h_EwsRequest$send(data) + { + this._checkSendConditions$i$1(); + if ($h.ScriptHelpers.isNullOrUndefined(data)) + { + this._throwInvalidStateException$i$1() + } + this._sendRequest$i$0(5, 'EwsRequest', {body: data}) + }, _callOnReadyStateChangeCallback$i$1: function $h_EwsRequest$_callOnReadyStateChangeCallback$i$1() + { + if (!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) + { + this.onreadystatechange() + } + }, _parseExtraResponseData$i$1: function $h_EwsRequest$_parseExtraResponseData$i$1(response){} +}; +$h.InitialData=function $h_InitialData(data) +{ + this._data$p$0=data; + this._permissionLevel$p$0=this._calculatePermissionLevel$p$0() +}; +$h.InitialData._defineReadOnlyProperty$i=function $h_InitialData$_defineReadOnlyProperty$i(o, methodName, getter) +{ + var propertyDescriptor={ + get: getter, configurable: false + }; + Object.defineProperty(o, methodName, propertyDescriptor) +}; +$h.InitialData.prototype={ + _toRecipients$p$0: null, _ccRecipients$p$0: null, _attachments$p$0: null, _resources$p$0: null, _entities$p$0: null, _data$p$0: null, _permissionLevel$p$0: 0, get__itemId$i$0: function $h_InitialData$get__itemId$i$0() + { + return this._data$p$0['id'] + }, get__itemClass$i$0: function $h_InitialData$get__itemClass$i$0() + { + return this._data$p$0['itemClass'] + }, get__dateTimeCreated$i$0: function $h_InitialData$get__dateTimeCreated$i$0() + { + return new Date(this._data$p$0['dateTimeCreated']) + }, get__dateTimeModified$i$0: function $h_InitialData$get__dateTimeModified$i$0() + { + return new Date(this._data$p$0['dateTimeModified']) + }, get__dateTimeSent$i$0: function $h_InitialData$get__dateTimeSent$i$0() + { + return new Date(this._data$p$0['dateTimeSent']) + }, get__subject$i$0: function $h_InitialData$get__subject$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0['subject'] + }, get__normalizedSubject$i$0: function $h_InitialData$get__normalizedSubject$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + return this._data$p$0['normalizedSubject'] + }, get__internetMessageId$i$0: function $h_InitialData$get__internetMessageId$i$0() + { + return this._data$p$0['internetMessageId'] + }, get__conversationId$i$0: function $h_InitialData$get__conversationId$i$0() + { + return this._data$p$0['conversationId'] + }, get__sender$i$0: function $h_InitialData$get__sender$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var sender=this._data$p$0['sender']; + return ($h.ScriptHelpers.isNullOrUndefined(sender)) ? null : new $h.EmailAddressDetails(sender) + }, get__from$i$0: function $h_InitialData$get__from$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var from=this._data$p$0['from']; + return ($h.ScriptHelpers.isNullOrUndefined(from)) ? null : new $h.EmailAddressDetails(from) + }, get__to$i$0: function $h_InitialData$get__to$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._toRecipients$p$0) + { + this._toRecipients$p$0=this._createEmailAddressDetails$p$0('to') + } + return this._toRecipients$p$0 + }, get__cc$i$0: function $h_InitialData$get__cc$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._ccRecipients$p$0) + { + this._ccRecipients$p$0=this._createEmailAddressDetails$p$0('cc') + } + return this._ccRecipients$p$0 + }, get__attachments$i$0: function $h_InitialData$get__attachments$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._attachments$p$0) + { + this._attachments$p$0=this._createAttachmentDetails$p$0() + } + return this._attachments$p$0 + }, get__ewsUrl$i$0: function $h_InitialData$get__ewsUrl$i$0() + { + return this._data$p$0['ewsUrl'] + }, get__start$i$0: function $h_InitialData$get__start$i$0() + { + return new Date(this._data$p$0['start']) + }, get__end$i$0: function $h_InitialData$get__end$i$0() + { + return new Date(this._data$p$0['end']) + }, get__location$i$0: function $h_InitialData$get__location$i$0() + { + return this._data$p$0['location'] + }, get__resources$i$0: function $h_InitialData$get__resources$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + if (null===this._resources$p$0) + { + this._resources$p$0=this._createEmailAddressDetails$p$0('resources') + } + return this._resources$p$0 + }, get__organizer$i$0: function $h_InitialData$get__organizer$i$0() + { + this._throwOnRestrictedPermissionLevel$i$0(); + var organizer=this._data$p$0['organizer']; + return ($h.ScriptHelpers.isNullOrUndefined(organizer)) ? null : new $h.EmailAddressDetails(organizer) + }, get__userDisplayName$i$0: function $h_InitialData$get__userDisplayName$i$0() + { + return this._data$p$0['userDisplayName'] + }, get__userEmailAddress$i$0: function $h_InitialData$get__userEmailAddress$i$0() + { + return this._data$p$0['userEmailAddress'] + }, get__userTimeZone$i$0: function $h_InitialData$get__userTimeZone$i$0() + { + return this._data$p$0['userTimeZone'] + }, get__timeZoneOffsets$i$0: function $h_InitialData$get__timeZoneOffsets$i$0() + { + return this._data$p$0['timeZoneOffsets'] + }, get__hostVersion$i$0: function $h_InitialData$get__hostVersion$i$0() + { + return this._data$p$0['hostVersion'] + }, get__owaView$i$0: function $h_InitialData$get__owaView$i$0() + { + return this._data$p$0['owaView'] + }, get__overrideWindowOpen$i$0: function $h_InitialData$get__overrideWindowOpen$i$0() + { + return this._data$p$0['overrideWindowOpen'] + }, _getEntities$i$0: function $h_InitialData$_getEntities$i$0() + { + if (!this._entities$p$0) + { + this._entities$p$0=new $h.Entities(this._data$p$0['entities'], this._data$p$0['filteredEntities'], this.get__dateTimeSent$i$0(), this._permissionLevel$p$0) + } + return this._entities$p$0 + }, _getEntitiesByType$i$0: function $h_InitialData$_getEntitiesByType$i$0(entityType) + { + var entites=this._getEntities$i$0(); + return entites._getByType$i$0(entityType) + }, _getFilteredEntitiesByName$i$0: function $h_InitialData$_getFilteredEntitiesByName$i$0(name) + { + var entities=this._getEntities$i$0(); + return entities._getFilteredEntitiesByName$i$0(name) + }, _getRegExMatches$i$0: function $h_InitialData$_getRegExMatches$i$0() + { + if (!this._data$p$0['regExMatches']) + { + return null + } + return this._data$p$0['regExMatches'] + }, _getRegExMatchesByName$i$0: function $h_InitialData$_getRegExMatchesByName$i$0(regexName) + { + var regexMatches=this._getRegExMatches$i$0(); + if (!regexMatches || !regexMatches[regexName]) + { + return null + } + return regexMatches[regexName] + }, _throwOnRestrictedPermissionLevel$i$0: function $h_InitialData$_throwOnRestrictedPermissionLevel$i$0() + { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0) + }, _createEmailAddressDetails$p$0: function $h_InitialData$_createEmailAddressDetails$p$0(key) + { + var to=this._data$p$0[key]; + if ($h.ScriptHelpers.isNullOrUndefined(to)) + { + return [] + } + var recipients=[]; + for (var i=0; i < to.length; i++) + { + if (!$h.ScriptHelpers.isNullOrUndefined(to[i])) + { + recipients[i]=new $h.EmailAddressDetails(to[i]) + } + } + return recipients + }, _createAttachmentDetails$p$0: function $h_InitialData$_createAttachmentDetails$p$0() + { + var attachments=this._data$p$0['attachments']; + if ($h.ScriptHelpers.isNullOrUndefined(attachments)) + { + return [] + } + var attachmentDetails=[]; + for (var i=0; i < attachments.length; i++) + { + if (!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) + { + attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]) + } + } + return attachmentDetails + }, _calculatePermissionLevel$p$0: function $h_InitialData$_calculatePermissionLevel$p$0() + { + var HostReadItem=1; + var HostReadWriteMailbox=2; + var HostReadWriteItem=3; + var permissionLevelFromHost=this._data$p$0['permissionLevel']; + if ($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0)) + { + return 0 + } + switch (permissionLevelFromHost) + { + case HostReadItem: + return 1; + case HostReadWriteItem: + return 2; + case HostReadWriteMailbox: + return 3; + default: + return 0 + } + } +}; +$h._loadDictionaryRequest=function $h__loadDictionaryRequest(createResultObject, dictionaryName, callback, userContext) +{ + $h._loadDictionaryRequest.initializeBase(this, [userContext]); + this._createResultObject$p$1=createResultObject; + this._dictionaryName$p$1=dictionaryName; + this._callback$p$1=callback +}; +$h._loadDictionaryRequest.prototype={ + _dictionaryName$p$1: null, _createResultObject$p$1: null, _callback$p$1: null, handleResponse: function $h__loadDictionaryRequest$handleResponse(response) + { + if (response['wasSuccessful']) + { + var value=response[this._dictionaryName$p$1]; + var responseData=JSON.parse(value); + this.createAsyncResult(this._createResultObject$p$1(responseData), 0, null) + } + else + { + this.createAsyncResult(null, 1, response['errorMessage']) + } + this._callback$p$1(this._asyncResult$p$0) + } +}; +$h.ProxyRequestBase=function $h_ProxyRequestBase(userContext) +{ + $h.ProxyRequestBase.initializeBase(this, [userContext]) +}; +$h.ProxyRequestBase.prototype={ + handleResponse: function $h_ProxyRequestBase$handleResponse(response) + { + if (!(response['wasProxySuccessful'])) + { + this.set__statusCode$i$1(500); + this.set__statusDescription$i$1('Error'); + var errorMessage=response['errorMessage']; + this.set__response$i$1(errorMessage); + this.createAsyncResult(null, 1, errorMessage) + } + else + { + this.set__statusCode$i$1(response['statusCode']); + this.set__statusDescription$i$1(response['statusDescription']); + this.set__response$i$1(response['body']); + this.createAsyncResult(this.get__response$i$1(), 0, null) + } + this._parseExtraResponseData$i$1(response); + this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() + }, _throwInvalidStateException$i$1: function $h_ProxyRequestBase$_throwInvalidStateException$i$1() + { + throw Error.create('DOMException', { + code: 11, message: 'INVALID_STATE_ERR' + }); + }, _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function $h_ProxyRequestBase$_cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() + { + var $$t_0=this; + this._changeReadyState$i$1(2, function() + { + $$t_0._changeReadyState$i$1(3, function() + { + $$t_0._changeReadyState$i$1(4, null) + }) + }) + }, _changeReadyState$i$1: function $h_ProxyRequestBase$_changeReadyState$i$1(state, nextStep) + { + this.set__requestState$i$1(state); + var $$t_2=this; + window.setTimeout(function() + { + try + { + $$t_2._callOnReadyStateChangeCallback$i$1() + } + finally + { + if (!$h.ScriptHelpers.isNullOrUndefined(nextStep)) + { + nextStep() + } + } + }, 0) + }, _checkSendConditions$i$1: function $h_ProxyRequestBase$_checkSendConditions$i$1() + { + if (this.get__requestState$i$1() !==1) + { + this._throwInvalidStateException$i$1() + } + if (this._isSent$p$0) + { + this._throwInvalidStateException$i$1() + } + } +}; +$h.RequestBase=function $h_RequestBase(userContext) +{ + this._userContext$p$0=userContext +}; +$h.RequestBase.prototype={ + _isSent$p$0: false, _asyncResult$p$0: null, _userContext$p$0: null, _sendRequest$i$0: function $h_RequestBase$_sendRequest$i$0(dispid, methodName, dataToSend) + { + this._isSent$p$0=true; + var $$t_5=this; + OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid, methodName, dataToSend, function(resultCode, response) + { + if (resultCode) + { + $$t_5.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode)) + } + else + { + $$t_5.handleResponse(response) + } + }) + }, createAsyncResult: function $h_RequestBase$createAsyncResult(value, errorCode, errorDescription) + { + this._asyncResult$p$0=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(value, errorCode, errorDescription, this._userContext$p$0) + } +}; +$h._saveDictionaryRequest=function $h__saveDictionaryRequest(callback, userContext) +{ + $h._saveDictionaryRequest.initializeBase(this, [userContext]); + if (!$h.ScriptHelpers.isNullOrUndefined(callback)) + { + this._callback$p$1=callback + } +}; +$h._saveDictionaryRequest.prototype={ + _callback$p$1: null, handleResponse: function $h__saveDictionaryRequest$handleResponse(response) + { + if (response['wasSuccessful']) + { + this.createAsyncResult(null, 0, null) + } + else + { + this.createAsyncResult(null, 1, response['errorMessage']) + } + if (!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) + { + this._callback$p$1(this._asyncResult$p$0) + } + } +}; +$h.ScriptHelpers=function $h_ScriptHelpers(){}; +$h.ScriptHelpers.isNull=function $h_ScriptHelpers$isNull(value) +{ + return null===value +}; +$h.ScriptHelpers.isNullOrUndefined=function $h_ScriptHelpers$isNullOrUndefined(value) +{ + return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value) +}; +$h.ScriptHelpers.isUndefined=function $h_ScriptHelpers$isUndefined(value) +{ + return value===undefined +}; +$h.ScriptHelpers.dictionaryContainsKey=function $h_ScriptHelpers$dictionaryContainsKey(obj, keyName) +{ + return (Object.isInstanceOfType(obj)) ? keyName in obj : false +}; +$h.ScriptHelpers.isNonEmptyString=function $h_ScriptHelpers$isNonEmptyString(value) +{ + if (!value) + { + return false + } + return String.isInstanceOfType(value) +}; +OSF.DDA.OutlookAppOm.registerClass('OSF.DDA.OutlookAppOm'); +OSF.DDA.Settings.registerClass('OSF.DDA.Settings'); +$h.ItemBase.registerClass('$h.ItemBase'); +$h.Item.registerClass('$h.Item', $h.ItemBase); +$h.Appointment.registerClass('$h.Appointment', $h.Item); +$h.ComposeItem.registerClass('$h.ComposeItem', $h.ItemBase); +$h.AppointmentCompose.registerClass('$h.AppointmentCompose', $h.ComposeItem); +$h.AttachmentDetails.registerClass('$h.AttachmentDetails'); +$h.ComposeBody.registerClass('$h.ComposeBody'); +$h.ComposeRecipient.registerClass('$h.ComposeRecipient'); +$h.ComposeLocation.registerClass('$h.ComposeLocation'); +$h.ComposeSubject.registerClass('$h.ComposeSubject'); +$h.ComposeTime.registerClass('$h.ComposeTime'); +$h.Contact.registerClass('$h.Contact'); +$h.CustomProperties.registerClass('$h.CustomProperties'); +$h.Diagnostics.registerClass('$h.Diagnostics'); +$h.EmailAddressDetails.registerClass('$h.EmailAddressDetails'); +$h.Entities.registerClass('$h.Entities'); +Office.cast.item.registerClass('Office.cast.item'); +$h.Message.registerClass('$h.Message', $h.Item); +$h.MeetingRequest.registerClass('$h.MeetingRequest', $h.Message); +$h.MeetingSuggestion.registerClass('$h.MeetingSuggestion'); +$h.MeetingSuggestionTimeDecoder.registerClass('$h.MeetingSuggestionTimeDecoder'); +$h._extractedDate.registerClass('$h._extractedDate'); +$h._preciseDate.registerClass('$h._preciseDate', $h._extractedDate); +$h._relativeDate.registerClass('$h._relativeDate', $h._extractedDate); +$h.MessageCompose.registerClass('$h.MessageCompose', $h.ComposeItem); +$h.OutlookErrorManager.registerClass('$h.OutlookErrorManager'); +$h.OutlookErrorManager.OutlookErrorCodes.registerClass('$h.OutlookErrorManager.OutlookErrorCodes'); +$h.OutlookErrorManager.OsfDdaErrorCodes.registerClass('$h.OutlookErrorManager.OsfDdaErrorCodes'); +$h.PhoneNumber.registerClass('$h.PhoneNumber'); +$h.TaskSuggestion.registerClass('$h.TaskSuggestion'); +$h.UserProfile.registerClass('$h.UserProfile'); +$h.CommonParameters.registerClass('$h.CommonParameters'); +$h.RequestBase.registerClass('$h.RequestBase'); +$h.ProxyRequestBase.registerClass('$h.ProxyRequestBase', $h.RequestBase); +$h.EwsRequest.registerClass('$h.EwsRequest', $h.ProxyRequestBase); +$h.InitialData.registerClass('$h.InitialData'); +$h._loadDictionaryRequest.registerClass('$h._loadDictionaryRequest', $h.RequestBase); +$h._saveDictionaryRequest.registerClass('$h._saveDictionaryRequest', $h.RequestBase); +$h.ScriptHelpers.registerClass('$h.ScriptHelpers'); +OSF.DDA.OutlookAppOm.asyncMethodTimeoutKeyName='__timeout__'; +OSF.DDA.OutlookAppOm._maxRecipients$p=100; +OSF.DDA.OutlookAppOm._maxSubjectLength$p=255; +OSF.DDA.OutlookAppOm._maxBodyLength$p=32768; +OSF.DDA.OutlookAppOm._maxLocationLength$p=255; +OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1000000; +OSF.DDA.OutlookAppOm._instance$p=null; +$h.AttachmentDetails._attachmentTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File, Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item]; +$h.ComposeBody.coercionTypeParameterName='coercionType'; +$h.ComposeItem.maxAttachmentNameLength=255; +$h.ComposeItem.maxUriLength=2048; +$h.ComposeItem.maxItemIdLength=200; +$h.ComposeItem.maxRemoveIdLength=200; +$h.ComposeRecipient.displayNameLengthLimit=255; +$h.ComposeRecipient.maxSmtpLength=571; +$h.ComposeRecipient.recipientsLimit=100; +$h.ComposeRecipient.addressParameterName='address'; +$h.ComposeRecipient.nameParameterName='name'; +$h.ComposeLocation.locationKey='location'; +$h.ComposeLocation.maximumLocationLength=255; +$h.ComposeSubject.maximumSubjectLength=255; +$h.ComposeTime.timeTypeName='TimeProperty'; +$h.ComposeTime.timeDataName='time'; +$h.Diagnostics.outlookAppName='Outlook'; +$h.Diagnostics.outlookWebAppName='OutlookWebApp'; +$h.EmailAddressDetails._emptyString$p=''; +$h.EmailAddressDetails._responseTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined]; +$h.EmailAddressDetails._recipientTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser]; +$h.Entities._allEntityKeys$p=['Addresses', 'EmailAddresses', 'Urls', 'PhoneNumbers', 'TaskSuggestions', 'MeetingSuggestions', 'Contacts']; +$h.MeetingSuggestionTimeDecoder._baseDate$p=new Date('0001-01-01T00:00:00Z'); +$h.OutlookErrorManager.errorNameKey='name'; +$h.OutlookErrorManager.errorMessageKey='message'; +$h.OutlookErrorManager._isInitialized$p=false; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9000; +$h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001; +$h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002; +$h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003; +$h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004; +$h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008; +$h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009; +$h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010; +$h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011; +$h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012; +$h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013; +$h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014; +$h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1000; +$h.CommonParameters.asyncContextKeyName='asyncContext'; +$h.ScriptHelpers.emptyString='' + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.01.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.01.js new file mode 100644 index 000000000..51f804e86 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.01.js @@ -0,0 +1,17 @@ +/* Outlook web application specific API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/*! + Copyright (c) Microsoft Corporation. All rights reserved. +*/ +/*! + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ +Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item"};Microsoft.Office.WebExtension.MailboxEnums.BodyType={Text:"text",Html:"html"};Microsoft.Office.WebExtension.CoercionType={Text:"text",Html:"html"};Type.registerNamespace("OSF.DDA");OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d_$2O_0=Function.createDelegate(this,this.$2O_0);this.$$d_$2g_0=Function.createDelegate(this,this.$2g_0);this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);this.$$d_$32_0=Function.createDelegate(this,this.$32_0);this.$$d_$30_0=Function.createDelegate(this,this.$30_0);this.$$d_$3S_0=Function.createDelegate(this,this.$3S_0);this.$$d_$3A_0=Function.createDelegate(this,this.$3A_0);this.$$d_$37_0=Function.createDelegate(this,this.$37_0);OSF.DDA.OutlookAppOm.$2=this;this.$X_0=n;this.$1X_0=i;var r=this;var u=function(){i&&r.$B_0(1,"GetInitialData",null,r.$$d_$37_0)};this.$1Y_0()?u():this.$3Z_0(u)};OSF.DDA.OutlookAppOm.$J=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};OSF.DDA.OutlookAppOm.$A=function(n,t,i,r){if(ni)throw Error.argumentOutOfRange(r);};OSF.DDA.OutlookAppOm.$M=function(n,t,i){if(Object.getType(n)!==t)throw Error.argumentType(i);};OSF.DDA.OutlookAppOm.$1W=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm.$M(n,String,r);var u=n;OSF.DDA.OutlookAppOm.$A(u.length,t,i,r)}};OSF.DDA.OutlookAppOm.$2T=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:case 14:case 18:case 26:break;case 4:var r=JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm.$o(t.requiredAttendees),OSF.DDA.OutlookAppOm.$o(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm.$o(t.resources),t.subject,t.body];break;case 11:case 10:i=[t.htmlBody];break;case 23:case 13:i=[t.data,t.coercionType||null];break;case 17:i=[t.subject];break;case 15:i=[t.recipientField];break;case 22:case 21:i=[t.recipientField,OSF.DDA.OutlookAppOm.$2R(t.recipientArray)];break;case 19:i=[t.itemId,t.name];break;case 16:i=[t.uri,t.name];break;case 20:i=[t.attachmentIndex];break;case 25:i=[t.TimeProperty,t.time];break;case 24:i=[t.TimeProperty];break;case 27:i=[t.location];break;default:break}return i};OSF.DDA.OutlookAppOm.$o=function(n){return n?n.join(";"):null};OSF.DDA.OutlookAppOm.$2R=function(n){if(!n)return null;for(var i=new Array(n.length),t=0;tOSF.DDA.OutlookAppOm.$27)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);this.$4_0(3,"makeEwsRequestAsync");var u=$h.CommonParameters.parse(r,!0,!0);var i=new $h.EwsRequest(u.$3_0);var f=this;i.onreadystatechange=function(){4===i.get_$2C_1()&&u.get_callback()(i.$R_0)};i.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$B_0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$B_0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$B_0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this.$5_0&&this.$5_0.get_$1Q_0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this.$1q_0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this.$r_0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this.$2f_0(n);if(this.$5_0&&this.$5_0.get_$1Q_0()){var i=this.$1q_0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},getUserIdentityTokenAsync:function(){for(var t=[],n=0;n1&&i[1]){f.error=!0;f.errorCode=i[1]}else f.error=!1;r(t,f)}else if(Number.isInstanceOfType(u)){var e={};e.error=!0;e.errorCode=u;r(t,e)}else throw Error.notImplemented("Return data type from host must be Dictionary or int");}})}else r&&r(-2,null)},$2f_0:function(n){var t=new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds?n.milliseconds:0);if(isNaN(t.getTime()))throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);return t},$r_0:function(n){var t={};t.month=n.getMonth();t.date=n.getDate();t.year=n.getFullYear();t.hours=n.getHours();t.minutes=n.getMinutes();t.seconds=n.getSeconds();t.milliseconds=n.getMilliseconds();return t},$2g_0:function(n){var i=OSF.DDA.OutlookAppOm.$2K(n.requiredAttendees,"requiredAttendees");var r=OSF.DDA.OutlookAppOm.$2K(n.optionalAttendees,"optionalAttendees");OSF.DDA.OutlookAppOm.$1W(n.location,0,OSF.DDA.OutlookAppOm.$28,"location");OSF.DDA.OutlookAppOm.$1W(n.body,0,OSF.DDA.OutlookAppOm.$W,"body");OSF.DDA.OutlookAppOm.$1W(n.subject,0,OSF.DDA.OutlookAppOm.$2A,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){OSF.DDA.OutlookAppOm.$M(n.start,Date,"start");var f=n.start;n.start=f.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){OSF.DDA.OutlookAppOm.$M(n.end,Date,"end");var u=n.end;if(u=0&&n.getTime()-f<0)return parseInt(i.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},$1Y_0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},$3Z_0:function(n){for(var o=null,h="",c=document.getElementsByTagName("script"),s=c.length-1;s>=0;s--){var i=null;var l=c[s].attributes;if(l){var a=l.getNamedItem("src");a&&(i=a.value);if(i){var v=!1;i=i.toLowerCase();var u=i.indexOf("office_strings.js");if(u<0){u=i.indexOf("office_strings.debug.js");v=!0}if(u>0&&uf+1&&(h=r.substring(0,f+1));break}}}}if(o){var y=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var p=this;var w=function(){if(!p.$1Y_0()){var n=h+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=p.$1h_0(n);t.onload=e;t.onreadystatechange=e;y.appendChild(t)}};t=this.$1h_0(o);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);y.appendChild(t)}},$1h_0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};OSF.DDA.Settings=function(n){this.$1D_0=n};OSF.DDA.Settings.$2S=function(n){if(!n)return{};if(OSF.DDA.OutlookAppOm.$2.get_$c_0()===8){var t=n.SettingsKey;if(t)return OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={$1D_0:null,$1K_0:null,get_$N_0:function(){if(!this.$1K_0){this.$1K_0=OSF.DDA.Settings.$2S(this.$1D_0);this.$1D_0=null}return this.$1K_0},get:function(n){return this.get_$N_0()[n]},set:function(n,t){this.get_$N_0()[n]=t},remove:function(n){delete this.get_$N_0()[n]},saveAsync:function(){for(var i=[],n=0;n255)throw Error.argumentOutOfRange("recipients",n.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text);if(t&&t.length>571)throw Error.argumentOutOfRange("recipients",t.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text);};$h.ComposeRecipient.$2o=function(n){for(var i=n,r=[],t=0;t0)this.$0_0=t[0];else throw Error.argument("data");}else this.$0_0=n};$h.CustomProperties.prototype={$0_0:null,get:function(n){var i=this.$0_0[n];if(typeof i=="string"){var t=i;if(t.length>6&&t.startsWith("Date(")&&t.endsWith(")")){var f=t.substring(5,t.length-1);var r=parseInt(f);if(!isNaN(r)){var u=new Date(r);u&&(i=u)}}}return i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")");this.$0_0[n]=t},remove:function(n){delete this.$0_0[n]},saveAsync:function(){for(var t=[],n=0;nr)throw Error.argument();var i=$h.CommonParameters.parse(t,!1,!0);var u=new $h.SaveDictionaryRequest(i.get_callback(),i.$3_0);u.$1J_0(4,"SaveCustomProperties",{customProperties:this.$0_0})}};$h.Diagnostics=function(n,t){this.$$d_$3H_0=Function.createDelegate(this,this.$3H_0);this.$$d_$35_0=Function.createDelegate(this,this.$35_0);this.$$d_$34_0=Function.createDelegate(this,this.$34_0);this.$0_0=n;this.$Q_0=t;$h.InitialData.$1(this,"hostName",this.$$d_$34_0);$h.InitialData.$1(this,"hostVersion",this.$$d_$35_0);64===this.$Q_0&&$h.InitialData.$1(this,"OWAView",this.$$d_$3H_0)};$h.Diagnostics.prototype={$0_0:null,$Q_0:0,$34_0:function(){if(8===this.$Q_0)return"Outlook";else if(64===this.$Q_0)return"OutlookWebApp";return null},$35_0:function(){return this.$0_0.get_$3T_0()},$3H_0:function(){return this.$0_0.get_$3c_0()}};$h.EmailAddressDetails=function(n){this.$$d_$1z_0=Function.createDelegate(this,this.$1z_0);this.$$d_$1r_0=Function.createDelegate(this,this.$1r_0);this.$$d_$x_0=Function.createDelegate(this,this.$x_0);this.$$d_$y_0=Function.createDelegate(this,this.$y_0);this.$0_0=n;$h.InitialData.$1(this,"emailAddress",this.$$d_$y_0);$h.InitialData.$1(this,"displayName",this.$$d_$x_0);$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData.$1(this,"appointmentResponse",this.$$d_$1r_0);$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData.$1(this,"recipientType",this.$$d_$1z_0)};$h.EmailAddressDetails.$1d=function(n){var t={};var i=n.Name;var r=n.UserId;t.name=i||$h.EmailAddressDetails.$t;t.address=r||$h.EmailAddressDetails.$t;return new $h.EmailAddressDetails(t)};$h.EmailAddressDetails.prototype={$0_0:null,toJSON:function(){var n={};n.emailAddress=this.$y_0();n.displayName=this.$x_0();$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"appointmentResponse")&&(n.appointmentResponse=this.$1r_0());$h.ScriptHelpers.dictionaryContainsKey(this.$0_0,"recipientType")&&(n.recipientType=this.$1z_0());return n},$y_0:function(){return this.$0_0.address},$x_0:function(){return this.$0_0.name},$1r_0:function(){var n=this.$0_0.appointmentResponse;return n<$h.EmailAddressDetails.$1I.length?$h.EmailAddressDetails.$1I[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},$1z_0:function(){var n=this.$0_0.recipientType;return n<$h.EmailAddressDetails.$1E.length?$h.EmailAddressDetails.$1E[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}};$h.Entities=function(n,t,i,r){this.$$d_$2W_0=Function.createDelegate(this,this.$2W_0);this.$$d_$1t_0=Function.createDelegate(this,this.$1t_0);this.$$d_$13_0=Function.createDelegate(this,this.$13_0);this.$$d_$17_0=Function.createDelegate(this,this.$17_0);this.$$d_$z_0=Function.createDelegate(this,this.$z_0);this.$$d_$1w_0=Function.createDelegate(this,this.$1w_0);this.$$d_$21_0=Function.createDelegate(this,this.$21_0);this.$$d_$w_0=Function.createDelegate(this,this.$w_0);this.$0_0=n||{};this.$1p_0=t||{};this.$O_0=i;$h.InitialData.$1(this,"addresses",this.$$d_$w_0);$h.InitialData.$1(this,"taskSuggestions",this.$$d_$21_0);$h.InitialData.$1(this,"meetingSuggestions",this.$$d_$1w_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$z_0);$h.InitialData.$1(this,"urls",this.$$d_$17_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$13_0);$h.InitialData.$1(this,"contacts",this.$$d_$1t_0);this.$D_0=r};$h.Entities.$3r=function(n,t,i,r,u,f){var o=null;var e=t[i];if(!e)return new Array(0);u&&(e=$h.Entities.$3s(Object,e,$h.Entities.$2h,f));o=new Array(e.length);for(var c=0,h=e,l=h.length,s=0;s=0;u--){for(var e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t};$h.Entities.prototype={$O_0:null,$0_0:null,$1p_0:null,$E_0:null,$D_0:0,$1N_0:null,$1A_0:null,$L_0:null,$n_0:null,$a_0:null,$s_0:null,$1V_0:null,$2v_0:function(n){if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)return this.$1w_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)return this.$21_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)return this.$w_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)return this.$13_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)return this.$z_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)return this.$17_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)return this.$1t_0();return null},$11_0:function(n){this.$E_0||(this.$E_0={});if(!$h.ScriptHelpers.dictionaryContainsKey(this.$E_0,n)){for(var r=!1,i=0;i<$h.Entities.$b.length;i++){var u=$h.Entities.$b[i];var t=this.$1p_0[u];if(t&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this.$E_0[n]=$h.Entities.$F(t,n);break;case"Addresses":this.$E_0[n]=$h.Entities.$F(t,n,!0);break;case"PhoneNumbers":this.$E_0[n]=$h.Entities.$3r($h.PhoneNumber,t,n,$h.Entities.$1f,!1,null);break;case"TaskSuggestions":this.$E_0[n]=$h.Entities.$3r($h.TaskSuggestion,t,n,$h.Entities.$1i,!0,"TaskString");break;case"MeetingSuggestions":this.$E_0[n]=$h.Entities.$3r($h.MeetingSuggestion,t,n,this.$$d_$2W_0,!0,"MeetingString");break;case"Contacts":this.$E_0[n]=$h.Entities.$3r($h.Contact,t,n,$h.Entities.$1b,!0,"ContactString");break}r=!0;break}}r||(this.$E_0[n]=null)}return this.$E_0[n]},$2W_0:function(n){return new $h.MeetingSuggestion(n,this.$O_0)},$w_0:function(){this.$a_0||(this.$a_0=$h.Entities.$F(this.$0_0,"Addresses",!0));return this.$a_0},$z_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$s_0||(this.$s_0=$h.Entities.$F(this.$0_0,"EmailAddresses",!1));return this.$s_0},$17_0:function(){this.$1V_0||(this.$1V_0=$h.Entities.$F(this.$0_0,"Urls",!1));return this.$1V_0},$13_0:function(){this.$L_0||(this.$L_0=$h.Entities.$3r($h.PhoneNumber,this.$0_0,"PhoneNumbers",$h.Entities.$1f));return this.$L_0},$21_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$1N_0||(this.$1N_0=$h.Entities.$3r($h.TaskSuggestion,this.$0_0,"TaskSuggestions",$h.Entities.$1i,!0,"TaskString"));return this.$1N_0},$1w_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$1A_0||(this.$1A_0=$h.Entities.$3r($h.MeetingSuggestion,this.$0_0,"MeetingSuggestions",this.$$d_$2W_0,!0,"MeetingString"));return this.$1A_0},$1t_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0);this.$n_0||(this.$n_0=$h.Entities.$3r($h.Contact,this.$0_0,"Contacts",$h.Entities.$1b,!0,"ContactString"));return this.$n_0}};Office.cast.item=function(){};Office.cast.item.toItemRead=function(n){if($h.Item.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toItemCompose=function(n){if($h.ComposeItem.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessage=function(n){return Office.cast.item.toMessageRead(n)};Office.cast.item.toMessageRead=function(n){if($h.Message.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMessageCompose=function(n){if($h.MessageCompose.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toMeetingRequest=function(n){if($h.MeetingRequest.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointment=function(n){return Office.cast.item.toAppointmentRead(n)};Office.cast.item.toAppointmentRead=function(n){if($h.Appointment.isInstanceOfType(n))return n;throw Error.argumentType();};Office.cast.item.toAppointmentCompose=function(n){if($h.AppointmentCompose.isInstanceOfType(n))return n;throw Error.argumentType();};$h.Item=function(n){this.$$d_$2p_1=Function.createDelegate(this,this.$2p_1);this.$$d_$3B_1=Function.createDelegate(this,this.$3B_1);this.$$d_$3C_1=Function.createDelegate(this,this.$3C_1);this.$$d_$2z_1=Function.createDelegate(this,this.$2z_1);this.$$d_$2y_1=Function.createDelegate(this,this.$2y_1);$h.Item.initializeBase(this,[n]);$h.InitialData.$1(this,"dateTimeCreated",this.$$d_$2y_1);$h.InitialData.$1(this,"dateTimeModified",this.$$d_$2z_1);$h.InitialData.$1(this,"itemId",this.$$d_$3C_1);$h.InitialData.$1(this,"itemClass",this.$$d_$3B_1);$h.InitialData.$1(this,"attachments",this.$$d_$2p_1)};$h.Item.prototype={$3C_1:function(){return this.$0_0.get_$3Y_0()},$3B_1:function(){return this.$0_0.get_$3X_0()},$2y_1:function(){return this.$0_0.get_$2Y_0()},$2z_1:function(){return this.$0_0.get_$2Z_0()},$2p_1:function(){return this.$0_0.get_$2M_0()}};$h.ItemBase=function(n){this.$$d_$2V_0=Function.createDelegate(this,this.$2V_0);this.$$d_getItemType=Function.createDelegate(this,this.getItemType);this.$0_0=n;$h.InitialData.$1(this,"itemType",this.$$d_getItemType)};$h.ItemBase.prototype={$0_0:null,get_data:function(){return this.$0_0},loadCustomPropertiesAsync:function(){for(var t=[],n=0;n0)return new Date(n.getFullYear()+t.$C_1,0,1);break;default:break}return n};$h.MeetingSuggestionTimeDecoder.$2j=function(n,t,i){if(t>-5&&t<5){var u;var f;u=(i+6)%7+1;f=7*t+(u-n.getDay());n.setDate(n.getDate()+f);return n}else{var r=(i-n.getDay())%7;r<0&&(r+=7);n.setDate(n.getDate()+r);return n}};$h.MeetingSuggestionTimeDecoder.$2k=function(n,t){var u;var i;var r;u=n;if(t.$I_1<=0||t.$I_1>12||t.$C_1<=0||t.$C_1>5)return n;var e=(12+t.$I_1-u.getMonth()-1)%12;i=new Date(u.getFullYear(),u.getMonth()+e,1);if(t.$K_1===1)if(t.$C_1===1&&i.getDay()!==6&&i.getDay()!==0)return i;else{r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()+(8-i.getDay())%7);i.getDay()!==6&&i.getDay()!==0&&i.getDay()!==1&&r.setDate(r.getDate()-7);r.setDate(r.getDate()+7*(t.$C_1-1));return r.getMonth()+1!==t.$I_1?n:r}else{r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder.$2b(i.getMonth(),i.getFullYear()));var f=1-r.getDay();f>0&&(f=f-7);r.setDate(r.getDate()+f);r.setDate(r.getDate()+7*(1-t.$C_1));return r.getMonth()+1!==t.$I_1?i.getDay()!==6&&i.getDay()!==0?i:n:r}};$h.MeetingSuggestionTimeDecoder.$2c=function(n,t,i){var u=32767;t.val=null;i.val=0;if(!n)return!1;i.val=$h.MeetingSuggestionTimeDecoder.$3Q(n);var f=n.getTime()-i.val;var r=(f-$h.MeetingSuggestionTimeDecoder.$1Z.getTime())/864e5;if(r<0)return!1;else if(r>=262144)return!1;else{var e=r>>15;r=r&u;switch(e){case 0:return $h.MeetingSuggestionTimeDecoder.$2d(r,t);case 1:return $h.MeetingSuggestionTimeDecoder.$2e(r,t);default:return!1}}};$h.MeetingSuggestionTimeDecoder.$2d=function(n,t){var o=7;var u=15;var s=31;var h=127;var f=null;var r=0;var e=0;t.val=null;var i=n>>12&o;if((i&4)==4){f=n>>5&h;if((i&2)==2){if((i&1)==1)return!1;r=n>>1&u}}else{(i&2)==2&&(r=n>>8&u);(i&1)==1&&(e=n>>3&s)}t.val=new $h.PreciseDate(e,r,f);return!0};$h.MeetingSuggestionTimeDecoder.$2e=function(n,t){var i=15;var r=63;var u=7;var f=3;var e=n&i;n>>=4;var o=$h.MeetingSuggestionTimeDecoder.$2m(n&r,6);n>>=6;var s=n&u;n>>=3;var h=n&f;try{t.val=new $h.RelativeDate(h,o,s,e);return!0}catch(c){t.val=null;return!1}};$h.MeetingSuggestionTimeDecoder.$2m=function(n,t){var i=1<2||!Function.isInstanceOfType(n[0]))return!1;r=n[0];i>1&&(u=n[1]);t.val=new $h.CommonParameters(null,r,u);return!0};$h.CommonParameters.prototype={$P_0:null,$G_0:null,$3_0:null,get_options:function(){return this.$P_0},get_callback:function(){return this.$G_0},get_asyncContext:function(){return this.$3_0}};$h.EwsRequest=function(n){this.readyState=1;$h.EwsRequest.initializeBase(this,[n])};$h.EwsRequest.prototype={status:0,statusText:null,onreadystatechange:null,responseText:null,get_$2E_1:function(){return this.status},set_$2E_1:function(n){this.status=n;return n},get_$2F_1:function(){return this.statusText},set_$2F_1:function(n){this.statusText=n;return n},get_$2C_1:function(){return this.readyState},set_$2C_1:function(n){this.readyState=n;return n},get_$1H_1:function(){return this.responseText},set_$1H_1:function(n){this.responseText=n;return n},send:function(n){this.$2Q_1();$h.ScriptHelpers.isNullOrUndefined(n)&&this.$1O_1();this.$1J_0(5,"EwsRequest",{body:n})},$2P_1:function(){$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)||this.onreadystatechange()},$3d_1:function(n){}};$h.InitialData=function(n){this.$0_0=n;this.$D_0=this.$2N_0()};$h.InitialData.$1=function(n,t,i){var r={get:i,configurable:!1};Object.defineProperty(n,t,r)};$h.InitialData.prototype={$1T_0:null,$l_0:null,$e_0:null,$1G_0:null,$v_0:null,$0_0:null,$D_0:0,get_$3Y_0:function(){return this.$0_0.id},get_$3X_0:function(){return this.$0_0.itemClass},get_$2Y_0:function(){return new Date(this.$0_0.dateTimeCreated)},get_$2Z_0:function(){return new Date(this.$0_0.dateTimeModified)},get_$2a_0:function(){return new Date(this.$0_0.dateTimeSent)},get_$2G_0:function(){this.$6_0();return this.$0_0.subject},get_$2B_0:function(){this.$6_0();return this.$0_0.normalizedSubject},get_$3W_0:function(){return this.$0_0.internetMessageId},get_$1a_0:function(){return this.$0_0.conversationId},get_$3j_0:function(){this.$6_0();var n=this.$0_0.sender;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$2l_0:function(){this.$6_0();var n=this.$0_0.from;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$1S_0:function(){this.$6_0();null===this.$1T_0&&(this.$1T_0=this.$p_0("to"));return this.$1T_0},get_$k_0:function(){this.$6_0();null===this.$l_0&&(this.$l_0=this.$p_0("cc"));return this.$l_0},get_$2M_0:function(){this.$6_0();null===this.$e_0&&(this.$e_0=this.$2U_0());return this.$e_0},get_$2i_0:function(){return this.$0_0.ewsUrl},get_$2D_0:function(){return new Date(this.$0_0.start)},get_$1o_0:function(){return new Date(this.$0_0.end)},get_$26_0:function(){return this.$0_0.location},get_$3g_0:function(){this.$6_0();null===this.$1G_0&&(this.$1G_0=this.$p_0("resources"));return this.$1G_0},get_$3a_0:function(){this.$6_0();var n=this.$0_0.organizer;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get_$3o_0:function(){return this.$0_0.userDisplayName},get_$3p_0:function(){return this.$0_0.userEmailAddress},get_$3q_0:function(){return this.$0_0.userTimeZone},get_$1Q_0:function(){return this.$0_0.timeZoneOffsets},get_$3T_0:function(){return this.$0_0.hostVersion},get_$3c_0:function(){return this.$0_0.owaView},get_$3b_0:function(){return this.$0_0.overrideWindowOpen},$T_0:function(){this.$v_0||(this.$v_0=new $h.Entities(this.$0_0.entities,this.$0_0.filteredEntities,this.get_$2a_0(),this.$D_0));return this.$v_0},$1v_0:function(n){var t=this.$T_0();return t.$2v_0(n)},$11_0:function(n){var t=this.$T_0();return t.$11_0(n)},$14_0:function(){return this.$0_0.regExMatches?this.$0_0.regExMatches:null},$20_0:function(n){var t=this.$14_0();return!t||!t[n]?null:t[n]},$6_0:function(){OSF.DDA.OutlookAppOm.$J(this.$D_0)},$p_0:function(n){var i=this.$0_0[n];if($h.ScriptHelpers.isNullOrUndefined(i))return[];for(var r=[],t=0;t maxValue) { + throw Error.argumentOutOfRange(argumentName); + } +} +OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function OSF_DDA_OutlookAppOm$_validateOptionalStringParameter$p(value, minLength, maxLength, name) { + if ($h.ScriptHelpers.isNullOrUndefined(value)) { + return; + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value, String, name); + var stringValue=value; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(stringValue.length, minLength, maxLength, name); +} +OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function OSF_DDA_OutlookAppOm$_convertToOutlookParameters$p(dispid, data) { + var executeParameters=null; + switch (dispid) { + case 1: + case 2: + case 12: + case 3: + break; + case 4: + var jsonProperty=JSON.stringify(data['customProperties']); + executeParameters=[ jsonProperty ]; + break; + case 5: + executeParameters=[ data['body'] ]; + break; + case 8: + case 9: + executeParameters=[ data['itemId'] ]; + break; + case 7: + executeParameters=[ OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['requiredAttendees']), OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['optionalAttendees']), data['start'], data['end'], data['location'], OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['resources']), data['subject'], data['body'] ]; + break; + case 11: + case 10: + executeParameters=[ data['htmlBody'] ]; + break; + default: + Sys.Debug.fail('Unexpected method dispid'); + break; + } + return executeParameters; +} +OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p=function OSF_DDA_OutlookAppOm$_convertRecipientArrayParameterForOutlook$p(array) { + return (array) ? array.join(';') : null; +} +OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function OSF_DDA_OutlookAppOm$_validateAndNormalizeRecipientEmails$p(emailset, name) { + if ($h.ScriptHelpers.isNullOrUndefined(emailset)) { + return null; + } + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset, Array, name); + var originalAttendees=emailset; + var updatedAttendees=null; + var normalizationNeeded=false; + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(originalAttendees.length, 0, OSF.DDA.OutlookAppOm._maxRecipients$p, String.format('{0}.length', name)); + for (var i=0; i < originalAttendees.length; i++) { + if ($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) { + normalizationNeeded=true; + break; + } + } + if (normalizationNeeded) { + updatedAttendees=[]; + } + for (var i=0; i < originalAttendees.length; i++) { + if (normalizationNeeded) { + updatedAttendees[i]=($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) ? (originalAttendees[i]).emailAddress : originalAttendees[i]; + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i], String, String.format('{0}[{1}]', name, i)); + } + else { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i], String, String.format('{0}[{1}]', name, i)); + } + } + return updatedAttendees; +} +OSF.DDA.OutlookAppOm.prototype={ + _initialData$p$0: null, + _item$p$0: null, + _userProfile$p$0: null, + _diagnostics$p$0: null, + _officeAppContext$p$0: null, + _appReadyCallback$p$0: null, + get__appName$i$0: function OSF_DDA_OutlookAppOm$get__appName$i$0() { + return this._officeAppContext$p$0.get_appName(); + }, + initialize: function OSF_DDA_OutlookAppOm$initialize(initialData) { + var ItemTypeKey='itemType'; + this._initialData$p$0=new $h.InitialData(initialData); + if (1===initialData[ItemTypeKey]) { + this._item$p$0=new $h.Message(this._initialData$p$0); + } + else if (3===initialData[ItemTypeKey]) { + this._item$p$0=new $h.MeetingRequest(this._initialData$p$0); + } + else if (2===initialData[ItemTypeKey]) { + this._item$p$0=new $h.Appointment(this._initialData$p$0); + } + else { + Sys.Debug.trace('Unexpected item type was received from the host.'); + } + this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0); + this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0, this._officeAppContext$p$0.get_appName()); + $h.InitialData._defineReadOnlyProperty$i(this, 'item', this.$$d__getItem$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'userProfile', this.$$d__getUserProfile$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'diagnostics', this.$$d__getDiagnostics$p$0); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) { + $h.InitialData._defineReadOnlyProperty$i(this, 'ewsUrl', this.$$d__getEwsUrl$p$0); + } + }, + makeEwsRequestAsync: function OSF_DDA_OutlookAppOm$makeEwsRequestAsync(data, callback, userContext) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + if (data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) { + throw Error.argument('data', _u.ExtensibilityStrings.l_EwsRequestOversized_Text); + } + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 2, 'makeEwsRequestAsync'); + var ewsRequest=new $h.EwsRequest(userContext); + var $$t_4=this; + ewsRequest.onreadystatechange=function() { + if (4===ewsRequest.get__requestState$i$1()) { + callback(ewsRequest._asyncResult$p$0); + } + }; + ewsRequest.send(data); + }, + recordDataPoint: function OSF_DDA_OutlookAppOm$recordDataPoint(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordDataPoint', data, null); + }, + recordTrace: function OSF_DDA_OutlookAppOm$recordTrace(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'RecordTrace', data, null); + }, + trackCtq: function OSF_DDA_OutlookAppOm$trackCtq(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._invokeHostMethod$i$0(0, 'TrackCtq', data, null); + }, + convertToLocalClientTime: function OSF_DDA_OutlookAppOm$convertToLocalClientTime(timeValue) { + var date=new Date(timeValue.getTime()); + var offset=date.getTimezoneOffset() * -1; + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) { + date.setUTCMinutes(date.getUTCMinutes() - offset); + offset=this._findOffset$p$0(date); + date.setUTCMinutes(date.getUTCMinutes()+offset); + } + var retValue=this._dateToDictionary$i$0(date); + retValue['timezoneOffset']=offset; + return retValue; + }, + convertToUtcClientTime: function OSF_DDA_OutlookAppOm$convertToUtcClientTime(input) { + var retValue=this._dictionaryToDate$i$0(input); + if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) { + var offset=this._findOffset$p$0(retValue); + retValue.setUTCMinutes(retValue.getUTCMinutes() - offset); + offset=(!input['timezoneOffset']) ? retValue.getTimezoneOffset() * -1 : input['timezoneOffset']; + retValue.setUTCMinutes(retValue.getUTCMinutes()+offset); + } + return retValue; + }, + getUserIdentityTokenAsync: function OSF_DDA_OutlookAppOm$getUserIdentityTokenAsync(callback, userContext) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 1, 'getUserIdentityTokenAsync'); + this._invokeGetTokenMethodAsync$p$0(2, 'GetUserIdentityToken', callback, userContext); + }, + getCallbackTokenAsync: function OSF_DDA_OutlookAppOm$getCallbackTokenAsync(callback, userContext) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 1, 'getCallbackTokenAsync'); + if (64 !==this._officeAppContext$p$0.get_appName()) { + throw Error.notImplemented('The getCallbackTokenAsync is not supported by outlook for now.'); + } + this._invokeGetTokenMethodAsync$p$0(12, 'GetCallbackToken', callback, userContext); + }, + displayMessageForm: function OSF_DDA_OutlookAppOm$displayMessageForm(itemId) { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(8, 'DisplayExistingMessageForm', { itemId: itemId }, null); + }, + displayAppointmentForm: function OSF_DDA_OutlookAppOm$displayAppointmentForm(itemId) { + if ($h.ScriptHelpers.isNullOrUndefined(itemId)) { + throw Error.argumentNull('itemId'); + } + this._invokeHostMethod$i$0(9, 'DisplayExistingAppointmentForm', { itemId: itemId }, null); + }, + displayNewAppointmentForm: function OSF_DDA_OutlookAppOm$displayNewAppointmentForm(parameters) { + var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['requiredAttendees'], 'requiredAttendees'); + var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['optionalAttendees'], 'optionalAttendees'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['location'], 0, OSF.DDA.OutlookAppOm._maxLocationLength$p, 'location'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['body'], 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'body'); + OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['subject'], 0, OSF.DDA.OutlookAppOm._maxSubjectLength$p, 'subject'); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['start'])) { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['start'], Date, 'start'); + var startDateTime=parameters['start']; + parameters['start']=startDateTime.getTime(); + if (!$h.ScriptHelpers.isNullOrUndefined(parameters['end'])) { + OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['end'], Date, 'end'); + var endDateTime=parameters['end']; + if (endDateTime < startDateTime) { + throw Error.argumentOutOfRange('end', endDateTime, _u.ExtensibilityStrings.l_InvalidEventDates_Text); + } + parameters['end']=endDateTime.getTime(); + } + } + var updatedParameters=null; + if (normalizedRequiredAttendees || normalizedOptionalAttendees) { + updatedParameters={}; + var $$dict_6=parameters; + for (var $$key_7 in $$dict_6) { + var entry={ key: $$key_7, value: $$dict_6[$$key_7] }; + updatedParameters[entry.key]=entry.value; + } + if (normalizedRequiredAttendees) { + updatedParameters['requiredAttendees']=normalizedRequiredAttendees; + } + if (normalizedOptionalAttendees) { + updatedParameters['optionalAttendees']=normalizedOptionalAttendees; + } + } + this._invokeHostMethod$i$0(7, 'DisplayNewAppointmentForm', updatedParameters || parameters, null); + }, + _displayReplyForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyForm$i$0(htmlBody) { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody'); + } + this._invokeHostMethod$i$0(10, 'DisplayReplyForm', { htmlBody: htmlBody }, null); + }, + _displayReplyAllForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyAllForm$i$0(htmlBody) { + if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) { + OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody'); + } + this._invokeHostMethod$i$0(11, 'DisplayReplyAllForm', { htmlBody: htmlBody }, null); + }, + _invokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_invokeHostMethod$i$0(dispid, name, data, responseCallback) { + if (64===this._officeAppContext$p$0.get_appName()) { + OSF._OfficeAppFactory.getClientEndPoint().invoke(name, responseCallback, data); + } + else if (dispid) { + var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid, data); + var $$t_9=this; + window.external.Execute(dispid, executeParameters, function(nativeData, resultCode) { + if (responseCallback) { + var serializedData=nativeData.getItem(0); + var deserializedData=JSON.parse(serializedData); + responseCallback(resultCode, deserializedData); + } + }); + } + else if (responseCallback) { + responseCallback(-2, null); + } + }, + _dictionaryToDate$i$0: function OSF_DDA_OutlookAppOm$_dictionaryToDate$i$0(input) { + var retValue=new Date(input['year'], input['month'], input['date'], input['hours'], input['minutes'], input['seconds'], (!input['milliseconds']) ? 0 : input['milliseconds']); + if (isNaN(retValue.getTime())) { + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + } + return retValue; + }, + _dateToDictionary$i$0: function OSF_DDA_OutlookAppOm$_dateToDictionary$i$0(input) { + var retValue={}; + retValue['month']=input.getMonth(); + retValue['date']=input.getDate(); + retValue['year']=input.getFullYear(); + retValue['hours']=input.getHours(); + retValue['minutes']=input.getMinutes(); + retValue['seconds']=input.getSeconds(); + retValue['milliseconds']=input.getMilliseconds(); + return retValue; + }, + _getInitialDataResponseHandler$p$0: function OSF_DDA_OutlookAppOm$_getInitialDataResponseHandler$p$0(resultCode, data) { + if (resultCode) { + return; + } + this.initialize(data); + (this).displayName='mailbox'; + window.setTimeout(this.$$d__callAppReadyCallback$p$0, 0); + }, + _callAppReadyCallback$p$0: function OSF_DDA_OutlookAppOm$_callAppReadyCallback$p$0() { + this._appReadyCallback$p$0(); + }, + _invokeGetTokenMethodAsync$p$0: function OSF_DDA_OutlookAppOm$_invokeGetTokenMethodAsync$p$0(outlookDispid, methodName, callback, userContext) { + if ($h.ScriptHelpers.isNullOrUndefined(callback)) { + throw Error.argumentNull('callback'); + } + var $$t_8=this; + this._invokeHostMethod$i$0(outlookDispid, methodName, null, function(resultCode, response) { + var asyncResult; + if (resultCode) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext); + } + else { + var responseDictionary=response; + if (responseDictionary['wasSuccessful']) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(responseDictionary['token'], 0, null, userContext); + } + else { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, responseDictionary['errorMessage'], userContext); + } + } + callback(asyncResult); + }); + }, + _getItem$p$0: function OSF_DDA_OutlookAppOm$_getItem$p$0() { + return this._item$p$0; + }, + _getUserProfile$p$0: function OSF_DDA_OutlookAppOm$_getUserProfile$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0.get__permissionLevel$i$0()); + return this._userProfile$p$0; + }, + _getDiagnostics$p$0: function OSF_DDA_OutlookAppOm$_getDiagnostics$p$0() { + return this._diagnostics$p$0; + }, + _getEwsUrl$p$0: function OSF_DDA_OutlookAppOm$_getEwsUrl$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0.get__permissionLevel$i$0()); + return this._initialData$p$0.get__ewsUrl$i$0(); + }, + _findOffset$p$0: function OSF_DDA_OutlookAppOm$_findOffset$p$0(value) { + var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0(); + for (var r=0; r < ranges.length; r++) { + var range=ranges[r]; + var start=parseInt(range['start']); + var end=parseInt(range['end']); + if (value.getTime() - start >=0 && value.getTime() - end < 0) { + return parseInt(range['offset']); + } + } + throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text); + }, + _areStringsLoaded$p$0: function OSF_DDA_OutlookAppOm$_areStringsLoaded$p$0() { + var stringsLoaded=false; + try { + stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text); + } + catch ($$e_1) { + } + return stringsLoaded; + }, + _loadLocalizedScript$p$0: function OSF_DDA_OutlookAppOm$_loadLocalizedScript$p$0(stringLoadedCallback) { + var url=null; + var baseUrl=''; + var scripts=document.getElementsByTagName('script'); + for (var i=scripts.length - 1; i >=0; i--) { + var filename=null; + var attributes=scripts[i].attributes; + if (attributes) { + var attribute=attributes.getNamedItem('src'); + if (attribute) { + filename=attribute.value; + } + if (filename) { + var debug=false; + filename=filename.toLowerCase(); + var officeIndex=filename.indexOf('office_strings.js'); + if (officeIndex < 0) { + officeIndex=filename.indexOf('office_strings.debug.js'); + debug=true; + } + if ((officeIndex > 0) && (officeIndex < filename.length)) { + url=filename.replace((debug) ? 'office_strings.debug.js' : 'office_strings.js', 'outlook_strings.js'); + var languageUrl=filename.substring(0, officeIndex); + var lastIndexOfSlash=languageUrl.lastIndexOf('/', languageUrl.length - 2); + if (lastIndexOfSlash===-1) { + lastIndexOfSlash=languageUrl.lastIndexOf('\\', languageUrl.length - 2); + } + if (lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) { + baseUrl=languageUrl.substring(0, lastIndexOfSlash+1); + } + break; + } + } + } + } + if (url) { + var head=document.getElementsByTagName('head')[0]; + var scriptElement=null; + var $$t_H=this; + var scriptElementCallback=function() { + if (stringLoadedCallback && (!scriptElement.readyState || (scriptElement.readyState && (scriptElement.readyState==='loaded' || scriptElement.readyState==='complete')))) { + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + stringLoadedCallback(); + } + }; + var $$t_I=this; + var failureCallback=function() { + if (!$$t_I._areStringsLoaded$p$0()) { + var fallbackUrl=baseUrl+'en-us/'+'outlook_strings.js'; + scriptElement.onload=null; + scriptElement.onreadystatechange=null; + scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + head.appendChild(scriptElement); + } + }; + scriptElement=this._createScriptElement$p$0(url); + scriptElement.onload=scriptElementCallback; + scriptElement.onreadystatechange=scriptElementCallback; + window.setTimeout(failureCallback, 2000); + head.appendChild(scriptElement); + } + }, + _createScriptElement$p$0: function OSF_DDA_OutlookAppOm$_createScriptElement$p$0(url) { + var scriptElement=document.createElement('script'); + scriptElement.type='text/javascript'; + scriptElement.src=url; + return scriptElement; + } +} +OSF.DDA.Settings=function OSF_DDA_Settings(data) { + this._rawData$p$0=data; +} +OSF.DDA.Settings._convertFromRawSettings$p=function OSF_DDA_Settings$_convertFromRawSettings$p(rawSettings) { + if (!rawSettings) { + return {}; + } + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) { + var outlookSettings=rawSettings['SettingsKey']; + if (outlookSettings) { + return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings); + } + } + return rawSettings; +} +OSF.DDA.Settings.prototype={ + _rawData$p$0: null, + _settingsData$p$0: null, + get__data$p$0: function OSF_DDA_Settings$get__data$p$0() { + if (!this._settingsData$p$0) { + this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0); + this._rawData$p$0=null; + } + return this._settingsData$p$0; + }, + get: function OSF_DDA_Settings$get(name) { + return this.get__data$p$0()[name]; + }, + set: function OSF_DDA_Settings$set(name, value) { + this.get__data$p$0()[name]=value; + }, + remove: function OSF_DDA_Settings$remove(name) { + delete this.get__data$p$0()[name]; + }, + saveAsync: function OSF_DDA_Settings$saveAsync() { + var args=[]; + for (var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) { + args[$$pai_4]=arguments[$$pai_4]; + } + var callback=null; + var userContext=null; + if (args && args.length > 0) { + var currentArgument=args.length - 1; + if (Function.isInstanceOfType(args[currentArgument])) { + callback=args[currentArgument]; + currentArgument--; + if (currentArgument >=0) { + userContext=(args[currentArgument])['asyncContext']; + } + } + } + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) { + this._saveSettingsForOwa$p$0(callback, userContext); + } + else { + this._saveSettingsForOutlook$p$0(callback, userContext); + } + }, + _saveSettingsForOutlook$p$0: function OSF_DDA_Settings$_saveSettingsForOutlook$p$0(callback, userContext) { + var storedException=null; + try { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var jsonSettings=JSON.stringify(serializedSettings); + var settingsObjectToSave={ SettingsKey: jsonSettings }; + OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave); + } + catch (ex) { + storedException=ex; + } + if (callback) { + var asyncResult; + if (storedException) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, storedException.message, userContext); + } + else { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 0, null, userContext); + } + callback(asyncResult); + } + }, + _saveSettingsForOwa$p$0: function OSF_DDA_Settings$_saveSettingsForOwa$p$0(callback, userContext) { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()); + var $$t_7=this; + OSF._OfficeAppFactory.getClientEndPoint().invoke('saveSettingsAsync', function(resultCode, response) { + if (callback) { + var asyncResult; + if (resultCode) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext); + } + else { + var responseDictionary=response; + if (!(responseDictionary['error'])) { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 0, null, userContext); + } + else { + asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, responseDictionary['errorMessage'], userContext); + } + } + callback(asyncResult); + } + }, [ serializedSettings ]); + } +} +Type.registerNamespace('$h'); +$h.Appointment=function $h_Appointment(dataDictionary) { + this.$$d__getOrganizer$p$1=Function.createDelegate(this, this._getOrganizer$p$1); + this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this, this._getNormalizedSubject$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1); + this.$$d__getResources$p$1=Function.createDelegate(this, this._getResources$p$1); + this.$$d__getRequiredAttendees$p$1=Function.createDelegate(this, this._getRequiredAttendees$p$1); + this.$$d__getOptionalAttendees$p$1=Function.createDelegate(this, this._getOptionalAttendees$p$1); + this.$$d__getLocation$p$1=Function.createDelegate(this, this._getLocation$p$1); + this.$$d__getEnd$p$1=Function.createDelegate(this, this._getEnd$p$1); + this.$$d__getStart$p$1=Function.createDelegate(this, this._getStart$p$1); + $h.Appointment.initializeBase(this, [ dataDictionary ]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'resources', this.$$d__getResources$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'organizer', this.$$d__getOrganizer$p$1); +} +$h.Appointment.prototype={ + getEntities: function $h_Appointment$getEntities() { + return this._data$p$0._getEntities$i$0(); + }, + getEntitiesByType: function $h_Appointment$getEntitiesByType(entityType) { + return this._data$p$0._getEntitiesByType$i$0(entityType); + }, + getRegExMatches: function $h_Appointment$getRegExMatches() { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0(); + }, + getFilteredEntitiesByName: function $h_Appointment$getFilteredEntitiesByName(name) { + return this._data$p$0._getFilteredEntitiesByName$i$0(name); + }, + getRegExMatchesByName: function $h_Appointment$getRegExMatchesByName(name) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name); + }, + displayReplyForm: function $h_Appointment$displayReplyForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody); + }, + displayReplyAllForm: function $h_Appointment$displayReplyAllForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody); + }, + getItemType: function $h_Appointment$getItemType() { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment; + }, + _getStart$p$1: function $h_Appointment$_getStart$p$1() { + return this._data$p$0.get__start$i$0(); + }, + _getEnd$p$1: function $h_Appointment$_getEnd$p$1() { + return this._data$p$0.get__end$i$0(); + }, + _getLocation$p$1: function $h_Appointment$_getLocation$p$1() { + return this._data$p$0.get__location$i$0(); + }, + _getOptionalAttendees$p$1: function $h_Appointment$_getOptionalAttendees$p$1() { + return this._data$p$0.get__cc$i$0(); + }, + _getRequiredAttendees$p$1: function $h_Appointment$_getRequiredAttendees$p$1() { + return this._data$p$0.get__to$i$0(); + }, + _getResources$p$1: function $h_Appointment$_getResources$p$1() { + return this._data$p$0.get__resources$i$0(); + }, + _getSubject$p$1: function $h_Appointment$_getSubject$p$1() { + return this._data$p$0.get__subject$i$0(); + }, + _getNormalizedSubject$p$1: function $h_Appointment$_getNormalizedSubject$p$1() { + return this._data$p$0.get__normalizedSubject$i$0(); + }, + _getOrganizer$p$1: function $h_Appointment$_getOrganizer$p$1() { + return this._data$p$0.get__organizer$i$0(); + } +} +$h.AttachmentDetails=function $h_AttachmentDetails(data) { + this.$$d__getIsInline$p$0=Function.createDelegate(this, this._getIsInline$p$0); + this.$$d__getAttachmentType$p$0=Function.createDelegate(this, this._getAttachmentType$p$0); + this.$$d__getSize$p$0=Function.createDelegate(this, this._getSize$p$0); + this.$$d__getContentType$p$0=Function.createDelegate(this, this._getContentType$p$0); + this.$$d__getName$p$0=Function.createDelegate(this, this._getName$p$0); + this.$$d__getId$p$0=Function.createDelegate(this, this._getId$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'id', this.$$d__getId$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'name', this.$$d__getName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contentType', this.$$d__getContentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'size', this.$$d__getSize$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attachmentType', this.$$d__getAttachmentType$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'isInline', this.$$d__getIsInline$p$0); +} +$h.AttachmentDetails.prototype={ + _data$p$0: null, + _getId$p$0: function $h_AttachmentDetails$_getId$p$0() { + return this._data$p$0['id']; + }, + _getName$p$0: function $h_AttachmentDetails$_getName$p$0() { + return this._data$p$0['name']; + }, + _getContentType$p$0: function $h_AttachmentDetails$_getContentType$p$0() { + return this._data$p$0['contentType']; + }, + _getSize$p$0: function $h_AttachmentDetails$_getSize$p$0() { + return this._data$p$0['size']; + }, + _getAttachmentType$p$0: function $h_AttachmentDetails$_getAttachmentType$p$0() { + var response=this._data$p$0['attachmentType']; + return (response < $h.AttachmentDetails._attachmentTypeMap$p.length) ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File; + }, + _getIsInline$p$0: function $h_AttachmentDetails$_getIsInline$p$0() { + return this._data$p$0['isInline']; + } +} +$h.Contact=function $h_Contact(data) { + this.$$d__getContactString$p$0=Function.createDelegate(this, this._getContactString$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getBusinessName$p$0=Function.createDelegate(this, this._getBusinessName$p$0); + this.$$d__getPersonName$p$0=Function.createDelegate(this, this._getPersonName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'personName', this.$$d__getPersonName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'businessName', this.$$d__getBusinessName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contactString', this.$$d__getContactString$p$0); +} +$h.Contact.prototype={ + _data$p$0: null, + _phoneNumbers$p$0: null, + _getPersonName$p$0: function $h_Contact$_getPersonName$p$0() { + return this._data$p$0['PersonName']; + }, + _getBusinessName$p$0: function $h_Contact$_getBusinessName$p$0() { + return this._data$p$0['BusinessName']; + }, + _getAddresses$p$0: function $h_Contact$_getAddresses$p$0() { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses'); + }, + _getEmailAddresses$p$0: function $h_Contact$_getEmailAddresses$p$0() { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses'); + }, + _getUrls$p$0: function $h_Contact$_getUrls$p$0() { + return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls'); + }, + _getPhoneNumbers$p$0: function $h_Contact$_getPhoneNumbers$p$0() { + if (!this._phoneNumbers$p$0) { + var $$t_1=this; + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', function(data) { + return new $h.PhoneNumber(data); + }); + } + return this._phoneNumbers$p$0; + }, + _getContactString$p$0: function $h_Contact$_getContactString$p$0() { + return this._data$p$0['ContactString']; + } +} +$h.CustomProperties=function $h_CustomProperties(data) { + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + throw Error.argumentNull('data'); + } + this._data$p$0=data; +} +$h.CustomProperties.prototype={ + _data$p$0: null, + get: function $h_CustomProperties$get(name) { + var value=this._data$p$0[name]; + if (typeof(value)==='string') { + var valueString=value; + if (valueString.length > 6 && valueString.startsWith('Date(') && valueString.endsWith(')')) { + var ticksString=valueString.substring(5, valueString.length - 1); + var ticks=parseInt(ticksString); + if (!isNaN(ticks)) { + var dateTimeValue=new Date(ticks); + if (dateTimeValue) { + value=dateTimeValue; + } + } + } + } + return value; + }, + set: function $h_CustomProperties$set(name, value) { + if (OSF.OUtil.isDate(value)) { + value='Date('+(value).getTime()+')'; + } + this._data$p$0[name]=value; + }, + remove: function $h_CustomProperties$remove(name) { + delete this._data$p$0[name]; + }, + saveAsync: function $h_CustomProperties$saveAsync(callback, userContext) { + var MaxCustomPropertiesLength=2500; + if (JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) { + throw Error.argument(); + } + var saveCustomProperties=new $h._saveDictionaryRequest(callback, userContext); + saveCustomProperties._sendRequest$i$0(4, 'SaveCustomProperties', { customProperties: this._data$p$0 }); + } +} +$h.Diagnostics=function $h_Diagnostics(data, appName) { + this.$$d__getOwaView$p$0=Function.createDelegate(this, this._getOwaView$p$0); + this.$$d__getHostVersion$p$0=Function.createDelegate(this, this._getHostVersion$p$0); + this.$$d__getHostName$p$0=Function.createDelegate(this, this._getHostName$p$0); + this._data$p$0=data; + this._appName$p$0=appName; + $h.InitialData._defineReadOnlyProperty$i(this, 'hostName', this.$$d__getHostName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'hostVersion', this.$$d__getHostVersion$p$0); + if (64===this._appName$p$0) { + $h.InitialData._defineReadOnlyProperty$i(this, 'OWAView', this.$$d__getOwaView$p$0); + } +} +$h.Diagnostics.prototype={ + _data$p$0: null, + _appName$p$0: 0, + _getHostName$p$0: function $h_Diagnostics$_getHostName$p$0() { + if (8===this._appName$p$0) { + return 'Outlook'; + } + else if (64===this._appName$p$0) { + return 'OutlookWebApp'; + } + return null; + }, + _getHostVersion$p$0: function $h_Diagnostics$_getHostVersion$p$0() { + return this._data$p$0.get__hostVersion$i$0(); + }, + _getOwaView$p$0: function $h_Diagnostics$_getOwaView$p$0() { + return this._data$p$0.get__owaView$i$0(); + } +} +$h.EmailAddressDetails=function $h_EmailAddressDetails(data) { + this.$$d__getRecipientType$p$0=Function.createDelegate(this, this._getRecipientType$p$0); + this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this, this._getAppointmentResponse$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'appointmentResponse')) { + $h.InitialData._defineReadOnlyProperty$i(this, 'appointmentResponse', this.$$d__getAppointmentResponse$p$0); + } + if ($h.ScriptHelpers.dictionaryContainsKey(data, 'recipientType')) { + $h.InitialData._defineReadOnlyProperty$i(this, 'recipientType', this.$$d__getRecipientType$p$0); + } +} +$h.EmailAddressDetails._createFromEmailUserDictionary$i=function $h_EmailAddressDetails$_createFromEmailUserDictionary$i(data) { + var emailAddressDetailsDictionary={}; + var displayName=data['Name']; + var emailAddress=data['UserId']; + emailAddressDetailsDictionary['name']=displayName || $h.EmailAddressDetails._emptyString$p; + emailAddressDetailsDictionary['address']=emailAddress || $h.EmailAddressDetails._emptyString$p; + return new $h.EmailAddressDetails(emailAddressDetailsDictionary); +} +$h.EmailAddressDetails.prototype={ + _data$p$0: null, + _getEmailAddress$p$0: function $h_EmailAddressDetails$_getEmailAddress$p$0() { + return this._data$p$0['address']; + }, + _getDisplayName$p$0: function $h_EmailAddressDetails$_getDisplayName$p$0() { + return this._data$p$0['name']; + }, + _getAppointmentResponse$p$0: function $h_EmailAddressDetails$_getAppointmentResponse$p$0() { + var response=this._data$p$0['appointmentResponse']; + return (response < $h.EmailAddressDetails._responseTypeMap$p.length) ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None; + }, + _getRecipientType$p$0: function $h_EmailAddressDetails$_getRecipientType$p$0() { + var response=this._data$p$0['recipientType']; + return (response < $h.EmailAddressDetails._recipientTypeMap$p.length) ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other; + } +} +$h.Entities=function $h_Entities(data, filteredEntitiesData, timeSent, permissionLevel) { + this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this, this._createMeetingSuggestion$p$0); + this.$$d__getContacts$p$0=Function.createDelegate(this, this._getContacts$p$0); + this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0); + this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0); + this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0); + this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this, this._getMeetingSuggestions$p$0); + this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this, this._getTaskSuggestions$p$0); + this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0); + this._data$p$0=data || {}; + this._filteredData$p$0=filteredEntitiesData || {}; + this._dateTimeSent$p$0=timeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'taskSuggestions', this.$$d__getTaskSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingSuggestions', this.$$d__getMeetingSuggestions$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'contacts', this.$$d__getContacts$p$0); + this._permissionLevel$p$0=permissionLevel; +} +$h.Entities._getExtractedObjects$i=function $h_Entities$_getExtractedObjects$i(T, data, name, creator, removeDuplicates, stringPropertyName) { + var results=null; + var extractedObjects=data[name]; + if (!extractedObjects) { + return new Array(0); + } + if (removeDuplicates) { + extractedObjects=$h.Entities._removeDuplicate$p(Object, extractedObjects, $h.Entities._entityDictionaryEquals$p, stringPropertyName); + } + results=new Array(extractedObjects.length); + var count=0; + for (var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) { + var extractedObject=$$arr_9[$$idx_B]; + results[count++]=creator(extractedObject); + } + return results; +} +$h.Entities._getExtractedStringProperty$i=function $h_Entities$_getExtractedStringProperty$i(data, name, removeDuplicate) { + var extractedProperties=data[name]; + if (!extractedProperties) { + return new Array(0); + } + if (removeDuplicate) { + extractedProperties=$h.Entities._removeDuplicate$p(String, extractedProperties, $h.Entities._stringEquals$p, null); + } + return extractedProperties; +} +$h.Entities._createContact$p=function $h_Entities$_createContact$p(data) { + return new $h.Contact(data); +} +$h.Entities._createTaskSuggestion$p=function $h_Entities$_createTaskSuggestion$p(data) { + return new $h.TaskSuggestion(data); +} +$h.Entities._createPhoneNumber$p=function $h_Entities$_createPhoneNumber$p(data) { + return new $h.PhoneNumber(data); +} +$h.Entities._entityDictionaryEquals$p=function $h_Entities$_entityDictionaryEquals$p(dictionary1, dictionary2, entityPropertyIdentifier) { + if (dictionary1===dictionary2) { + return true; + } + if (!dictionary1 || !dictionary2) { + return false; + } + if (dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) { + return true; + } + return false; +} +$h.Entities._stringEquals$p=function $h_Entities$_stringEquals$p(string1, string2, entityProperty) { + return string1===string2; +} +$h.Entities._removeDuplicate$p=function $h_Entities$_removeDuplicate$p(T, array, entityEquals, entityPropertyIdentifier) { + for (var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) { + var removeMatch=false; + for (var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) { + if (entityEquals(array[matchIndex1], array[matchIndex2], entityPropertyIdentifier)) { + removeMatch=true; + break; + } + } + if (removeMatch) { + Array.removeAt(array, matchIndex1); + } + } + return array; +} +$h.Entities.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _filteredData$p$0: null, + _filteredEntitiesCache$p$0: null, + _permissionLevel$p$0: 0, + _taskSuggestions$p$0: null, + _meetingSuggestions$p$0: null, + _phoneNumbers$p$0: null, + _contacts$p$0: null, + _addresses$p$0: null, + _emailAddresses$p$0: null, + _urls$p$0: null, + _getByType$i$0: function $h_Entities$_getByType$i$0(entityType) { + if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) { + return this._getMeetingSuggestions$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) { + return this._getTaskSuggestions$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) { + return this._getAddresses$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) { + return this._getPhoneNumbers$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) { + return this._getEmailAddresses$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) { + return this._getUrls$p$0(); + } + else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) { + return this._getContacts$p$0(); + } + return null; + }, + _getFilteredEntitiesByName$i$0: function $h_Entities$_getFilteredEntitiesByName$i$0(name) { + if (!this._filteredEntitiesCache$p$0) { + this._filteredEntitiesCache$p$0={}; + } + if (!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0, name)) { + var found=false; + for (var i=0; i < $h.Entities._allEntityKeys$p.length; i++) { + var entityTypeKey=$h.Entities._allEntityKeys$p[i]; + var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey]; + if (!perEntityTypeDictionary) { + continue; + } + if ($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary, name)) { + switch (entityTypeKey) { + case 'EmailAddresses': + case 'Urls': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name); + break; + case 'Addresses': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name, true); + break; + case 'PhoneNumbers': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber, perEntityTypeDictionary, name, $h.Entities._createPhoneNumber$p, false, null); + break; + case 'TaskSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, perEntityTypeDictionary, name, $h.Entities._createTaskSuggestion$p, true, 'TaskString'); + break; + case 'MeetingSuggestions': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, perEntityTypeDictionary, name, this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString'); + break; + case 'Contacts': + this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact, perEntityTypeDictionary, name, $h.Entities._createContact$p, true, 'ContactString'); + break; + } + found=true; + break; + } + } + if (!found) { + this._filteredEntitiesCache$p$0[name]=null; + } + } + return this._filteredEntitiesCache$p$0[name]; + }, + _createMeetingSuggestion$p$0: function $h_Entities$_createMeetingSuggestion$p$0(data) { + return new $h.MeetingSuggestion(data, this._dateTimeSent$p$0); + }, + _getAddresses$p$0: function $h_Entities$_getAddresses$p$0() { + if (!this._addresses$p$0) { + this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses', true); + } + return this._addresses$p$0; + }, + _getEmailAddresses$p$0: function $h_Entities$_getEmailAddresses$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._emailAddresses$p$0) { + this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses', false); + } + return this._emailAddresses$p$0; + }, + _getUrls$p$0: function $h_Entities$_getUrls$p$0() { + if (!this._urls$p$0) { + this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls', false); + } + return this._urls$p$0; + }, + _getPhoneNumbers$p$0: function $h_Entities$_getPhoneNumbers$p$0() { + if (!this._phoneNumbers$p$0) { + this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', $h.Entities._createPhoneNumber$p); + } + return this._phoneNumbers$p$0; + }, + _getTaskSuggestions$p$0: function $h_Entities$_getTaskSuggestions$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._taskSuggestions$p$0) { + this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, this._data$p$0, 'TaskSuggestions', $h.Entities._createTaskSuggestion$p, true, 'TaskString'); + } + return this._taskSuggestions$p$0; + }, + _getMeetingSuggestions$p$0: function $h_Entities$_getMeetingSuggestions$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._meetingSuggestions$p$0) { + this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, this._data$p$0, 'MeetingSuggestions', this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString'); + } + return this._meetingSuggestions$p$0; + }, + _getContacts$p$0: function $h_Entities$_getContacts$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0); + if (!this._contacts$p$0) { + this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact, this._data$p$0, 'Contacts', $h.Entities._createContact$p, true, 'ContactString'); + } + return this._contacts$p$0; + } +} +$h.Item=function $h_Item(data) { + this.$$d__createCustomProperties$i$0=Function.createDelegate(this, this._createCustomProperties$i$0); + this.$$d__getAttachments$p$0=Function.createDelegate(this, this._getAttachments$p$0); + this.$$d__getItemClass$p$0=Function.createDelegate(this, this._getItemClass$p$0); + this.$$d__getItemId$p$0=Function.createDelegate(this, this._getItemId$p$0); + this.$$d__getDateTimeModified$p$0=Function.createDelegate(this, this._getDateTimeModified$p$0); + this.$$d__getDateTimeCreated$p$0=Function.createDelegate(this, this._getDateTimeCreated$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeCreated', this.$$d__getDateTimeCreated$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeModified', this.$$d__getDateTimeModified$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemId', this.$$d__getItemId$p$0); + var $$t_1=this; + $h.InitialData._defineReadOnlyProperty$i(this, 'itemType', function() { + return $$t_1.getItemType(); + }); + $h.InitialData._defineReadOnlyProperty$i(this, 'itemClass', this.$$d__getItemClass$p$0); + if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) { + $h.InitialData._defineReadOnlyProperty$i(this, 'attachments', this.$$d__getAttachments$p$0); + } +} +$h.Item.prototype={ + _data$p$0: null, + loadCustomPropertiesAsync: function $h_Item$loadCustomPropertiesAsync(callback, userContext) { + if ($h.ScriptHelpers.isNullOrUndefined(callback)) { + throw Error.argumentNull('callback'); + } + var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0, 'customProperties', callback, userContext); + loadCustomProperties._sendRequest$i$0(3, 'LoadCustomProperties', {}); + }, + _createCustomProperties$i$0: function $h_Item$_createCustomProperties$i$0(data) { + return new $h.CustomProperties(data); + }, + _getItemId$p$0: function $h_Item$_getItemId$p$0() { + return this._data$p$0.get__itemId$i$0(); + }, + _getItemClass$p$0: function $h_Item$_getItemClass$p$0() { + return this._data$p$0.get__itemClass$i$0(); + }, + _getDateTimeCreated$p$0: function $h_Item$_getDateTimeCreated$p$0() { + return this._data$p$0.get__dateTimeCreated$i$0(); + }, + _getDateTimeModified$p$0: function $h_Item$_getDateTimeModified$p$0() { + return this._data$p$0.get__dateTimeModified$i$0(); + }, + _getAttachments$p$0: function $h_Item$_getAttachments$p$0() { + return this._data$p$0.get__attachments$i$0(); + } +} +$h.MeetingRequest=function $h_MeetingRequest(data) { + this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2); + this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2); + this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2); + this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2); + this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2); + $h.MeetingRequest.initializeBase(this, [ data ]); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2); + $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2); +} +$h.MeetingRequest.prototype={ + _getStart$p$2: function $h_MeetingRequest$_getStart$p$2() { + return this._data$p$0.get__start$i$0(); + }, + _getEnd$p$2: function $h_MeetingRequest$_getEnd$p$2() { + return this._data$p$0.get__end$i$0(); + }, + _getLocation$p$2: function $h_MeetingRequest$_getLocation$p$2() { + return this._data$p$0.get__location$i$0(); + }, + _getOptionalAttendees$p$2: function $h_MeetingRequest$_getOptionalAttendees$p$2() { + return this._data$p$0.get__cc$i$0(); + }, + _getRequiredAttendees$p$2: function $h_MeetingRequest$_getRequiredAttendees$p$2() { + return this._data$p$0.get__to$i$0(); + } +} +$h.MeetingSuggestion=function $h_MeetingSuggestion(data, dateTimeSent) { + this.$$d__getEndTime$p$0=Function.createDelegate(this, this._getEndTime$p$0); + this.$$d__getStartTime$p$0=Function.createDelegate(this, this._getStartTime$p$0); + this.$$d__getSubject$p$0=Function.createDelegate(this, this._getSubject$p$0); + this.$$d__getLocation$p$0=Function.createDelegate(this, this._getLocation$p$0); + this.$$d__getAttendees$p$0=Function.createDelegate(this, this._getAttendees$p$0); + this.$$d__getMeetingString$p$0=Function.createDelegate(this, this._getMeetingString$p$0); + this._data$p$0=data; + this._dateTimeSent$p$0=dateTimeSent; + $h.InitialData._defineReadOnlyProperty$i(this, 'meetingString', this.$$d__getMeetingString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'attendees', this.$$d__getAttendees$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStartTime$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEndTime$p$0); +} +$h.MeetingSuggestion.prototype={ + _dateTimeSent$p$0: null, + _data$p$0: null, + _attendees$p$0: null, + _getMeetingString$p$0: function $h_MeetingSuggestion$_getMeetingString$p$0() { + return this._data$p$0['MeetingString']; + }, + _getLocation$p$0: function $h_MeetingSuggestion$_getLocation$p$0() { + return this._data$p$0['Location']; + }, + _getSubject$p$0: function $h_MeetingSuggestion$_getSubject$p$0() { + return this._data$p$0['Subject']; + }, + _getStartTime$p$0: function $h_MeetingSuggestion$_getStartTime$p$0() { + var time=this._createDateTimeFromParameter$p$0('StartTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + } + return time; + }, + _getEndTime$p$0: function $h_MeetingSuggestion$_getEndTime$p$0() { + var time=this._createDateTimeFromParameter$p$0('EndTime'); + var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0); + if (resolvedTime.getTime() !==time.getTime()) { + return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime)); + } + return time; + }, + _createDateTimeFromParameter$p$0: function $h_MeetingSuggestion$_createDateTimeFromParameter$p$0(keyName) { + var dateTimeString=this._data$p$0[keyName]; + if (!dateTimeString) { + return null; + } + return new Date(dateTimeString); + }, + _getAttendees$p$0: function $h_MeetingSuggestion$_getAttendees$p$0() { + if (!this._attendees$p$0) { + var $$t_1=this; + this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Attendees', function(data) { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data); + }); + } + return this._attendees$p$0; + } +} +$h.MeetingSuggestionTimeDecoder=function $h_MeetingSuggestionTimeDecoder() { +} +$h.MeetingSuggestionTimeDecoder.resolve=function $h_MeetingSuggestionTimeDecoder$resolve(inTime, sentTime) { + if (!sentTime) { + return inTime; + } + try { + var tod; + var outDate; + var extractedDate; + var sentDate=new Date(sentTime.getFullYear(), sentTime.getMonth(), sentTime.getDate(), 0, 0, 0, 0); + var $$t_7, $$t_8, $$t_9; + if (!(($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime, ($$t_7={'val': extractedDate}), ($$t_8={'val': tod}))), extractedDate=$$t_7.val, tod=$$t_8.val, $$t_9)) { + return inTime; + } + else { + if ($h._preciseDate.isInstanceOfType(extractedDate)) { + outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate, extractedDate); + } + else { + if ($h._relativeDate.isInstanceOfType(extractedDate)) { + outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate, extractedDate); + } + else { + outDate=sentDate; + } + } + if (isNaN(outDate.getTime())) { + return sentTime; + } + outDate.setMilliseconds(outDate.getMilliseconds()+tod); + return outDate; + } + } + catch ($$e_6) { + return sentTime; + } +} +$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function $h_MeetingSuggestionTimeDecoder$_isNullOrUndefined$i(value) { + return null===value || value===undefined; +} +$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_resolvePreciseDate$p(sentDate, precise) { + var year=precise._year$i$1; + var month=(!precise._month$i$1) ? sentDate.getMonth() : precise._month$i$1 - 1; + var day=precise._day$i$1; + if (!day) { + return sentDate; + } + var candidate; + if ($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) { + candidate=new Date(sentDate.getFullYear(), month, day); + if (candidate.getTime() < sentDate.getTime()) { + candidate=new Date(sentDate.getFullYear()+1, month, day); + } + } + else { + candidate=new Date((year < 50) ? 2000+year : 1900+year, month, day); + } + if (candidate.getMonth() !==month) { + return sentDate; + } + return candidate; +} +$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_resolveRelativeDate$p(sentDate, relative) { + var date; + switch (relative._unit$i$1) { + case 0: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(date.getDate()+relative._offset$i$1); + return date; + case 5: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate, relative._offset$i$1, relative._tag$i$1); + case 2: + var days=1; + switch (relative._modifier$i$1) { + case 1: + break; + case 2: + days=16; + break; + default: + if (!relative._offset$i$1) { + days=sentDate.getDate(); + } + break; + } + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), days); + date.setMonth(date.getMonth()+relative._offset$i$1); + if (date.getTime() < sentDate.getTime()) { + date.setDate(date.getDate()+sentDate.getDate() - 1); + } + return date; + case 1: + date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate()); + date.setDate(sentDate.getDate()+(7 * relative._offset$i$1)); + if (relative._modifier$i$1===1 || !relative._modifier$i$1) { + date.setDate(date.getDate()+1 - date.getDay()); + if (date.getTime() < sentDate.getTime()) { + return sentDate; + } + return date; + } + else if (relative._modifier$i$1===2) { + date.setDate(date.getDate()+5 - date.getDay()); + return date; + } + break; + case 4: + return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate, relative); + case 3: + if (relative._offset$i$1 > 0) { + return new Date(sentDate.getFullYear()+relative._offset$i$1, 0, 1); + } + break; + default: + break; + } + return sentDate; +} +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekDate$p(sentDate, offset, tag) { + if (offset > -5 && offset < 5) { + var dayOfWeek; + var days; + dayOfWeek=((tag+6) % 7)+1; + days=(7 * offset)+(dayOfWeek - sentDate.getDay()); + sentDate.setDate(sentDate.getDate()+days); + return sentDate; + } + else { + var days=(tag - sentDate.getDay()) % 7; + if (days < 0) { + days+=7; + } + sentDate.setDate(sentDate.getDate()+days); + return sentDate; + } +} +$h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekOfMonthDate$p(sentDate, relative) { + var date; + var firstDay; + var newDate; + date=sentDate; + if (relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) { + return sentDate; + } + var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12; + firstDay=new Date(date.getFullYear(), date.getMonth()+monthOffset, 1); + if (relative._modifier$i$1===1) { + if (relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay() !==0) { + return firstDay; + } + else { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), firstDay.getDate()); + newDate.setDate(newDate.getDate()+((7+(1 - firstDay.getDay())) % 7)); + if (firstDay.getDay() !==6 && firstDay.getDay() !==0 && firstDay.getDay() !==1) { + newDate.setDate(newDate.getDate() - 7); + } + newDate.setDate(newDate.getDate()+(7 * (relative._offset$i$1 - 1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) { + return sentDate; + } + return newDate; + } + } + else { + newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), $h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(), firstDay.getFullYear())); + var offset=1 - newDate.getDay(); + if (offset > 0) { + offset=offset - 7; + } + newDate.setDate(newDate.getDate()+offset); + newDate.setDate(newDate.getDate()+(7 * (1 - relative._offset$i$1))); + if (newDate.getMonth()+1 !==relative._tag$i$1) { + if (firstDay.getDay() !==6 && firstDay.getDay() !==0) { + return firstDay; + } + else { + return sentDate; + } + } + else { + return newDate; + } + } +} +$h.MeetingSuggestionTimeDecoder._decode$p=function $h_MeetingSuggestionTimeDecoder$_decode$p(inDate, date, time) { + var DateValueMask=32767; + date.val=null; + time.val=0; + if (!inDate) { + return false; + } + time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate); + var inDateAtMidnight=inDate.getTime() - time.val; + var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 86400000; + if (value < 0) { + return false; + } + else if (value >=262144) { + return false; + } + else { + var type=value >> 15; + value=value & DateValueMask; + switch (type) { + case 0: + return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value, date); + case 1: + return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value, date); + default: + return false; + } + } +} +$h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_decodePreciseDate$p(value, date) { + var c_SubTypeMask=7; + var c_MonthMask=15; + var c_DayMask=31; + var c_YearMask=127; + var year=null; + var month=0; + var day=0; + date.val=null; + var subType=(value >> 12) & c_SubTypeMask; + if ((subType & 4)===4) { + year=(value >> 5) & c_YearMask; + if ((subType & 2)===2) { + if ((subType & 1)===1) { + return false; + } + month=(value >> 1) & c_MonthMask; + } + } + else { + if ((subType & 2)===2) { + month=(value >> 8) & c_MonthMask; + } + if ((subType & 1)===1) { + day=(value >> 3) & c_DayMask; + } + } + date.val=new $h._preciseDate(day, month, year); + return true; +} +$h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_decodeRelativeDate$p(value, date) { + var TagMask=15; + var OffsetMask=63; + var UnitMask=7; + var ModifierMask=3; + var tag=value & TagMask; + value >>=4; + var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask, 6); + value >>=6; + var unit=value & UnitMask; + value >>=3; + var modifier=value & ModifierMask; + try { + date.val=new $h._relativeDate(modifier, offset, unit, tag); + return true; + } + catch ($$e_A) { + date.val=null; + return false; + } +} +$h.MeetingSuggestionTimeDecoder._fromComplement$p=function $h_MeetingSuggestionTimeDecoder$_fromComplement$p(value, n) { + var signed=1 << (n - 1); + var mask=(1 << n) - 1; + if ((value & signed)===signed) { + return -((value ^ mask)+1); + } + else { + return value; + } +} +$h.MeetingSuggestionTimeDecoder._daysInMonth$p=function $h_MeetingSuggestionTimeDecoder$_daysInMonth$p(month, year) { + return 32 - new Date(year, month, 32).getDate(); +} +$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function $h_MeetingSuggestionTimeDecoder$_getTimeOfDayInMillisecondsUTC$p(inputTime) { + var timeOfDay=0; + timeOfDay+=inputTime.getUTCHours() * 3600; + timeOfDay+=inputTime.getUTCMinutes() * 60; + timeOfDay+=inputTime.getUTCSeconds(); + timeOfDay *=1000; + timeOfDay+=inputTime.getUTCMilliseconds(); + return timeOfDay; +} +$h._extractedDate=function $h__extractedDate() { +} +$h._preciseDate=function $h__preciseDate(day, month, year) { + $h._preciseDate.initializeBase(this); + if (day < 0 || day > 31) { + throw Error.argumentOutOfRange('day'); + } + if (month < 0 || month > 12) { + throw Error.argumentOutOfRange('month'); + } + this._day$i$1=day; + this._month$i$1=month; + if (!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) { + if (!month && day) { + throw Error.argument('Invalid arguments'); + } + if (year < 0 || year > 2099) { + throw Error.argumentOutOfRange('year'); + } + this._year$i$1=year % 100; + } + else if (!this._month$i$1 && !this._day$i$1) { + throw Error.argument('Invalid datetime'); + } +} +$h._preciseDate.prototype={ + _day$i$1: 0, + _month$i$1: 0, + _year$i$1: null +} +$h._relativeDate=function $h__relativeDate(modifier, offset, unit, tag) { + $h._relativeDate.initializeBase(this); + if (offset < -32 || offset > 31) { + throw Error.argumentOutOfRange('offset'); + } + if (tag < 0 || tag > 15) { + throw Error.argumentOutOfRange('tag'); + } + if (!unit && offset < 0) { + throw Error.argument('unit & offset do not form a valid date'); + } + this._modifier$i$1=modifier; + this._offset$i$1=offset; + this._unit$i$1=unit; + this._tag$i$1=tag; +} +$h._relativeDate.prototype={ + _modifier$i$1: 0, + _offset$i$1: 0, + _unit$i$1: 0, + _tag$i$1: 0 +} +$h.Message=function $h_Message(dataDictionary) { + this.$$d__getConversationId$p$1=Function.createDelegate(this, this._getConversationId$p$1); + this.$$d__getInternetMessageId$p$1=Function.createDelegate(this, this._getInternetMessageId$p$1); + this.$$d__getCc$p$1=Function.createDelegate(this, this._getCc$p$1); + this.$$d__getTo$p$1=Function.createDelegate(this, this._getTo$p$1); + this.$$d__getFrom$p$1=Function.createDelegate(this, this._getFrom$p$1); + this.$$d__getSender$p$1=Function.createDelegate(this, this._getSender$p$1); + this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this, this._getNormalizedSubject$p$1); + this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1); + $h.Message.initializeBase(this, [ dataDictionary ]); + $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'sender', this.$$d__getSender$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'from', this.$$d__getFrom$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'internetMessageId', this.$$d__getInternetMessageId$p$1); + $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$1); +} +$h.Message.prototype={ + getEntities: function $h_Message$getEntities() { + return this._data$p$0._getEntities$i$0(); + }, + getEntitiesByType: function $h_Message$getEntitiesByType(entityType) { + return this._data$p$0._getEntitiesByType$i$0(entityType); + }, + getFilteredEntitiesByName: function $h_Message$getFilteredEntitiesByName(name) { + return this._data$p$0._getFilteredEntitiesByName$i$0(name); + }, + getRegExMatches: function $h_Message$getRegExMatches() { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatches'); + return this._data$p$0._getRegExMatches$i$0(); + }, + getRegExMatchesByName: function $h_Message$getRegExMatchesByName(name) { + OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatchesByName'); + return this._data$p$0._getRegExMatchesByName$i$0(name); + }, + displayReplyForm: function $h_Message$displayReplyForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody); + }, + displayReplyAllForm: function $h_Message$displayReplyAllForm(htmlBody) { + OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody); + }, + getItemType: function $h_Message$getItemType() { + return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message; + }, + _getSubject$p$1: function $h_Message$_getSubject$p$1() { + return this._data$p$0.get__subject$i$0(); + }, + _getNormalizedSubject$p$1: function $h_Message$_getNormalizedSubject$p$1() { + return this._data$p$0.get__normalizedSubject$i$0(); + }, + _getSender$p$1: function $h_Message$_getSender$p$1() { + return this._data$p$0.get__sender$i$0(); + }, + _getFrom$p$1: function $h_Message$_getFrom$p$1() { + return this._data$p$0.get__from$i$0(); + }, + _getTo$p$1: function $h_Message$_getTo$p$1() { + return this._data$p$0.get__to$i$0(); + }, + _getCc$p$1: function $h_Message$_getCc$p$1() { + return this._data$p$0.get__cc$i$0(); + }, + _getInternetMessageId$p$1: function $h_Message$_getInternetMessageId$p$1() { + return this._data$p$0.get__internetMessageId$i$0(); + }, + _getConversationId$p$1: function $h_Message$_getConversationId$p$1() { + return this._data$p$0.get__conversationId$i$0(); + } +} +$h.PhoneNumber=function $h_PhoneNumber(data) { + this.$$d__getPhoneType$p$0=Function.createDelegate(this, this._getPhoneType$p$0); + this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this, this._getOriginalPhoneString$p$0); + this.$$d__getPhoneString$p$0=Function.createDelegate(this, this._getPhoneString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'phoneString', this.$$d__getPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'originalPhoneString', this.$$d__getOriginalPhoneString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'type', this.$$d__getPhoneType$p$0); +} +$h.PhoneNumber.prototype={ + _data$p$0: null, + _getPhoneString$p$0: function $h_PhoneNumber$_getPhoneString$p$0() { + return this._data$p$0['PhoneString']; + }, + _getOriginalPhoneString$p$0: function $h_PhoneNumber$_getOriginalPhoneString$p$0() { + return this._data$p$0['OriginalPhoneString']; + }, + _getPhoneType$p$0: function $h_PhoneNumber$_getPhoneType$p$0() { + return this._data$p$0['Type']; + } +} +$h.TaskSuggestion=function $h_TaskSuggestion(data) { + this.$$d__getAssignees$p$0=Function.createDelegate(this, this._getAssignees$p$0); + this.$$d__getTaskString$p$0=Function.createDelegate(this, this._getTaskString$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'taskString', this.$$d__getTaskString$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'assignees', this.$$d__getAssignees$p$0); +} +$h.TaskSuggestion.prototype={ + _data$p$0: null, + _assignees$p$0: null, + _getTaskString$p$0: function $h_TaskSuggestion$_getTaskString$p$0() { + return this._data$p$0['TaskString']; + }, + _getAssignees$p$0: function $h_TaskSuggestion$_getAssignees$p$0() { + if (!this._assignees$p$0) { + var $$t_1=this; + this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Assignees', function(data) { + return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data); + }); + } + return this._assignees$p$0; + } +} +$h.UserProfile=function $h_UserProfile(data) { + this.$$d__getTimeZone$p$0=Function.createDelegate(this, this._getTimeZone$p$0); + this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0); + this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0); + this._data$p$0=data; + $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0); + $h.InitialData._defineReadOnlyProperty$i(this, 'timeZone', this.$$d__getTimeZone$p$0); +} +$h.UserProfile.prototype={ + _data$p$0: null, + _getDisplayName$p$0: function $h_UserProfile$_getDisplayName$p$0() { + return this._data$p$0.get__userDisplayName$i$0(); + }, + _getEmailAddress$p$0: function $h_UserProfile$_getEmailAddress$p$0() { + return this._data$p$0.get__userEmailAddress$i$0(); + }, + _getTimeZone$p$0: function $h_UserProfile$_getTimeZone$p$0() { + return this._data$p$0.get__userTimeZone$i$0(); + } +} +$h.RequestState=function() {} +$h.RequestState.prototype={ + unsent: 0, + opened: 1, + headersReceived: 2, + loading: 3, + done: 4 +} +$h.RequestState.registerEnum('$h.RequestState', false); +$h.EwsRequest=function $h_EwsRequest(userContext) { + this.readyState=1; + $h.EwsRequest.initializeBase(this, [ userContext ]); +} +$h.EwsRequest.prototype={ + status: 0, + statusText: null, + onreadystatechange: null, + responseText: null, + get__statusCode$i$1: function $h_EwsRequest$get__statusCode$i$1() { + return this.status; + }, + set__statusCode$i$1: function $h_EwsRequest$set__statusCode$i$1(value) { + this.status=value; + return value; + }, + get__statusDescription$i$1: function $h_EwsRequest$get__statusDescription$i$1() { + return this.statusText; + }, + set__statusDescription$i$1: function $h_EwsRequest$set__statusDescription$i$1(value) { + this.statusText=value; + return value; + }, + get__requestState$i$1: function $h_EwsRequest$get__requestState$i$1() { + return this.readyState; + }, + set__requestState$i$1: function $h_EwsRequest$set__requestState$i$1(value) { + this.readyState=value; + return value; + }, + get__response$i$1: function $h_EwsRequest$get__response$i$1() { + return this.responseText; + }, + set__response$i$1: function $h_EwsRequest$set__response$i$1(value) { + this.responseText=value; + return value; + }, + send: function $h_EwsRequest$send(data) { + this._checkSendConditions$i$1(); + if ($h.ScriptHelpers.isNullOrUndefined(data)) { + this._throwInvalidStateException$i$1(); + } + this._sendRequest$i$0(5, 'EwsRequest', { body: data }); + }, + _callOnReadyStateChangeCallback$i$1: function $h_EwsRequest$_callOnReadyStateChangeCallback$i$1() { + if (!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) { + this.onreadystatechange(); + } + }, + _parseExtraResponseData$i$1: function $h_EwsRequest$_parseExtraResponseData$i$1(response) { + } +} +$h.InitialData=function $h_InitialData(data) { + this._data$p$0=data; +} +$h.InitialData._defineReadOnlyProperty$i=function $h_InitialData$_defineReadOnlyProperty$i(o, methodName, getter) { + var propertyDescriptor={ get: getter, configurable: false }; + Object.defineProperty(o, methodName, propertyDescriptor); +} +$h.InitialData.prototype={ + _toRecipients$p$0: null, + _ccRecipients$p$0: null, + _attachments$p$0: null, + _resources$p$0: null, + _entities$p$0: null, + _data$p$0: null, + get__permissionLevel$i$0: function $h_InitialData$get__permissionLevel$i$0() { + var permissionLevel=this._data$p$0['permissionLevel']; + return (!$h.ScriptHelpers.isUndefined(permissionLevel)) ? permissionLevel : 0; + }, + get__itemId$i$0: function $h_InitialData$get__itemId$i$0() { + return this._data$p$0['id']; + }, + get__itemClass$i$0: function $h_InitialData$get__itemClass$i$0() { + return this._data$p$0['itemClass']; + }, + get__dateTimeCreated$i$0: function $h_InitialData$get__dateTimeCreated$i$0() { + return new Date(this._data$p$0['dateTimeCreated']); + }, + get__dateTimeModified$i$0: function $h_InitialData$get__dateTimeModified$i$0() { + return new Date(this._data$p$0['dateTimeModified']); + }, + get__dateTimeSent$i$0: function $h_InitialData$get__dateTimeSent$i$0() { + return new Date(this._data$p$0['dateTimeSent']); + }, + get__subject$i$0: function $h_InitialData$get__subject$i$0() { + return this._data$p$0['subject']; + }, + get__normalizedSubject$i$0: function $h_InitialData$get__normalizedSubject$i$0() { + return this._data$p$0['normalizedSubject']; + }, + get__internetMessageId$i$0: function $h_InitialData$get__internetMessageId$i$0() { + return this._data$p$0['internetMessageId']; + }, + get__conversationId$i$0: function $h_InitialData$get__conversationId$i$0() { + return this._data$p$0['conversationId']; + }, + get__sender$i$0: function $h_InitialData$get__sender$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + var sender=this._data$p$0['sender']; + return ($h.ScriptHelpers.isNullOrUndefined(sender)) ? null : new $h.EmailAddressDetails(sender); + }, + get__from$i$0: function $h_InitialData$get__from$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + var from=this._data$p$0['from']; + return ($h.ScriptHelpers.isNullOrUndefined(from)) ? null : new $h.EmailAddressDetails(from); + }, + get__to$i$0: function $h_InitialData$get__to$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._toRecipients$p$0) { + this._toRecipients$p$0=this._createEmailAddressDetails$p$0('to'); + } + return this._toRecipients$p$0; + }, + get__cc$i$0: function $h_InitialData$get__cc$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._ccRecipients$p$0) { + this._ccRecipients$p$0=this._createEmailAddressDetails$p$0('cc'); + } + return this._ccRecipients$p$0; + }, + get__attachments$i$0: function $h_InitialData$get__attachments$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._attachments$p$0) { + this._attachments$p$0=this._createAttachmentDetails$p$0(); + } + return this._attachments$p$0; + }, + get__ewsUrl$i$0: function $h_InitialData$get__ewsUrl$i$0() { + return this._data$p$0['ewsUrl']; + }, + get__start$i$0: function $h_InitialData$get__start$i$0() { + return new Date(this._data$p$0['start']); + }, + get__end$i$0: function $h_InitialData$get__end$i$0() { + return new Date(this._data$p$0['end']); + }, + get__location$i$0: function $h_InitialData$get__location$i$0() { + return this._data$p$0['location']; + }, + get__resources$i$0: function $h_InitialData$get__resources$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + if (null===this._resources$p$0) { + this._resources$p$0=this._createEmailAddressDetails$p$0('resources'); + } + return this._resources$p$0; + }, + get__organizer$i$0: function $h_InitialData$get__organizer$i$0() { + this._throwOnRestrictedPermissionLevel$p$0(); + var organizer=this._data$p$0['organizer']; + return ($h.ScriptHelpers.isNullOrUndefined(organizer)) ? null : new $h.EmailAddressDetails(organizer); + }, + get__userDisplayName$i$0: function $h_InitialData$get__userDisplayName$i$0() { + return this._data$p$0['userDisplayName']; + }, + get__userEmailAddress$i$0: function $h_InitialData$get__userEmailAddress$i$0() { + return this._data$p$0['userEmailAddress']; + }, + get__userTimeZone$i$0: function $h_InitialData$get__userTimeZone$i$0() { + return this._data$p$0['userTimeZone']; + }, + get__timeZoneOffsets$i$0: function $h_InitialData$get__timeZoneOffsets$i$0() { + return this._data$p$0['timeZoneOffsets']; + }, + get__hostVersion$i$0: function $h_InitialData$get__hostVersion$i$0() { + return this._data$p$0['hostVersion']; + }, + get__owaView$i$0: function $h_InitialData$get__owaView$i$0() { + return this._data$p$0['owaView']; + }, + _getEntities$i$0: function $h_InitialData$_getEntities$i$0() { + if (!this._entities$p$0) { + this._entities$p$0=new $h.Entities(this._data$p$0['entities'], this._data$p$0['filteredEntities'], this.get__dateTimeSent$i$0(), this.get__permissionLevel$i$0()); + } + return this._entities$p$0; + }, + _getEntitiesByType$i$0: function $h_InitialData$_getEntitiesByType$i$0(entityType) { + var entites=this._getEntities$i$0(); + return entites._getByType$i$0(entityType); + }, + _getFilteredEntitiesByName$i$0: function $h_InitialData$_getFilteredEntitiesByName$i$0(name) { + var entities=this._getEntities$i$0(); + return entities._getFilteredEntitiesByName$i$0(name); + }, + _getRegExMatches$i$0: function $h_InitialData$_getRegExMatches$i$0() { + if (!this._data$p$0['regExMatches']) { + return null; + } + return this._data$p$0['regExMatches']; + }, + _getRegExMatchesByName$i$0: function $h_InitialData$_getRegExMatchesByName$i$0(regexName) { + var regexMatches=this._getRegExMatches$i$0(); + if (!regexMatches || !regexMatches[regexName]) { + return null; + } + return regexMatches[regexName]; + }, + _createEmailAddressDetails$p$0: function $h_InitialData$_createEmailAddressDetails$p$0(key) { + var to=this._data$p$0[key]; + if ($h.ScriptHelpers.isNullOrUndefined(to)) { + return []; + } + var recipients=[]; + for (var i=0; i < to.length; i++) { + if (!$h.ScriptHelpers.isNullOrUndefined(to[i])) { + recipients[i]=new $h.EmailAddressDetails(to[i]); + } + } + return recipients; + }, + _createAttachmentDetails$p$0: function $h_InitialData$_createAttachmentDetails$p$0() { + var attachments=this._data$p$0['attachments']; + if ($h.ScriptHelpers.isNullOrUndefined(attachments)) { + return []; + } + var attachmentDetails=[]; + for (var i=0; i < attachments.length; i++) { + if (!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) { + attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]); + } + } + return attachmentDetails; + }, + _throwOnRestrictedPermissionLevel$p$0: function $h_InitialData$_throwOnRestrictedPermissionLevel$p$0() { + OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this.get__permissionLevel$i$0()); + } +} +$h._loadDictionaryRequest=function $h__loadDictionaryRequest(createResultObject, dictionaryName, callback, userContext) { + $h._loadDictionaryRequest.initializeBase(this, [ userContext ]); + this._createResultObject$p$1=createResultObject; + this._dictionaryName$p$1=dictionaryName; + this._callback$p$1=callback; +} +$h._loadDictionaryRequest.prototype={ + _dictionaryName$p$1: null, + _createResultObject$p$1: null, + _callback$p$1: null, + handleResponse: function $h__loadDictionaryRequest$handleResponse(response) { + if (response['wasSuccessful']) { + var value=response[this._dictionaryName$p$1]; + var responseData=JSON.parse(value); + this.createAsyncResult(this._createResultObject$p$1(responseData), 0, null); + } + else { + this.createAsyncResult(null, 1, response['errorMessage']); + } + this._callback$p$1(this._asyncResult$p$0); + } +} +$h.ProxyRequestBase=function $h_ProxyRequestBase(userContext) { + $h.ProxyRequestBase.initializeBase(this, [ userContext ]); +} +$h.ProxyRequestBase.prototype={ + handleResponse: function $h_ProxyRequestBase$handleResponse(response) { + if (!(response['wasProxySuccessful'])) { + this.set__statusCode$i$1(500); + this.set__statusDescription$i$1('Error'); + var errorMessage=response['errorMessage']; + this.set__response$i$1(errorMessage); + this.createAsyncResult(null, 1, errorMessage); + } + else { + this.set__statusCode$i$1(response['statusCode']); + this.set__statusDescription$i$1(response['statusDescription']); + this.set__response$i$1(response['body']); + this.createAsyncResult(this.get__response$i$1(), 0, null); + } + this._parseExtraResponseData$i$1(response); + this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1(); + }, + _throwInvalidStateException$i$1: function $h_ProxyRequestBase$_throwInvalidStateException$i$1() { + throw Error.create('DOMException', { code: 11, message: 'INVALID_STATE_ERR' }); + }, + _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function $h_ProxyRequestBase$_cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() { + var $$t_0=this; + this._changeReadyState$i$1(2, function() { + $$t_0._changeReadyState$i$1(3, function() { + $$t_0._changeReadyState$i$1(4, null); + }); + }); + }, + _changeReadyState$i$1: function $h_ProxyRequestBase$_changeReadyState$i$1(state, nextStep) { + this.set__requestState$i$1(state); + var $$t_2=this; + window.setTimeout(function() { + try { + $$t_2._callOnReadyStateChangeCallback$i$1(); + } + finally { + if (!$h.ScriptHelpers.isNullOrUndefined(nextStep)) { + nextStep(); + } + } + }, 0); + }, + _checkSendConditions$i$1: function $h_ProxyRequestBase$_checkSendConditions$i$1() { + if (this.get__requestState$i$1() !==1) { + this._throwInvalidStateException$i$1(); + } + if (this._isSent$p$0) { + this._throwInvalidStateException$i$1(); + } + } +} +$h.RequestBase=function $h_RequestBase(userContext) { + this._userContext$p$0=userContext; +} +$h.RequestBase.prototype={ + _isSent$p$0: false, + _asyncResult$p$0: null, + _userContext$p$0: null, + _sendRequest$i$0: function $h_RequestBase$_sendRequest$i$0(dispid, methodName, dataToSend) { + this._isSent$p$0=true; + var $$t_5=this; + OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid, methodName, dataToSend, function(resultCode, response) { + if (resultCode) { + $$t_5.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode)); + } + else { + $$t_5.handleResponse(response); + } + }); + }, + createAsyncResult: function $h_RequestBase$createAsyncResult(value, errorCode, errorDescription) { + this._asyncResult$p$0=OSF.DDA.OutlookAppOm._createAsyncResult$i(value, errorCode, errorDescription, this._userContext$p$0); + } +} +$h._saveDictionaryRequest=function $h__saveDictionaryRequest(callback, userContext) { + $h._saveDictionaryRequest.initializeBase(this, [ userContext ]); + if (!$h.ScriptHelpers.isNullOrUndefined(callback)) { + this._callback$p$1=callback; + } +} +$h._saveDictionaryRequest.prototype={ + _callback$p$1: null, + handleResponse: function $h__saveDictionaryRequest$handleResponse(response) { + if (response['wasSuccessful']) { + this.createAsyncResult(null, 0, null); + } + else { + this.createAsyncResult(null, 1, response['errorMessage']); + } + if (!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) { + this._callback$p$1(this._asyncResult$p$0); + } + } +} +$h.ScriptHelpers=function $h_ScriptHelpers() { +} +$h.ScriptHelpers.isNull=function $h_ScriptHelpers$isNull(value) { + return null===value; +} +$h.ScriptHelpers.isNullOrUndefined=function $h_ScriptHelpers$isNullOrUndefined(value) { + return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value); +} +$h.ScriptHelpers.isUndefined=function $h_ScriptHelpers$isUndefined(value) { + return value===undefined; +} +$h.ScriptHelpers.dictionaryContainsKey=function $h_ScriptHelpers$dictionaryContainsKey(obj, keyName) { + return (Object.isInstanceOfType(obj)) ? keyName in obj : false; +} +OSF.DDA.OutlookAppOm.registerClass('OSF.DDA.OutlookAppOm'); +OSF.DDA.Settings.registerClass('OSF.DDA.Settings'); +$h.Item.registerClass('$h.Item'); +$h.Appointment.registerClass('$h.Appointment', $h.Item); +$h.AttachmentDetails.registerClass('$h.AttachmentDetails'); +$h.Contact.registerClass('$h.Contact'); +$h.CustomProperties.registerClass('$h.CustomProperties'); +$h.Diagnostics.registerClass('$h.Diagnostics'); +$h.EmailAddressDetails.registerClass('$h.EmailAddressDetails'); +$h.Entities.registerClass('$h.Entities'); +$h.Message.registerClass('$h.Message', $h.Item); +$h.MeetingRequest.registerClass('$h.MeetingRequest', $h.Message); +$h.MeetingSuggestion.registerClass('$h.MeetingSuggestion'); +$h.MeetingSuggestionTimeDecoder.registerClass('$h.MeetingSuggestionTimeDecoder'); +$h._extractedDate.registerClass('$h._extractedDate'); +$h._preciseDate.registerClass('$h._preciseDate', $h._extractedDate); +$h._relativeDate.registerClass('$h._relativeDate', $h._extractedDate); +$h.PhoneNumber.registerClass('$h.PhoneNumber'); +$h.TaskSuggestion.registerClass('$h.TaskSuggestion'); +$h.UserProfile.registerClass('$h.UserProfile'); +$h.RequestBase.registerClass('$h.RequestBase'); +$h.ProxyRequestBase.registerClass('$h.ProxyRequestBase', $h.RequestBase); +$h.EwsRequest.registerClass('$h.EwsRequest', $h.ProxyRequestBase); +$h.InitialData.registerClass('$h.InitialData'); +$h._loadDictionaryRequest.registerClass('$h._loadDictionaryRequest', $h.RequestBase); +$h._saveDictionaryRequest.registerClass('$h._saveDictionaryRequest', $h.RequestBase); +$h.ScriptHelpers.registerClass('$h.ScriptHelpers'); +OSF.DDA.OutlookAppOm._maxRecipients$p=100; +OSF.DDA.OutlookAppOm._maxSubjectLength$p=255; +OSF.DDA.OutlookAppOm._maxBodyLength$p=32768; +OSF.DDA.OutlookAppOm._maxLocationLength$p=255; +OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1000000; +OSF.DDA.OutlookAppOm._instance$p=null; +$h.AttachmentDetails._attachmentTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File, Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item ]; +$h.Diagnostics.outlookAppName='Outlook'; +$h.Diagnostics.outlookWebAppName='OutlookWebApp'; +$h.EmailAddressDetails._emptyString$p=''; +$h.EmailAddressDetails._responseTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined ]; +$h.EmailAddressDetails._recipientTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser ]; +$h.Entities._allEntityKeys$p=[ 'Addresses', 'EmailAddresses', 'Urls', 'PhoneNumbers', 'TaskSuggestions', 'MeetingSuggestions', 'Contacts' ]; +$h.MeetingSuggestionTimeDecoder._baseDate$p=new Date('0001-01-01T00:00:00Z'); +$h.ScriptHelpers.emptyString=''; + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.js new file mode 100644 index 000000000..176f6540c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/outlookwebapp-15.js @@ -0,0 +1,21 @@ +/* Outlook web application specific API library */ +/* Version: 15.0.4420.1017 Build Time: 03/31/2014 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item"} + +Type.registerNamespace("OSF.DDA");OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d_$1w_0=Function.createDelegate(this,this.$1w_0);this.$$d_$2Z_0=Function.createDelegate(this,this.$2Z_0);this.$$d_$2X_0=Function.createDelegate(this,this.$2X_0);this.$$d_$31_0=Function.createDelegate(this,this.$31_0);this.$$d_$2h_0=Function.createDelegate(this,this.$2h_0);this.$$d_$2e_0=Function.createDelegate(this,this.$2e_0);OSF.DDA.OutlookAppOm.$4=this;this.$L_0=n;this.$18_0=i;var u=this;var r=function(){i&&u.$7_0(1,"GetInitialData",null,u.$$d_$2e_0)};this.$19_0()?r():this.$36_0(r)};OSF.DDA.OutlookAppOm.$9=function(n,t,i,r){var f={};f[OSF.DDA.AsyncResultEnum.Properties.Value]=n;f[OSF.DDA.AsyncResultEnum.Properties.Context]=r;var u=null;if(0!==t){u={};u[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=t;u[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=i}return new OSF.DDA.AsyncResult(f,u)};OSF.DDA.OutlookAppOm.$D=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};OSF.DDA.OutlookAppOm.$C=function(n,t,i){if(ni)throw Error.argumentOutOfRange(r);};OSF.DDA.OutlookAppOm.$17=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm.$H(n,String,r);var u=n;OSF.DDA.OutlookAppOm.$T(u.length,t,i,r)}};OSF.DDA.OutlookAppOm.$21=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:break;case 4:var r=JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm.$e(t.requiredAttendees),OSF.DDA.OutlookAppOm.$e(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm.$e(t.resources),t.subject,t.body];break;case 11:case 10:i=[t.htmlBody];break;default:break}return i};OSF.DDA.OutlookAppOm.$e=function(n){return n?n.join(";"):null};OSF.DDA.OutlookAppOm.$1t=function(n,t){if($h.ScriptHelpers.isNullOrUndefined(n))return null;OSF.DDA.OutlookAppOm.$H(n,Array,t);var r=n;var u=null;var f=!1;OSF.DDA.OutlookAppOm.$T(r.length,0,OSF.DDA.OutlookAppOm.$1i,String.format("{0}.length",t));for(var e=0;eOSF.DDA.OutlookAppOm.$1g)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);OSF.DDA.OutlookAppOm.$C(this.$3_0.get_$8_0(),2,"makeEwsRequestAsync");var r=new $h.EwsRequest(i);var u=this;r.onreadystatechange=function(){4===r.get_$1l_1()&&t(r.$P_0)};r.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$7_0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$7_0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$7_0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this.$3_0&&this.$3_0.get_$13_0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this.$1P_0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this.$g_0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this.$2D_0(n);if(this.$3_0&&this.$3_0.get_$13_0()){var i=this.$1P_0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},getUserIdentityTokenAsync:function(n,t){OSF.DDA.OutlookAppOm.$C(this.$3_0.get_$8_0(),1,"getUserIdentityTokenAsync");this.$1c_0(2,"GetUserIdentityToken",n,t)},getCallbackTokenAsync:function(n,t){OSF.DDA.OutlookAppOm.$C(this.$3_0.get_$8_0(),1,"getCallbackTokenAsync");if(64!==this.$L_0.get_appName())throw Error.notImplemented("The getCallbackTokenAsync is not supported by outlook for now.");this.$1c_0(12,"GetCallbackToken",n,t)},displayMessageForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this.$7_0(8,"DisplayExistingMessageForm",{itemId:n},null)},displayAppointmentForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this.$7_0(9,"DisplayExistingAppointmentForm",{itemId:n},null)},displayNewAppointmentForm:function(n){var u=OSF.DDA.OutlookAppOm.$1t(n.requiredAttendees,"requiredAttendees");var r=OSF.DDA.OutlookAppOm.$1t(n.optionalAttendees,"optionalAttendees");OSF.DDA.OutlookAppOm.$17(n.location,0,OSF.DDA.OutlookAppOm.$1h,"location");OSF.DDA.OutlookAppOm.$17(n.body,0,OSF.DDA.OutlookAppOm.$S,"body");OSF.DDA.OutlookAppOm.$17(n.subject,0,OSF.DDA.OutlookAppOm.$1j,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){OSF.DDA.OutlookAppOm.$H(n.start,Date,"start");var o=n.start;n.start=o.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){OSF.DDA.OutlookAppOm.$H(n.end,Date,"end");var i=n.end;if(i=0&&n.getTime()-u<0)return parseInt(t.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},$19_0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},$36_0:function(n){for(var s=null,l="",a=document.getElementsByTagName("script"),o=a.length-1;o>=0;o--){var i=null;var v=a[o].attributes;if(v){var p=v.getNamedItem("src");p&&(i=p.value);if(i){var y=!1;i=i.toLowerCase();var f=i.indexOf("office_strings.js");if(f<0){f=i.indexOf("office_strings.debug.js");y=!0}if(f>0&&fu+1&&(l=r.substring(0,u+1));break}}}}if(s){var h=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var c=this;var w=function(){if(!c.$19_0()){var n=l+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=c.$1G_0(n);t.onload=e;t.onreadystatechange=e;h.appendChild(t)}};t=this.$1G_0(s);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);h.appendChild(t)}},$1G_0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};OSF.DDA.Settings=function(n){this.$u_0=n};OSF.DDA.Settings.$20=function(n){if(!n)return{};if(OSF.DDA.OutlookAppOm.$4.get_$O_0()===8){var t=n.SettingsKey;if(t)return OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={$u_0:null,$10_0:null,get_$J_0:function(){if(!this.$10_0){this.$10_0=OSF.DDA.Settings.$20(this.$u_0);this.$u_0=null}return this.$10_0},get:function(n){return this.get_$J_0()[n]},set:function(n,t){this.get_$J_0()[n]=t},remove:function(n){delete this.get_$J_0()[n]},saveAsync:function(){for(var n=[],i=0;i0){var t=n.length-1;if(Function.isInstanceOfType(n[t])){r=n[t];t--;t>=0&&(u=n[t].asyncContext)}}OSF.DDA.OutlookAppOm.$4.get_$O_0()===64?this.$3E_0(r,u):this.$3D_0(r,u)},$3D_0:function(n,t){var r=null;try{var f=OSF.DDA.SettingsManager.serializeSettings(this.get_$J_0());var e=JSON.stringify(f);var u={SettingsKey:e};OSF.DDA.RichClientSettingsManager.write(u)}catch(o){r=o}if(n){var i;i=r?OSF.DDA.OutlookAppOm.$9(null,1,r.message,t):OSF.DDA.OutlookAppOm.$9(null,0,null,t);n(i)}},$3E_0:function(n,t){var i=OSF.DDA.SettingsManager.serializeSettings(this.get_$J_0());var r=this;OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(i,r){if(n){var u;if(i)u=OSF.DDA.OutlookAppOm.$9(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,i),t);else{var f=r;u=f.error?OSF.DDA.OutlookAppOm.$9(null,1,f.errorMessage,t):OSF.DDA.OutlookAppOm.$9(null,0,null,t)}n(u)}},[i])}};Type.registerNamespace("$h");$h.Appointment=function(n){this.$$d_$2m_1=Function.createDelegate(this,this.$2m_1);this.$$d_$1W_1=Function.createDelegate(this,this.$1W_1);this.$$d_$q_1=Function.createDelegate(this,this.$q_1);this.$$d_$2t_1=Function.createDelegate(this,this.$2t_1);this.$$d_$1Z_1=Function.createDelegate(this,this.$1Z_1);this.$$d_$1X_1=Function.createDelegate(this,this.$1X_1);this.$$d_$n_1=Function.createDelegate(this,this.$n_1);this.$$d_$1T_1=Function.createDelegate(this,this.$1T_1);this.$$d_$1a_1=Function.createDelegate(this,this.$1a_1);$h.Appointment.initializeBase(this,[n]);$h.InitialData.$1(this,"start",this.$$d_$1a_1);$h.InitialData.$1(this,"end",this.$$d_$1T_1);$h.InitialData.$1(this,"location",this.$$d_$n_1);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1X_1);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_1);$h.InitialData.$1(this,"resources",this.$$d_$2t_1);$h.InitialData.$1(this,"subject",this.$$d_$q_1);$h.InitialData.$1(this,"normalizedSubject",this.$$d_$1W_1);$h.InitialData.$1(this,"organizer",this.$$d_$2m_1)};$h.Appointment.prototype={getEntities:function(){return this.$0_0.$Q_0()},getEntitiesByType:function(n){return this.$0_0.$1U_0(n)},getRegExMatches:function(){OSF.DDA.OutlookAppOm.$C(this.$0_0.get_$8_0(),1,"getRegExMatches");return this.$0_0.$p_0()},getFilteredEntitiesByName:function(n){return this.$0_0.$m_0(n)},getRegExMatchesByName:function(n){OSF.DDA.OutlookAppOm.$C(this.$0_0.get_$8_0(),1,"getRegExMatchesByName");return this.$0_0.$1Y_0(n)},displayReplyForm:function(n){OSF.DDA.OutlookAppOm.$4.$1M_0(n)},displayReplyAllForm:function(n){OSF.DDA.OutlookAppOm.$4.$1L_0(n)},getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},$1a_1:function(){return this.$0_0.get_$1m_0()},$1T_1:function(){return this.$0_0.get_$1N_0()},$n_1:function(){return this.$0_0.get_$1f_0()},$1X_1:function(){return this.$0_0.get_$a_0()},$1Z_1:function(){return this.$0_0.get_$14_0()},$2t_1:function(){return this.$0_0.get_$3C_0()},$q_1:function(){return this.$0_0.get_$1p_0()},$1W_1:function(){return this.$0_0.get_$1k_0()},$2m_1:function(){return this.$0_0.get_$37_0()}};$h.AttachmentDetails=function(n){this.$$d_$2g_0=Function.createDelegate(this,this.$2g_0);this.$$d_$2N_0=Function.createDelegate(this,this.$2N_0);this.$$d_$2v_0=Function.createDelegate(this,this.$2v_0);this.$$d_$2T_0=Function.createDelegate(this,this.$2T_0);this.$$d_$2l_0=Function.createDelegate(this,this.$2l_0);this.$$d_$2d_0=Function.createDelegate(this,this.$2d_0);this.$0_0=n;$h.InitialData.$1(this,"id",this.$$d_$2d_0);$h.InitialData.$1(this,"name",this.$$d_$2l_0);$h.InitialData.$1(this,"contentType",this.$$d_$2T_0);$h.InitialData.$1(this,"size",this.$$d_$2v_0);$h.InitialData.$1(this,"attachmentType",this.$$d_$2N_0);$h.InitialData.$1(this,"isInline",this.$$d_$2g_0)};$h.AttachmentDetails.prototype={$0_0:null,$2d_0:function(){return this.$0_0.id},$2l_0:function(){return this.$0_0.name},$2T_0:function(){return this.$0_0.contentType},$2v_0:function(){return this.$0_0.size},$2N_0:function(){var n=this.$0_0.attachmentType;return n<$h.AttachmentDetails.$Y.length?$h.AttachmentDetails.$Y[n]:Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File},$2g_0:function(){return this.$0_0.isInline}};$h.Contact=function(n){this.$$d_$2S_0=Function.createDelegate(this,this.$2S_0);this.$$d_$k_0=Function.createDelegate(this,this.$k_0);this.$$d_$r_0=Function.createDelegate(this,this.$r_0);this.$$d_$l_0=Function.createDelegate(this,this.$l_0);this.$$d_$o_0=Function.createDelegate(this,this.$o_0);this.$$d_$2P_0=Function.createDelegate(this,this.$2P_0);this.$$d_$2p_0=Function.createDelegate(this,this.$2p_0);this.$0_0=n;$h.InitialData.$1(this,"personName",this.$$d_$2p_0);$h.InitialData.$1(this,"businessName",this.$$d_$2P_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$o_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$l_0);$h.InitialData.$1(this,"urls",this.$$d_$r_0);$h.InitialData.$1(this,"addresses",this.$$d_$k_0);$h.InitialData.$1(this,"contactString",this.$$d_$2S_0)};$h.Contact.prototype={$0_0:null,$G_0:null,$2p_0:function(){return this.$0_0.PersonName},$2P_0:function(){return this.$0_0.BusinessName},$k_0:function(){return $h.Entities.$A(this.$0_0,"Addresses")},$l_0:function(){return $h.Entities.$A(this.$0_0,"EmailAddresses")},$r_0:function(){return $h.Entities.$A(this.$0_0,"Urls")},$o_0:function(){if(!this.$G_0){var n=this;this.$G_0=$h.Entities.$3K($h.PhoneNumber,this.$0_0,"PhoneNumbers",function(n){return new $h.PhoneNumber(n)})}return this.$G_0},$2S_0:function(){return this.$0_0.ContactString}};$h.CustomProperties=function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.$0_0=n};$h.CustomProperties.prototype={$0_0:null,get:function(n){var i=this.$0_0[n];if(typeof i=="string"){var t=i;if(t.length>6&&t.startsWith("Date(")&&t.endsWith(")")){var f=t.substring(5,t.length-1);var r=parseInt(f);if(!isNaN(r)){var u=new Date(r);u&&(i=u)}}}return i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")");this.$0_0[n]=t},remove:function(n){delete this.$0_0[n]},saveAsync:function(n,t){var r=2500;if(JSON.stringify(this.$0_0).length>r)throw Error.argument();var i=new $h.SaveDictionaryRequest(n,t);i.$z_0(4,"SaveCustomProperties",{customProperties:this.$0_0})}};$h.Diagnostics=function(n,t){this.$$d_$2o_0=Function.createDelegate(this,this.$2o_0);this.$$d_$2c_0=Function.createDelegate(this,this.$2c_0);this.$$d_$2b_0=Function.createDelegate(this,this.$2b_0);this.$0_0=n;this.$N_0=t;$h.InitialData.$1(this,"hostName",this.$$d_$2b_0);$h.InitialData.$1(this,"hostVersion",this.$$d_$2c_0);64===this.$N_0&&$h.InitialData.$1(this,"OWAView",this.$$d_$2o_0)};$h.Diagnostics.prototype={$0_0:null,$N_0:0,$2b_0:function(){if(8===this.$N_0)return"Outlook";else if(64===this.$N_0)return"OutlookWebApp";return null},$2c_0:function(){return this.$0_0.get_$32_0()},$2o_0:function(){return this.$0_0.get_$38_0()}};$h.EmailAddressDetails=function(n){this.$$d_$2s_0=Function.createDelegate(this,this.$2s_0);this.$$d_$2K_0=Function.createDelegate(this,this.$2K_0);this.$$d_$1R_0=Function.createDelegate(this,this.$1R_0);this.$$d_$1S_0=Function.createDelegate(this,this.$1S_0);this.$0_0=n;$h.InitialData.$1(this,"emailAddress",this.$$d_$1S_0);$h.InitialData.$1(this,"displayName",this.$$d_$1R_0);$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData.$1(this,"appointmentResponse",this.$$d_$2K_0);$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData.$1(this,"recipientType",this.$$d_$2s_0)};$h.EmailAddressDetails.$1D=function(n){var t={};var r=n.Name;var i=n.UserId;t.name=r||$h.EmailAddressDetails.$i;t.address=i||$h.EmailAddressDetails.$i;return new $h.EmailAddressDetails(t)};$h.EmailAddressDetails.prototype={$0_0:null,$1S_0:function(){return this.$0_0.address},$1R_0:function(){return this.$0_0.name},$2K_0:function(){var n=this.$0_0.appointmentResponse;return n<$h.EmailAddressDetails.$y.length?$h.EmailAddressDetails.$y[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},$2s_0:function(){var n=this.$0_0.recipientType;return n<$h.EmailAddressDetails.$v.length?$h.EmailAddressDetails.$v[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}};$h.Entities=function(n,t,i,r){this.$$d_$24_0=Function.createDelegate(this,this.$24_0);this.$$d_$1Q_0=Function.createDelegate(this,this.$1Q_0);this.$$d_$o_0=Function.createDelegate(this,this.$o_0);this.$$d_$r_0=Function.createDelegate(this,this.$r_0);this.$$d_$l_0=Function.createDelegate(this,this.$l_0);this.$$d_$1V_0=Function.createDelegate(this,this.$1V_0);this.$$d_$1b_0=Function.createDelegate(this,this.$1b_0);this.$$d_$k_0=Function.createDelegate(this,this.$k_0);this.$0_0=n||{};this.$1O_0=t||{};this.$K_0=i;$h.InitialData.$1(this,"addresses",this.$$d_$k_0);$h.InitialData.$1(this,"taskSuggestions",this.$$d_$1b_0);$h.InitialData.$1(this,"meetingSuggestions",this.$$d_$1V_0);$h.InitialData.$1(this,"emailAddresses",this.$$d_$l_0);$h.InitialData.$1(this,"urls",this.$$d_$r_0);$h.InitialData.$1(this,"phoneNumbers",this.$$d_$o_0);$h.InitialData.$1(this,"contacts",this.$$d_$1Q_0);this.$M_0=r};$h.Entities.$3K=function(n,t,i,r,u,f){var s=null;var e=t[i];if(!e)return new Array(0);u&&(e=$h.Entities.$3L(Object,e,$h.Entities.$2E,f));s=new Array(e.length);for(var l=0,h=e,a=h.length,o=0;o=0;u--){for(var e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t};$h.Entities.prototype={$K_0:null,$0_0:null,$1O_0:null,$6_0:null,$M_0:0,$11_0:null,$s_0:null,$G_0:null,$d_0:null,$U_0:null,$h_0:null,$16_0:null,$2Q_0:function(n){if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)return this.$1V_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)return this.$1b_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)return this.$k_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)return this.$o_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)return this.$l_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)return this.$r_0();else if(n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)return this.$1Q_0();return null},$m_0:function(n){this.$6_0||(this.$6_0={});if(!$h.ScriptHelpers.dictionaryContainsKey(this.$6_0,n)){for(var r=!1,i=0;i<$h.Entities.$V.length;i++){var u=$h.Entities.$V[i];var t=this.$1O_0[u];if(t&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this.$6_0[n]=$h.Entities.$A(t,n);break;case"Addresses":this.$6_0[n]=$h.Entities.$A(t,n,!0);break;case"PhoneNumbers":this.$6_0[n]=$h.Entities.$3K($h.PhoneNumber,t,n,$h.Entities.$1E,!1,null);break;case"TaskSuggestions":this.$6_0[n]=$h.Entities.$3K($h.TaskSuggestion,t,n,$h.Entities.$1H,!0,"TaskString");break;case"MeetingSuggestions":this.$6_0[n]=$h.Entities.$3K($h.MeetingSuggestion,t,n,this.$$d_$24_0,!0,"MeetingString");break;case"Contacts":this.$6_0[n]=$h.Entities.$3K($h.Contact,t,n,$h.Entities.$1B,!0,"ContactString");break}r=!0;break}}r||(this.$6_0[n]=null)}return this.$6_0[n]},$24_0:function(n){return new $h.MeetingSuggestion(n,this.$K_0)},$k_0:function(){this.$U_0||(this.$U_0=$h.Entities.$A(this.$0_0,"Addresses",!0));return this.$U_0},$l_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$h_0||(this.$h_0=$h.Entities.$A(this.$0_0,"EmailAddresses",!1));return this.$h_0},$r_0:function(){this.$16_0||(this.$16_0=$h.Entities.$A(this.$0_0,"Urls",!1));return this.$16_0},$o_0:function(){this.$G_0||(this.$G_0=$h.Entities.$3K($h.PhoneNumber,this.$0_0,"PhoneNumbers",$h.Entities.$1E));return this.$G_0},$1b_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$11_0||(this.$11_0=$h.Entities.$3K($h.TaskSuggestion,this.$0_0,"TaskSuggestions",$h.Entities.$1H,!0,"TaskString"));return this.$11_0},$1V_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$s_0||(this.$s_0=$h.Entities.$3K($h.MeetingSuggestion,this.$0_0,"MeetingSuggestions",this.$$d_$24_0,!0,"MeetingString"));return this.$s_0},$1Q_0:function(){OSF.DDA.OutlookAppOm.$D(this.$M_0);this.$d_0||(this.$d_0=$h.Entities.$3K($h.Contact,this.$0_0,"Contacts",$h.Entities.$1B,!0,"ContactString"));return this.$d_0}};$h.Item=function(n){this.$$d_$23_0=Function.createDelegate(this,this.$23_0);this.$$d_$2M_0=Function.createDelegate(this,this.$2M_0);this.$$d_$2i_0=Function.createDelegate(this,this.$2i_0);this.$$d_$2j_0=Function.createDelegate(this,this.$2j_0);this.$$d_$2W_0=Function.createDelegate(this,this.$2W_0);this.$$d_$2V_0=Function.createDelegate(this,this.$2V_0);this.$0_0=n;$h.InitialData.$1(this,"dateTimeCreated",this.$$d_$2V_0);$h.InitialData.$1(this,"dateTimeModified",this.$$d_$2W_0);$h.InitialData.$1(this,"itemId",this.$$d_$2j_0);var t=this;$h.InitialData.$1(this,"itemType",function(){return t.getItemType()});$h.InitialData.$1(this,"itemClass",this.$$d_$2i_0);OSF.DDA.OutlookAppOm.$4.get_$O_0()===64&&$h.InitialData.$1(this,"attachments",this.$$d_$2M_0)};$h.Item.prototype={$0_0:null,loadCustomPropertiesAsync:function(n,t){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("callback");var i=new $h.LoadDictionaryRequest(this.$$d_$23_0,"customProperties",n,t);i.$z_0(3,"LoadCustomProperties",{})},$23_0:function(n){return new $h.CustomProperties(n)},$2j_0:function(){return this.$0_0.get_$35_0()},$2i_0:function(){return this.$0_0.get_$34_0()},$2V_0:function(){return this.$0_0.get_$26_0()},$2W_0:function(){return this.$0_0.get_$27_0()},$2M_0:function(){return this.$0_0.get_$1v_0()}};$h.MeetingRequest=function(n){this.$$d_$1Z_2=Function.createDelegate(this,this.$1Z_2);this.$$d_$1X_2=Function.createDelegate(this,this.$1X_2);this.$$d_$n_2=Function.createDelegate(this,this.$n_2);this.$$d_$1T_2=Function.createDelegate(this,this.$1T_2);this.$$d_$1a_2=Function.createDelegate(this,this.$1a_2);$h.MeetingRequest.initializeBase(this,[n]);$h.InitialData.$1(this,"start",this.$$d_$1a_2);$h.InitialData.$1(this,"end",this.$$d_$1T_2);$h.InitialData.$1(this,"location",this.$$d_$n_2);$h.InitialData.$1(this,"optionalAttendees",this.$$d_$1X_2);$h.InitialData.$1(this,"requiredAttendees",this.$$d_$1Z_2)};$h.MeetingRequest.prototype={$1a_2:function(){return this.$0_0.get_$1m_0()},$1T_2:function(){return this.$0_0.get_$1N_0()},$n_2:function(){return this.$0_0.get_$1f_0()},$1X_2:function(){return this.$0_0.get_$a_0()},$1Z_2:function(){return this.$0_0.get_$14_0()}};$h.MeetingSuggestion=function(n,t){this.$$d_$2Y_0=Function.createDelegate(this,this.$2Y_0);this.$$d_$2w_0=Function.createDelegate(this,this.$2w_0);this.$$d_$q_0=Function.createDelegate(this,this.$q_0);this.$$d_$n_0=Function.createDelegate(this,this.$n_0);this.$$d_$2O_0=Function.createDelegate(this,this.$2O_0);this.$$d_$2k_0=Function.createDelegate(this,this.$2k_0);this.$0_0=n;this.$K_0=t;$h.InitialData.$1(this,"meetingString",this.$$d_$2k_0);$h.InitialData.$1(this,"attendees",this.$$d_$2O_0);$h.InitialData.$1(this,"location",this.$$d_$n_0);$h.InitialData.$1(this,"subject",this.$$d_$q_0);$h.InitialData.$1(this,"start",this.$$d_$2w_0);$h.InitialData.$1(this,"end",this.$$d_$2Y_0)};$h.MeetingSuggestion.prototype={$K_0:null,$0_0:null,$Z_0:null,$2k_0:function(){return this.$0_0.MeetingString},$n_0:function(){return this.$0_0.Location},$q_0:function(){return this.$0_0.Subject},$2w_0:function(){var n=this.$1C_0("StartTime");var t=$h.MeetingSuggestionTimeDecoder.resolve(n,this.$K_0);return t.getTime()!==n.getTime()?OSF.DDA.OutlookAppOm.$4.convertToUtcClientTime(OSF.DDA.OutlookAppOm.$4.$g_0(t)):n},$2Y_0:function(){var n=this.$1C_0("EndTime");var t=$h.MeetingSuggestionTimeDecoder.resolve(n,this.$K_0);return t.getTime()!==n.getTime()?OSF.DDA.OutlookAppOm.$4.convertToUtcClientTime(OSF.DDA.OutlookAppOm.$4.$g_0(t)):n},$1C_0:function(n){var t=this.$0_0[n];return t?new Date(t):null},$2O_0:function(){if(!this.$Z_0){var n=this;this.$Z_0=$h.Entities.$3K($h.EmailAddressDetails,this.$0_0,"Attendees",function(n){return $h.EmailAddressDetails.$1D(n)})}return this.$Z_0}};$h.MeetingSuggestionTimeDecoder=function(){};$h.MeetingSuggestionTimeDecoder.resolve=function(n,t){if(!t)return n;try{var f;var i;var r;var u=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0);var s,o,e;if(e=$h.MeetingSuggestionTimeDecoder.$2A(n,s={val:r},o={val:f}),r=s.val,f=o.val,e){i=$h.PreciseDate.isInstanceOfType(r)?$h.MeetingSuggestionTimeDecoder.$3A(u,r):$h.RelativeDate.isInstanceOfType(r)?$h.MeetingSuggestionTimeDecoder.$3B(u,r):u;if(isNaN(i.getTime()))return t;i.setMilliseconds(i.getMilliseconds()+f);return i}else return n}catch(h){return t}};$h.MeetingSuggestionTimeDecoder.$1d=function(n){return null===n||n===undefined};$h.MeetingSuggestionTimeDecoder.$3A=function(n,t){var r=t.$1u_1;var f=t.$t_1?t.$t_1-1:n.getMonth();var u=t.$1I_1;if(!u)return n;var i;if($h.MeetingSuggestionTimeDecoder.$1d(r)){i=new Date(n.getFullYear(),f,u);i.getTime()0)return new Date(n.getFullYear()+t.$5_1,0,1);break;default:break}return n};$h.MeetingSuggestionTimeDecoder.$2G=function(n,t,i){if(t>-5&&t<5){var u;var f;u=(i+6)%7+1;f=7*t+(u-n.getDay());n.setDate(n.getDate()+f);return n}else{var r=(i-n.getDay())%7;r<0&&(r+=7);n.setDate(n.getDate()+r);return n}};$h.MeetingSuggestionTimeDecoder.$2H=function(n,t){var f;var i;var r;f=n;if(t.$B_1<=0||t.$B_1>12||t.$5_1<=0||t.$5_1>5)return n;var e=(12+t.$B_1-f.getMonth()-1)%12;i=new Date(f.getFullYear(),f.getMonth()+e,1);if(t.$F_1===1)if(t.$5_1===1&&i.getDay()!==6&&i.getDay()!==0)return i;else{r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()+(8-i.getDay())%7);i.getDay()!==6&&i.getDay()!==0&&i.getDay()!==1&&r.setDate(r.getDate()-7);r.setDate(r.getDate()+7*(t.$5_1-1));return r.getMonth()+1!==t.$B_1?n:r}else{r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder.$29(i.getMonth(),i.getFullYear()));var u=1-r.getDay();u>0&&(u=u-7);r.setDate(r.getDate()+u);r.setDate(r.getDate()+7*(1-t.$5_1));return r.getMonth()+1!==t.$B_1?i.getDay()!==6&&i.getDay()!==0?i:n:r}};$h.MeetingSuggestionTimeDecoder.$2A=function(n,t,i){var f=32767;t.val=null;i.val=0;if(!n)return!1;i.val=$h.MeetingSuggestionTimeDecoder.$2y(n);var e=n.getTime()-i.val;var r=(e-$h.MeetingSuggestionTimeDecoder.$1A.getTime())/864e5;if(r<0)return!1;else if(r>=262144)return!1;else{var u=r>>15;r=r&f;switch(u){case 0:return $h.MeetingSuggestionTimeDecoder.$2B(r,t);case 1:return $h.MeetingSuggestionTimeDecoder.$2C(r,t);default:return!1}}};$h.MeetingSuggestionTimeDecoder.$2B=function(n,t){var h=7;var e=15;var o=31;var s=127;var u=null;var r=0;var f=0;t.val=null;var i=n>>12&h;if((i&4)==4){u=n>>5&s;if((i&2)==2){if((i&1)==1)return!1;r=n>>1&e}}else{(i&2)==2&&(r=n>>8&e);(i&1)==1&&(f=n>>3&o)}t.val=new $h.PreciseDate(f,r,u);return!0};$h.MeetingSuggestionTimeDecoder.$2C=function(n,t){var o=15;var e=63;var h=7;var s=3;var r=n&o;n>>=4;var i=$h.MeetingSuggestionTimeDecoder.$2J(n&e,6);n>>=6;var f=n&h;n>>=3;var u=n&s;try{t.val=new $h.RelativeDate(u,i,f,r);return!0}catch(c){t.val=null;return!1}};$h.MeetingSuggestionTimeDecoder.$2J=function(n,t){var i=1< 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode, + Microsoft.Office.Internal.Parameters.OfficeTheme, + Microsoft.Office.Internal.Parameters.DocumentTheme + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; + this.dynamicTypes=dynamicTypes; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.FilePropertiesDescriptor; + define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: ns.Url, value: 0 } + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: 0} + ] + }) + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 }, + { name: ns.SlideRange, value:7 } + ] + }); + ns=Microsoft.Office.WebExtension.GoToType; + define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: ns.Binding, value: 0 }, + { name: ns.NamedItem, value: 1 }, + { name: ns.Slide, value: 2 }, + { name: ns.Index, value: 3 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 }, + { name: ns.Pdf, value: 6 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.Internal.OfficeTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.OfficeTheme, + fromHost: [ + {name: ns.PrimaryFontColor, value: 0}, + {name: ns.PrimaryBackgroundColor, value: 1}, + {name: ns.SecondaryFontColor, value:2}, + {name: ns.SecondaryBackgroundColor, value:3} + ] + }) + } + ns=Microsoft.Office.WebExtension.ActiveView; + if (ns) { + define({ + type:Microsoft.Office.WebExtension.Parameters.ActiveView, + fromHost: [ + {name: 0, value: ns.Read}, + {name: 1, value: ns.Edit} + ] + }) + } + ns=Microsoft.Office.Internal.DocumentTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.DocumentTheme, + fromHost: [ + {name: ns.PrimaryBackgroundColor, value: 0}, + {name: ns.PrimaryFontColor, value: 1}, + {name: ns.SecondaryBackgroundColor, value: 2}, + {name: ns.SecondaryFontColor, value: 3}, + {name: ns.Accent1, value: 4}, + {name: ns.Accent2, value: 5}, + {name: ns.Accent3, value: 6}, + {name: ns.Accent4, value: 7}, + {name: ns.Accent5, value: 8}, + {name: ns.Accent6, value: 9}, + {name: ns.Hyperlink, value: 10}, + {name: ns.FollowedHyperlink, value: 11}, + {name: ns.HeaderLatinFont, value: 12}, + {name: ns.HeaderEastAsianFont, value: 13}, + {name: ns.HeaderScriptFont, value: 14}, + {name: ns.HeaderLocalizedFont, value: 15}, + {name: ns.BodyLatinFont, value: 16}, + {name: ns.BodyEastAsianFont, value: 17}, + {name: ns.BodyScriptFont, value: 18}, + {name: ns.BodyLocalizedFont, value: 19} + ] + }) + } + ns=Microsoft.Office.WebExtension.SelectionMode; + define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: ns.Default, value: 0 }, + { name: ns.Selected, value: 1 }, + { name: ns.None, value: 2 }, + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidNavigateToMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.GoToType, value: 1 }, + { name: ns.SelectionMode, value: 2 } + ] + }); + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidClearFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidSetTableOptionsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.TableOptions, value: 1 }, + ] + }); + define({ + type: cns.dispidSetFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CellFormat, value: 1 }, + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: self } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDocumentThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidOfficeThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidActiveViewChangedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + parameterMap.define=define; + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.PowerPointDocument=function OSF_DDA_PowerPointDocument(officeAppContext, settings) { + OSF.DDA.PowerPointDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + OSF.DDA.AsyncMethodNames.GoToByIdAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged, + Microsoft.Office.WebExtension.EventType.ActiveViewChanged + ])); + OSF.OUtil.finalizeProperties(this); +}; +OSF.DDA.PowerPointDocumentInternal=function OSF_DDA_PowerPointDocumentInternal() { + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.OfficeThemeChanged, + Microsoft.Office.WebExtension.EventType.DocumentThemeChanged + ])); + OSF.OUtil.finalizeProperties(this); +}; +Microsoft.Office.WebExtension.Index={ + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.Slide=function OSF_DDA_Slide(input) { + var mapList={ + "id": { + value: parseInt(input[0]) + }, + "title": { + value: input[1] + }, + "index": { + value: parseInt(input[2]) + } + }; + var numField=0; + for(var key in mapList) { + if(mapList.hasOwnProperty(key)) { + numField++; + } + } + if(input.length !=numField) { + throw OsfMsAjaxFactory.msAjaxError.argument("slide"); + } + OSF.OUtil.defineEnumerableProperties(this, mapList); + if(isNaN(this.id) || isNaN(this.index)) { + throw OsfMsAjaxFactory.msAjaxError.argument("slide"); + } +}; +OSF.DDA.SlideRange=function OSF_DDA_SlideRange(input) { + var items=input.split("\n"); + var dataValid=true; + var slides=[]; + for(var i=0; i < items.length && dataValid; i++) { + var curSlide=OSF.OUtil.splitStringToList(items[i], ','); + try { + slides.push(new OSF.DDA.Slide(curSlide)); + } + catch (e) { + dataValid=false; + } + } + if(!dataValid) { + throw OsfMsAjaxFactory.msAjaxError.argument("sliderange"); + } + OSF.OUtil.defineEnumerableProperties(this, { + "slides": { + value: slides + } + }); +}; +OSF.OUtil.extend(OSF.DDA.PowerPointDocument, OSF.DDA.Document); +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + var license=new OSF.DDA.License(appContext.get_eToken()); + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license)); + var getDelegateMethods, parameterMap; + var reason=appContext.get_reason(); + getDelegateMethods=OSF.DDA.DispIdHost.getRichClientDelegateMethods; + parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap; + reason=OSF.DDA.RichInitializationReason[reason]; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); + var getOfficeThemesCss=function GetOfficeThemesCss() { + var cssFileName="officethemes.css" + for (var i=0; i < document.styleSheets.length; i++) { + var ss=document.styleSheets[i]; + if (!ss.disabled && ss.href + && (cssFileName==(ss.href.substring(ss.href.length - cssFileName.length, ss.href.length)).toLowerCase())){ + if ((!ss.cssRules) && (!ss.rules)) { + return null + } + else { + return ss; + } + } + } + } + var onComplete=function onComplete(reason) { + OSF.OUtil.redefineList(Microsoft.Office.WebExtension.EventType, { + DocumentSelectionChanged: "documentSelectionChanged", + ActiveViewChanged: "activeViewChanged" + }); + Microsoft.Office.WebExtension.initialize(reason); + } + var officeCss=getOfficeThemesCss(); + if (officeCss){ + var changeCss=function ChangeCss(officeCss, selector, newRule) { + var length=officeCss.cssRules ? officeCss.cssRules.length : officeCss.rules.length; + for (var i=0; i < length; i++) { + var rule; + if (officeCss.cssRules) { + rule=officeCss.cssRules[i]; + } + else { + rule=officeCss.rules[i]; + } + var ruleSelector=rule.selectorText; + if ( ruleSelector !=="" && (ruleSelector.toLowerCase()==selector.toLowerCase()) ) { + if (officeCss.cssRules) { + officeCss.deleteRule(i); + officeCss.insertRule(ruleSelector+newRule, i); + } + else { + officeCss.removeRule(i); + officeCss.addRule(ruleSelector, newRule, i); + } + } + } + } + var previousDocumentThemeData=null; + var changeDocumentThemeData=function ChangeDocumentThemeData(data) { + var documentThemeCssMapping=[ + { name: "primaryFontColor", cssSelector: ".office-docTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-docTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-docTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-docTheme-secondary-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-color", cssProperty: "color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-color", cssProperty: "color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-color", cssProperty: "color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-color", cssProperty: "color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-color", cssProperty: "color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-color", cssProperty: "color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-bgColor", cssProperty: "background-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-bgColor", cssProperty: "background-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-bgColor", cssProperty: "background-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-bgColor", cssProperty: "background-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-bgColor", cssProperty: "background-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-borderColor", cssProperty: "border-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-borderColor", cssProperty: "border-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-borderColor", cssProperty: "border-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-borderColor", cssProperty: "border-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-borderColor", cssProperty: "border-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-borderColor", cssProperty: "border-color" }, + { name: "hyperlink", cssSelector: ".office-a", cssProperty: "color" }, + { name: "followedHyperlink", cssSelector: ".office-a:visited", cssProperty: "color" }, + { name: "headerLatinFont", cssSelector: ".office-headerFont-latin", cssProperty: "font-family" }, + { name: "headerEastAsianFont", cssSelector: ".office-headerFont-eastAsian", cssProperty: "font-family" }, + { name: "headerScriptFont", cssSelector: ".office-headerFont-script", cssProperty: "font-family" }, + { name: "headerLocalizedFont", cssSelector: ".office-headerFont-localized", cssProperty: "font-family" }, + { name: "bodyLatinFont", cssSelector: ".office-bodyFont-latin", cssProperty: "font-family" }, + { name: "bodyEastAsianFont", cssSelector: ".office-bodyFont-eastAsian", cssProperty: "font-family" }, + { name: "bodyScriptFont", cssSelector: ".office-bodyFont-script", cssProperty: "font-family" }, + { name: "bodyLocalizedFont", cssSelector: ".office-bodyFont-localized", cssProperty: "font-family" } + ]; + var realData=data.type=="documentThemeChanged" ? data.documentTheme : data; + for (var i=0; i< documentThemeCssMapping.length; i++) + { + if (previousDocumentThemeData===null || previousDocumentThemeData[documentThemeCssMapping[i].name] !=realData[documentThemeCssMapping[i].name]) + { + if (realData[documentThemeCssMapping[i].name] !=null && realData[documentThemeCssMapping[i].name] !="") + { + var insertableText=realData[documentThemeCssMapping[i].name]; + if (documentThemeCssMapping[i].cssProperty==="font-family") { + insertableText='"'+insertableText.replace(/"/g, '\\"')+'"'; + } + changeCss(officeCss, documentThemeCssMapping[i].cssSelector, "{"+documentThemeCssMapping[i].cssProperty+":"+insertableText+";}"); + } + else + { + changeCss(officeCss, documentThemeCssMapping[i].cssSelector, "{}"); + } + } + } + previousDocumentThemeData=realData; + } + var previousOfficeThemeData=null; + var internal=new OSF.DDA.PowerPointDocumentInternal(); + var changeOfficeThemeData=function ChangeOfficeThemeData(data) { + var officeThemeCssMapping=[ + { name: "primaryFontColor", cssSelector: ".office-officeTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-officeTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-officeTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-officeTheme-secondary-bgColor", cssProperty: "background-color" } + ]; + var realData=data.type=="officeThemeChanged" ? data.officeTheme : data; + for (var i=0; i0&&b.push(c)}}}catch(i){}return b}var d=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.EventDescriptors.DocumentThemeChangedEvent,OSF.DDA.EventDescriptors.OfficeThemeChangedEvent,OSF.DDA.EventDescriptors.ActiveViewChangedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode,Microsoft.Office.Internal.Parameters.OfficeTheme,Microsoft.Office.Internal.Parameters.DocumentTheme],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var b=0,a=1;return {toHost:function(c){if(typeof c!="string"&&c[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[b]=c[OSF.DDA.TableDataProperties.TableRows];d[a]=c[OSF.DDA.TableDataProperties.TableHeaders];c=d}return c},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=c(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=c(d[b]);e[OSF.DDA.TableDataProperties.TableHeaders]=c(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(b,d,a);b.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};b.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b};b.dynamicTypes=a};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var f=true,e=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=e.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.PowerPointDocument=function OSF_DDA_PowerPointDocument(officeAppContext, settings) { + OSF.DDA.PowerPointDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.PowerPointDocument, OSF.DDA.Document); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-15.js new file mode 100644 index 000000000..943b6acdd --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-15.js @@ -0,0 +1,11 @@ +/* PowerPoint specific API library */ +/* Version: 15.0.4420.1017 Build Time: 03/31/2014 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.RichClientSettingsManager={read:function(e,d){var b=[],f=[];e&&e();window.external.GetContext().GetSettings().Read(b,f);d&&d();for(var c={},a=0;a0&&b.push(c)}}}catch(i){}return b}var c=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,a=1;return {toHost:function(b){if(typeof b!="string"&&b[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=b[OSF.DDA.TableDataProperties.TableRows];d[a]=b[OSF.DDA.TableDataProperties.TableHeaders];b=d}return b},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=b(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=b(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=b(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,a);this.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};this.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var e=true,f=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=f.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + + +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response = { + Status: 0, + Payload: 1 +}; + +OSF.DDA.SafeArray.UniqueArguments = { + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException = function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number = ex.number; + if (number) { + switch (number) { + case -2146828218: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor = function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows = vbArr.ubound(1); + var cols = vbArr.ubound(2); + vbArr = vbArr.toArray(); + if (rows == 1 && cols == 1) { + ret = [vbArr]; + } else { + ret = []; + for (var row = 0; row < rows; row++) { + var rowArr = []; + for (var col = 0; col < cols; col++) { + var datum = vbArr[row * cols + col]; + if (datum != OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes = []; + var dynamicTypes = {}; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = (function () { + var tableRows = 0; + var tableHeaders = 1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data != "string" && data[OSF.DDA.TableDataProperties.TableRows] !== undefined) { + var tableData = []; + tableData[tableRows] = data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders] = data[OSF.DDA.TableDataProperties.TableHeaders]; + data = tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs.toArray) { + var dimensions = hostArgs.dimensions(); + if (dimensions === 2) { + ret = _2DVBArrayToJaggedArray(hostArgs); + } else { + var array = hostArgs.toArray(); + if (array.length === 2 && ((array[0] != null && array[0].toArray) || (array[1] != null && array[1].toArray))) { + ret = {}; + ret[OSF.DDA.TableDataProperties.TableRows] = _2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders] = _2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret = array; + } + } + } else { + ret = hostArgs; + } + return ret; + } + }; + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + + this.unpack = function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + var toArraySupported = (arg || typeof arg === "unknown") && arg.toArray; + value = toArraySupported ? arg.toArray() : arg || {}; + } else if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; + +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); + +OSF.DDA.SafeArray.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [ + { + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 }, + { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 } + ] + }, + { + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 } + ] + } +]); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 }, + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 } + ] +}); +OSF.DDA.SafeArray.Delegate.executeAsync = function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + function toArray(args) { + var arrArgs = args; + if (OSF.OUtil.isArray(args)) { + var len = arrArgs.length; + for (var i = 0; i < len; i++) { + arrArgs[i] = toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs = args.getVarDate(); + } else if (typeof args === "object" && !OSF.OUtil.isArray(args)) { + arrArgs = []; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index] = toArray(args[index]); + } + } + } + return arrArgs; + } + function fromSafeArray(value) { + var ret = value; + if (value != null && value.toArray) { + var arrayResult = value.toArray(); + for (var i = 0; i < arrayResult.length; i++) { + arrayResult[i] = fromSafeArray(arrayResult[i]); + } + ret = arrayResult; + } + return ret; + } + try { + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + var result = hostResponseArgs.toArray(); + var status = result[OSF.DDA.SafeArray.Response.Status]; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) { + var payload = result[OSF.DDA.SafeArray.Response.Payload]; + payload = fromSafeArray(payload); + if (payload != null) { + if (!args._chunkResultData) { + args._chunkResultData = new Array(); + } + + args._chunkResultData[payload[0]] = payload[1]; + } + } else { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload = []; + for (var i = 1; i < result.length; i++) + payload[i - 1] = result[i]; + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + if (args._chunkResultData) { + payload = fromSafeArray(payload); + if (payload != null) { + var expectedChunkCount = payload[payload.length - 1]; + if (args._chunkResultData.length == expectedChunkCount) { + payload[payload.length - 1] = args._chunkResultData; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + } + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + }); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent = function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status = hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync = function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync = function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; + +OSF.ClientMode = { + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason = { + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = this.initializeSettings; +}; +OSF.InitializationHelper.prototype.deserializeSettings = function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) { + var settings; + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = (typeof (JSON) !== "undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = (typeof (JSON) !== "undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface = function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + var license = new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler = (OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler)); + var getDelegateMethods, parameterMap; + getDelegateMethods = OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); +}; +OSF.InitializationHelper.prototype.getInitializationReason = function (appContext) { + return OSF.DDA.RichInitializationReason[appContext.get_reason()]; +}; + +OSF.DDA.DispIdHost.getClientDelegateMethods = function (actionId) { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + + if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId == OSF.DDA.AsyncMethodNames.RefreshAsync.id) { + var readSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings); + } + if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId == OSF.DDA.AsyncMethodNames.SaveAsync.id) { + var writeSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings); + } + return delegateMethods; +}; + +var OSF = OSF || {}; +var OSFWebkit; +(function (OSFWebkit) { + var WebkitSafeArray = (function () { + function WebkitSafeArray(data) { + this.data = data; + this.safeArrayFlag = this.isSafeArray(data); + } + WebkitSafeArray.prototype.dimensions = function () { + var dimensions = 0; + if (this.safeArrayFlag) { + dimensions = this.data[0][0]; + } else if (this.isArray()) { + dimensions = 2; + } + return dimensions; + }; + WebkitSafeArray.prototype.getItem = function () { + var array = []; + var element = null; + if (this.safeArrayFlag) { + array = this.toArray(); + } else { + array = this.data; + } + + element = array; + for (var i = 0; i < arguments.length; i++) { + element = element[arguments[i]]; + } + return element; + }; + WebkitSafeArray.prototype.lbound = function (dimension) { + return 0; + }; + WebkitSafeArray.prototype.ubound = function (dimension) { + var ubound = 0; + if (this.safeArrayFlag) { + ubound = this.data[0][dimension]; + } else if (this.isArray()) { + if (dimension == 1) { + return this.data.length; + } else if (dimension == 2) { + if (OSF.OUtil.isArray(this.data[0])) { + return this.data[0].length; + } else if (this.data[0] != null) { + return 1; + } + } + } + return ubound; + }; + WebkitSafeArray.prototype.toArray = function () { + if (this.isArray() == false) { + return this.data; + } + + var arr = []; + var startingIndex = this.safeArrayFlag ? 1 : 0; + for (var i = startingIndex; i < this.data.length; i++) { + var element = this.data[i]; + if (this.isSafeArray(element)) { + arr.push(new WebkitSafeArray(element)); + } else { + arr.push(element); + } + } + return arr; + }; + WebkitSafeArray.prototype.isArray = function () { + return OSF.OUtil.isArray(this.data); + }; + WebkitSafeArray.prototype.isSafeArray = function (obj) { + var isSafeArray = false; + if (OSF.OUtil.isArray(obj) && OSF.OUtil.isArray(obj[0])) { + var bounds = obj[0]; + var dimensions = bounds[0]; + if (bounds.length != dimensions + 1) { + return false; + } + var expectedArraySize = 1; + for (var i = 1; i < bounds.length; i++) { + var dimension = bounds[i]; + if (isFinite(dimension) == false) { + return false; + } + expectedArraySize = expectedArraySize * dimension; + } + + expectedArraySize++; + isSafeArray = (expectedArraySize == obj.length); + } + return isSafeArray; + }; + return WebkitSafeArray; + })(); + OSFWebkit.WebkitSafeArray = WebkitSafeArray; +})(OSFWebkit || (OSFWebkit = {})); +var OSFWebkit; +(function (OSFWebkit) { + (function (ScriptMessaging) { + var scriptMessenger = null; + + function agaveHostCallback(callbackId, params) { + scriptMessenger.agaveHostCallback(callbackId, params); + } + ScriptMessaging.agaveHostCallback = agaveHostCallback; + + function agaveHostEventCallback(callbackId, params) { + scriptMessenger.agaveHostEventCallback(callbackId, params); + } + ScriptMessaging.agaveHostEventCallback = agaveHostEventCallback; + function GetScriptMessenger() { + if (scriptMessenger == null) { + scriptMessenger = new WebkitScriptMessaging("OSF.ScriptMessaging.agaveHostCallback", "OSF.ScriptMessaging.agaveHostEventCallback"); + } + return scriptMessenger; + } + ScriptMessaging.GetScriptMessenger = GetScriptMessenger; + var EventHandlerCallback = (function () { + function EventHandlerCallback(id, targetId, handler) { + this.id = id; + this.targetId = targetId; + this.handler = handler; + } + return EventHandlerCallback; + })(); + var WebkitScriptMessaging = (function () { + function WebkitScriptMessaging(methodCallbackName, eventCallbackName) { + this.callingIndex = 0; + this.callbackList = {}; + this.eventHandlerList = {}; + this.asyncMethodCallbackFunctionName = methodCallbackName; + this.eventCallbackFunctionName = eventCallbackName; + + this.conversationId = WebkitScriptMessaging.getCurrentTimeMS().toString(); + } + WebkitScriptMessaging.prototype.invokeMethod = function (handlerName, methodId, params, callback) { + var messagingArgs = {}; + this.postWebkitMessage(messagingArgs, handlerName, methodId, params, callback); + }; + + WebkitScriptMessaging.prototype.registerEvent = function (handlerName, methodId, dispId, targetId, handler, callback) { + var messagingArgs = { + eventCallbackFunction: this.eventCallbackFunctionName + }; + var hostArgs = { + id: dispId, + targetId: targetId + }; + var correlationId = this.postWebkitMessage(messagingArgs, handlerName, methodId, hostArgs, callback); + + this.eventHandlerList[correlationId] = new EventHandlerCallback(dispId, targetId, handler); + }; + + WebkitScriptMessaging.prototype.unregisterEvent = function (handlerName, methodId, dispId, targetId, callback) { + var hostArgs = { + id: dispId, + targetId: targetId + }; + + for (var key in this.eventHandlerList) { + if (this.eventHandlerList.hasOwnProperty(key)) { + var eventCallback = this.eventHandlerList[key]; + if (eventCallback.id == dispId && eventCallback.targetId == targetId) { + delete this.eventHandlerList[key]; + } + } + } + this.invokeMethod(handlerName, methodId, hostArgs, callback); + }; + + WebkitScriptMessaging.prototype.agaveHostCallback = function (callbackId, params) { + var callbackFunction = this.callbackList[callbackId]; + if (callbackFunction) { + callbackFunction(params); + + delete this.callbackList[callbackId]; + } + }; + + WebkitScriptMessaging.prototype.agaveHostEventCallback = function (callbackId, params) { + var eventCallback = this.eventHandlerList[callbackId]; + if (eventCallback) { + eventCallback.handler(params); + } + }; + + WebkitScriptMessaging.prototype.postWebkitMessage = function (messagingArgs, handlerName, methodId, params, callback) { + var correlationId = this.generateCorrelationId(); + this.callbackList[correlationId] = callback; + messagingArgs.methodId = methodId; + messagingArgs.params = params; + messagingArgs.callbackId = correlationId; + messagingArgs.callbackFunction = this.asyncMethodCallbackFunctionName; + var invokePostMessage = function () { + window.webkit.messageHandlers[handlerName].postMessage(JSON.stringify(messagingArgs)); + }; + + var currentTimestamp = WebkitScriptMessaging.getCurrentTimeMS(); + if (this.lastMessageTimestamp == null || (currentTimestamp - this.lastMessageTimestamp >= WebkitScriptMessaging.MESSAGE_TIME_DELTA)) { + invokePostMessage(); + this.lastMessageTimestamp = currentTimestamp; + } else { + this.lastMessageTimestamp += WebkitScriptMessaging.MESSAGE_TIME_DELTA; + setTimeout(function () { + invokePostMessage(); + }, this.lastMessageTimestamp - currentTimestamp); + } + return correlationId; + }; + + WebkitScriptMessaging.prototype.generateCorrelationId = function () { + ++this.callingIndex; + return this.conversationId + this.callingIndex; + }; + + WebkitScriptMessaging.getCurrentTimeMS = function () { + return (new Date).getTime(); + }; + WebkitScriptMessaging.MESSAGE_TIME_DELTA = 10; + return WebkitScriptMessaging; + })(); + ScriptMessaging.WebkitScriptMessaging = WebkitScriptMessaging; + })(OSFWebkit.ScriptMessaging || (OSFWebkit.ScriptMessaging = {})); + var ScriptMessaging = OSFWebkit.ScriptMessaging; +})(OSFWebkit || (OSFWebkit = {})); +OSF.ScriptMessaging = OSFWebkit.ScriptMessaging; + +var OSFWebkit; +(function (OSFWebkit) { + OSFWebkit.MessageHandlerName = "Agave"; + (function (AppContextProperties) { + AppContextProperties[AppContextProperties["Settings"] = 0] = "Settings"; + AppContextProperties[AppContextProperties["SolutionReferenceId"] = 1] = "SolutionReferenceId"; + AppContextProperties[AppContextProperties["AppType"] = 2] = "AppType"; + AppContextProperties[AppContextProperties["MajorVersion"] = 3] = "MajorVersion"; + AppContextProperties[AppContextProperties["MinorVersion"] = 4] = "MinorVersion"; + AppContextProperties[AppContextProperties["RevisionVersion"] = 5] = "RevisionVersion"; + AppContextProperties[AppContextProperties["APIVersionSequence"] = 6] = "APIVersionSequence"; + AppContextProperties[AppContextProperties["AppCapabilities"] = 7] = "AppCapabilities"; + AppContextProperties[AppContextProperties["APPUILocale"] = 8] = "APPUILocale"; + AppContextProperties[AppContextProperties["AppDataLocale"] = 9] = "AppDataLocale"; + AppContextProperties[AppContextProperties["BindingCount"] = 10] = "BindingCount"; + AppContextProperties[AppContextProperties["DocumentUrl"] = 11] = "DocumentUrl"; + AppContextProperties[AppContextProperties["ActivationMode"] = 12] = "ActivationMode"; + AppContextProperties[AppContextProperties["ControlIntegrationLevel"] = 13] = "ControlIntegrationLevel"; + AppContextProperties[AppContextProperties["SolutionToken"] = 14] = "SolutionToken"; + AppContextProperties[AppContextProperties["APISetVersion"] = 15] = "APISetVersion"; + AppContextProperties[AppContextProperties["CorrelationId"] = 16] = "CorrelationId"; + AppContextProperties[AppContextProperties["InstanceId"] = 17] = "InstanceId"; + AppContextProperties[AppContextProperties["TouchEnabled"] = 18] = "TouchEnabled"; + AppContextProperties[AppContextProperties["CommerceAllowed"] = 19] = "CommerceAllowed"; + AppContextProperties[AppContextProperties["RequirementMatrix"] = 20] = "RequirementMatrix"; + })(OSFWebkit.AppContextProperties || (OSFWebkit.AppContextProperties = {})); + var AppContextProperties = OSFWebkit.AppContextProperties; + (function (MethodId) { + MethodId[MethodId["Execute"] = 1] = "Execute"; + MethodId[MethodId["RegisterEvent"] = 2] = "RegisterEvent"; + MethodId[MethodId["UnregisterEvent"] = 3] = "UnregisterEvent"; + MethodId[MethodId["WriteSettings"] = 4] = "WriteSettings"; + MethodId[MethodId["GetContext"] = 5] = "GetContext"; + })(OSFWebkit.MethodId || (OSFWebkit.MethodId = {})); + var MethodId = OSFWebkit.MethodId; + var WebkitHostController = (function () { + function WebkitHostController(hostScriptProxy) { + this.hostScriptProxy = hostScriptProxy; + } + WebkitHostController.prototype.execute = function (id, params, callback) { + var args = params; + if (args == null) { + args = []; + } + var hostParams = { + id: id, + apiArgs: args + }; + var agaveResponseCallback = function (payload) { + var safeArraySource = payload; + if (OSF.OUtil.isArray(payload) && payload.length >= 2) { + var hrStatus = payload[0]; + + safeArraySource = payload[1]; + } + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.Execute, hostParams, agaveResponseCallback); + }; + WebkitHostController.prototype.registerEvent = function (id, targetId, handler, callback) { + var agaveEventHandlerCallback = function (payload) { + var safeArraySource = payload; + var eventId = 0; + if (OSF.OUtil.isArray(payload) && payload.length >= 2) { + safeArraySource = payload[0]; + eventId = payload[1]; + } + if (handler) { + handler(eventId, new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + var agaveResponseCallback = function (payload) { + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(payload)); + } + }; + this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.RegisterEvent, id, targetId, agaveEventHandlerCallback, agaveResponseCallback); + }; + WebkitHostController.prototype.unregisterEvent = function (id, targetId, callback) { + var agaveResponseCallback = function (response) { + callback(new OSFWebkit.WebkitSafeArray(response)); + }; + this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.UnregisterEvent, id, targetId, agaveResponseCallback); + }; + return WebkitHostController; + })(); + OSFWebkit.WebkitHostController = WebkitHostController; +})(OSFWebkit || (OSFWebkit = {})); +OSF.Webkit = OSFWebkit; +OSF.ClientHostController = new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger()); +OSF.DDA.ClientSettingsManager = { + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + var onComplete = function onComplete(status, response) { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + try { + hostDelegateMethod(args.hostCallArgs, args.onCalling, onComplete); + } catch (ex) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response = { name: Strings.OfficeOM.L_InternalError, message: ex }; + onComplete(status, response); + } + }; + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onComplete) { + var keys = []; + var values = []; + if (onCalling) { + onCalling(); + } + + var initializationHelper = OSF._OfficeAppFactory.getInitializationHelper(); + var onReceivedContext = function onReceivedContext(appContext) { + if (onComplete) { + onComplete(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, appContext.get_settings()); + } + }; + initializationHelper.getAppContext(null, onReceivedContext); + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onComplete) { + var hostParams = {}; + var keys = []; + var values = []; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + hostParams["keys"] = keys; + hostParams["values"] = values; + if (onCalling) { + onCalling(); + } + var onWriteCompleted = function onWriteCompleted(status) { + if (onComplete) { + onComplete(status[0], null); + } + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.WriteSettings, hostParams, onWriteCompleted); + } +}; +OSF.InitializationHelper.prototype.initializeSettings = function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) { + var serializedSettings = appContext.get_settings(); + var settings = this.deserializeSettings(serializedSettings, refreshSupported); + return settings; +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var getInvocationCallback = function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(appContext) { + var returnedContext; + var appContextProperties = OSF.Webkit.AppContextProperties; + var appType = appContext[appContextProperties.AppType]; + var appTypeSupported = false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry] == appType) { + appTypeSupported = true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type " + appType; + } + var hostSettings = appContext[appContextProperties.Settings]; + var serializedSettings = {}; + var keys = hostSettings[0]; + var values = hostSettings[1]; + for (var index = 0; index < keys.length; index++) { + serializedSettings[keys[index]] = values[index]; + } + var id = appContext[appContextProperties.SolutionReferenceId]; + var version = appContext[appContextProperties.MajorVersion]; + var clientMode = appContext[appContextProperties.AppCapabilities]; + var UILocale = appContext[appContextProperties.APPUILocale]; + var dataLocale = appContext[appContextProperties.AppDataLocale]; + var docUrl = appContext[appContextProperties.DocumentUrl]; + var reason = appContext[appContextProperties.ActivationMode]; + var osfControlType = appContext[appContextProperties.ControlIntegrationLevel]; + var eToken = appContext[appContextProperties.SolutionToken]; + eToken = eToken ? eToken.toString() : ""; + var correlationId = appContext[appContextProperties.CorrelationId]; + var appInstanceId = appContext[appContextProperties.InstanceId]; + var touchEnabled = appContext[appContextProperties.TouchEnabled]; + var commerceAllowed = appContext[appContextProperties.CommerceAllowed]; + var minorVersion = appContext[appContextProperties.MinorVersion]; + var requirementMatrix = appContext[appContextProperties.RequirementMatrix]; + returnedContext = new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, serializedSettings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.GetContext, [], getInvocationCallback); +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.BindingType = { + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties = { + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise = function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id = bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t = typeof onError; + if (t != "undefined" && t != "function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback = onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype = { + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me = this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status == Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade = function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches = []; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding = function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding = function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et = Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches = docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id] = new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch = bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId = function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_" + OSF.OUtil.getUniqueId() + "_" + new Date().getTime(); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding = function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id = bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows = bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols = bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders = bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding = new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding = new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp = function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject = OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject = OSF.DDA.TableBinding; + } + binding = new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding = new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id = callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties = { + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding = function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); +OSF.DDA.FilePropertiesDescriptor = { + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties = function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); + +Microsoft.Office.WebExtension.GoToType = { + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode = { + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index = { + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); + +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType, { + Text: "text" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.ValueFormat, { + Unformatted: "unformatted" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.FilterType, { + All: "all" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.GoToType, { + Slide: "slide", + Index: "index" +}); +delete Microsoft.Office.WebExtension.BindingType; +delete Microsoft.Office.WebExtension.select; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { SlideRange: "slideRange" }); + +OSF.DDA.SlideProperties = { + Id: 0, + Title: 1, + Index: 2 +}; +OSF.DDA.Slide = function OSF_DDA_Slide(id, title, index) { + OSF.OUtil.defineEnumerableProperties(this, { + "id": { + value: id + }, + "title": { + value: title + }, + "index": { + value: index + } + }); +}; +OSF.DDA.SlideRange = function OSF_DDA_SlideRange(slides) { + OSF.OUtil.defineEnumerableProperties(this, { + "slides": { + value: slides + } + }); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureSlideRange = function OSF_DDA_OMFactory$manufactureSlideRange(input) { + var items = null; + if (JSON) { + items = JSON.parse(input); + } else { + items = Sys.Serialization.JavaScriptSerializer.deserialize(input); + } + if (items == null) { + return null; + } + var numField = 0; + for (var key in OSF.DDA.SlideProperties) { + if (OSF.DDA.SlideProperties.hasOwnProperty(key)) { + numField++; + } + } + var slides = []; + var dataValid = true; + for (var i = 0; i < items.length && dataValid; i++) { + dataValid = false; + if (items[i].length == numField) { + var id = parseInt(items[i][OSF.DDA.SlideProperties.Id]); + var title = items[i][OSF.DDA.SlideProperties.Title]; + var index = parseInt(items[i][OSF.DDA.SlideProperties.Index]); + if (!isNaN(id) && !isNaN(index)) { + dataValid = true; + slides.push(new OSF.DDA.Slide(id, title, index)); + } + } + } + if (!dataValid) { + return null; + } + return new OSF.DDA.SlideRange(slides); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.SlideRange, value: 7 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Html: "html" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Html, value: 3 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Ooxml: "ooxml" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Ooxml, value: 4 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { OoxmlPackage: "ooxmlPackage" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.OoxmlPackage, value: 5 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { PdfFile: "pdf" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.PdfFile, value: 6 } + ] +}); +Microsoft.Office.WebExtension.FileType = { + Text: "text", + Compressed: "compressed", + Pdf: "pdf" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FileProperties: "FileProperties", + FileSliceProperties: "FileSliceProperties" +}); +OSF.DDA.FileProperties = { + Handle: "FileHandle", + FileSize: "FileSize", + SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize +}; +OSF.DDA.File = function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState = {}; + privateState[OSF.DDA.FileProperties.Handle] = handle; + privateState[OSF.DDA.FileProperties.SliceSize] = sliceSize; + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], privateState); +}; + +OSF.DDA.FileSliceOffset = "fileSliceoffset"; +OSF.DDA.AsyncMethodNames.addNames({ + GetDocumentCopyAsync: "getFileAsync", + GetDocumentCopyChunkAsync: "getSliceAsync", + ReleaseDocumentCopyAsync: "closeAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.FileType, + "enum": Microsoft.Office.WebExtension.FileType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SliceSize, + value: { + "types": ["number"], + "defaultValue": 64 * 1024 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var sliceSize = callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]; + + if (sliceSize <= 0 || sliceSize > (4 * 1024 * 1024)) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize; + } + return callArgs; + }, + onSucceeded: function (fileDescriptor, caller, callArgs) { + return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]); + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.SliceIndex, + "types": ["number"] + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + }, + { + name: OSF.DDA.FileProperties.SliceSize, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.SliceSize]; + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var index = callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]; + + if (index < 0 || index >= caller.sliceCount) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange; + } + + callArgs[OSF.DDA.FileSliceOffset] = parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString()); + return callArgs; + }, + onSucceeded: function (sliceDescriptor, caller, callArgs) { + var slice = {}; + OSF.OUtil.defineEnumerableProperties(slice, { + "data": { + value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data] + }, + "index": { + value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex] + }, + "size": { + value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize] + } + }); + return slice; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync, + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileProperties.FileSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: Microsoft.Office.WebExtension.FileType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.FileType.Compressed, value: 5 }, + { name: Microsoft.Office.WebExtension.FileType.Pdf, value: 6 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod, + toHost: [{ name: Microsoft.Office.WebExtension.Parameters.FileType, value: 0 }], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0 }] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 } + ] +}); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); +OSF.DDA.AsyncMethodNames.addNames({ + GetOfficeThemeAsync: "getOfficeThemeAsync", + GetDocumentThemeAsync: "getDocumentThemeAsync" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + OfficeThemeChanged: "officeThemeChanged", + DocumentThemeChanged: "documentThemeChanged" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.Parameters, { + DocumentTheme: "documentTheme", + OfficeTheme: "officeTheme" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { + DocumentThemeChangedEvent: "DocumentThemeChangedEvent", + OfficeThemeChangedEvent: "OfficeThemeChangedEvent" +}); +OSF.OUtil.setNamespace("Theming", OSF.DDA); +OSF.DDA.Theming.OfficeThemeEnum = { + PrimaryFontColor: "primaryFontColor", + PrimaryBackgroundColor: "primaryBackgroundColor", + SecondaryFontColor: "secondaryFontColor", + SecondaryBackgroundColor: "secondaryBackgroundColor" +}; +OSF.DDA.Theming.DocumentThemeEnum = { + PrimaryFontColor: "primaryFontColor", + PrimaryBackgroundColor: "primaryBackgroundColor", + SecondaryFontColor: "secondaryFontColor", + SecondaryBackgroundColor: "secondaryBackgroundColor", + Accent1: "accent1", + Accent2: "accent2", + Accent3: "accent3", + Accent4: "accent4", + Accent5: "accent5", + Accent6: "accent6", + Hyperlink: "hyperlink", + FollowedHyperlink: "followedHyperlink", + HeaderLatinFont: "headerLatinFont", + HeaderEastAsianFont: "headerEastAsianFont", + HeaderScriptFont: "headerScriptFont", + HeaderLocalizedFont: "headerLocalizedFont", + BodyLatinFont: "bodyLatinFont", + BodyEastAsianFont: "bodyEastAsianFont", + BodyScriptFont: "bodyScriptFont", + BodyLocalizedFont: "bodyLocalizedFont" +}; +OSF.DDA.Theming.ConvertToDocumentTheme = function OSF_DDA_Theming_ConvertToDocumentTheme(response) { + var mappingDocumentTheme = [ + { name: "primaryFontColor", needToConvertToHex: true }, + { name: "primaryBackgroundColor", needToConvertToHex: true }, + { name: "secondaryFontColor", needToConvertToHex: true }, + { name: "secondaryBackgroundColor", needToConvertToHex: true }, + { name: "accent1", needToConvertToHex: true }, + { name: "accent2", needToConvertToHex: true }, + { name: "accent3", needToConvertToHex: true }, + { name: "accent4", needToConvertToHex: true }, + { name: "accent5", needToConvertToHex: true }, + { name: "accent6", needToConvertToHex: true }, + { name: "hyperlink", needToConvertToHex: true }, + { name: "followedHyperlink", needToConvertToHex: true }, + { name: "headerLatinFont", needToConvertToHex: false }, + { name: "headerEastAsianFont", needToConvertToHex: false }, + { name: "headerScriptFont", needToConvertToHex: false }, + { name: "headerLocalizedFont", needToConvertToHex: false }, + { name: "bodyLatinFont", needToConvertToHex: false }, + { name: "bodyEastAsianFont", needToConvertToHex: false }, + { name: "bodyScriptFont", needToConvertToHex: false }, + { name: "bodyLocalizedFont", needToConvertToHex: false } + ]; + var result = {}; + for (var i = 0; i < mappingDocumentTheme.length; i++) { + if (mappingDocumentTheme[i].needToConvertToHex) { + result[mappingDocumentTheme[i].name] = OSF.OUtil.convertIntToCssHexColor(response[mappingDocumentTheme[i].name]); + } else { + result[mappingDocumentTheme[i].name] = response[mappingDocumentTheme[i].name]; + } + } + return result; +}; +OSF.DDA.Theming.ConvertToOfficeTheme = function OSF_DDA_Theming_ConvertToOfficeTheme(response) { + var result = {}; + for (var key in response) { + result[key] = OSF.OUtil.convertIntToCssHexColor(response[key]); + } + return result; +}; +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: OSF.DDA.Theming.ConvertToDocumentTheme +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: OSF.DDA.Theming.ConvertToOfficeTheme +}); +OSF.DDA.Theming.OfficeThemeChangedEventArgs = function OSF_DDA_Theming_OfficeThemeChangedEventArgs(officeTheme) { + var ret = OSF.DDA.Theming.ConvertToOfficeTheme(officeTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.OfficeThemeChanged + }, + "officeTheme": { + value: ret + } + }); +}; +OSF.DDA.Theming.DocumentThemeChangedEventArgs = function OSF_DDA_Theming_DocumentThemeChangedEventArgs(documentTheme) { + var ret = OSF.DDA.Theming.ConvertToDocumentTheme(documentTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentThemeChanged + }, + "documentTheme": { + value: ret + } + }); +}; +var OSF_DDA_Theming_InternalThemeHandler = (function () { + function OSF_DDA_Theming_InternalThemeHandler() { + this._pseudoDocumentObject = null; + this._previousDocumentThemeData = null; + this._previousOfficeThemeData = null; + this._officeCss = null; + this._asyncCallsCompleted = null; + this._onAsyncCallsCompleted = null; + } + OSF_DDA_Theming_InternalThemeHandler.prototype.InitializeAndChangeOnce = function (callback) { + this._officeCss = this._getOfficeThemesCss(); + if (!this._officeCss) { + if (callback) { + callback(); + } + return; + } + this._onAsyncCallsCompleted = callback; + this._pseudoDocumentObject = {}; + var pseudoDoc = this._pseudoDocumentObject; + OSF.DDA.DispIdHost.addAsyncMethods(pseudoDoc, [ + OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(pseudoDoc, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.OfficeThemeChanged, + Microsoft.Office.WebExtension.EventType.DocumentThemeChanged + ])); + this._asyncCallsCompleted = {}; + this._asyncCallsCompleted[OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync] = false; + this._asyncCallsCompleted[OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync] = false; + this._getAndProcessThemeData(pseudoDoc.getDocumentThemeAsync, Function.createDelegate(this, this._processDocumentThemeData), OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync); + this._getAndProcessThemeData(pseudoDoc.getOfficeThemeAsync, Function.createDelegate(this, this._processOfficeThemeData), OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._getOfficeThemesCss = function () { + function getOfficeThemesCssInternal() { + var cssFileName = "officethemes.css"; + for (var i = 0; i < document.styleSheets.length; i++) { + var ss = document.styleSheets[i]; + if (!ss.disabled && ss.href && cssFileName == ss.href.substring(ss.href.length - cssFileName.length, ss.href.length).toLowerCase()) { + if ((!ss.cssRules) && (!ss.rules)) { + return null; + } else { + return ss; + } + } + } + } + + try { + return getOfficeThemesCssInternal(); + } catch (e) { + return null; + } + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeCss = function (officeCss, selector, newRule) { + var length = officeCss.cssRules ? officeCss.cssRules.length : officeCss.rules.length; + for (var i = 0; i < length; i++) { + var rule; + if (officeCss.cssRules) { + rule = officeCss.cssRules[i]; + } else { + rule = officeCss.rules[i]; + } + var ruleSelector = rule.selectorText; + if (ruleSelector !== "" && ruleSelector.toLowerCase() == selector.toLowerCase()) { + if (officeCss.cssRules) { + officeCss.deleteRule(i); + officeCss.insertRule(ruleSelector + newRule, i); + } else { + officeCss.removeRule(i); + officeCss.addRule(ruleSelector, newRule, i); + } + } + } + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeDocumentThemeData = function (data) { + var documentThemeCssMapping = [ + { name: "primaryFontColor", cssSelector: ".office-docTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-docTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-docTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-docTheme-secondary-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-color", cssProperty: "color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-color", cssProperty: "color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-color", cssProperty: "color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-color", cssProperty: "color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-color", cssProperty: "color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-color", cssProperty: "color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-bgColor", cssProperty: "background-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-bgColor", cssProperty: "background-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-bgColor", cssProperty: "background-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-bgColor", cssProperty: "background-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-bgColor", cssProperty: "background-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-borderColor", cssProperty: "border-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-borderColor", cssProperty: "border-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-borderColor", cssProperty: "border-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-borderColor", cssProperty: "border-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-borderColor", cssProperty: "border-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-borderColor", cssProperty: "border-color" }, + { name: "hyperlink", cssSelector: ".office-a", cssProperty: "color" }, + { name: "followedHyperlink", cssSelector: ".office-a:visited", cssProperty: "color" }, + { name: "headerLatinFont", cssSelector: ".office-headerFont-latin", cssProperty: "font-family" }, + { name: "headerEastAsianFont", cssSelector: ".office-headerFont-eastAsian", cssProperty: "font-family" }, + { name: "headerScriptFont", cssSelector: ".office-headerFont-script", cssProperty: "font-family" }, + { name: "headerLocalizedFont", cssSelector: ".office-headerFont-localized", cssProperty: "font-family" }, + { name: "bodyLatinFont", cssSelector: ".office-bodyFont-latin", cssProperty: "font-family" }, + { name: "bodyEastAsianFont", cssSelector: ".office-bodyFont-eastAsian", cssProperty: "font-family" }, + { name: "bodyScriptFont", cssSelector: ".office-bodyFont-script", cssProperty: "font-family" }, + { name: "bodyLocalizedFont", cssSelector: ".office-bodyFont-localized", cssProperty: "font-family" } + ]; + var realData = data.type == "documentThemeChanged" ? data.documentTheme : data; + for (var i = 0; i < documentThemeCssMapping.length; i++) { + if (this._previousDocumentThemeData === null || this._previousDocumentThemeData[documentThemeCssMapping[i].name] != realData[documentThemeCssMapping[i].name]) { + if (realData[documentThemeCssMapping[i].name] != null && realData[documentThemeCssMapping[i].name] != "") { + var insertableText = realData[documentThemeCssMapping[i].name]; + + if (documentThemeCssMapping[i].cssProperty === "font-family") { + insertableText = '"' + insertableText.replace(/"/g, '\\"') + '"'; + } + this._changeCss(this._officeCss, documentThemeCssMapping[i].cssSelector, "{" + documentThemeCssMapping[i].cssProperty + ":" + insertableText + ";}"); + } else { + this._changeCss(this._officeCss, documentThemeCssMapping[i].cssSelector, "{}"); + } + } + } + this._previousDocumentThemeData = realData; + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeOfficeThemeData = function (data) { + var officeThemeCssMapping = [ + { name: "primaryFontColor", cssSelector: ".office-officeTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-officeTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-officeTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-officeTheme-secondary-bgColor", cssProperty: "background-color" } + ]; + var realData = data.type == "officeThemeChanged" ? data.officeTheme : data; + for (var i = 0; i < officeThemeCssMapping.length; i++) { + if (this._previousOfficeThemeData === null || this._previousOfficeThemeData[officeThemeCssMapping[i].name] != realData[officeThemeCssMapping[i].name]) { + if (realData[officeThemeCssMapping[i].name] !== undefined) { + this._changeCss(this._officeCss, officeThemeCssMapping[i].cssSelector, "{" + officeThemeCssMapping[i].cssProperty + ":" + realData[officeThemeCssMapping[i].name] + ";}"); + } + } + } + this._previousOfficeThemeData = realData; + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._getAndProcessThemeData = function (getThemeMethod, processResultCallback, getThemeMethodIdentifier) { + getThemeMethod(Function.createDelegate(this, function (asyncResult) { + if (asyncResult.status == "succeeded") { + var data = asyncResult.value; + processResultCallback(data); + } + if (this._areAllCallsCompleted(getThemeMethodIdentifier) && this._onAsyncCallsCompleted) { + this._onAsyncCallsCompleted(); + this._onAsyncCallsCompleted = null; + } + })); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._processOfficeThemeData = function (data) { + this._changeOfficeThemeData(data); + this._pseudoDocumentObject.addHandlerAsync(Microsoft.Office.WebExtension.EventType.OfficeThemeChanged, Function.createDelegate(this, this._changeOfficeThemeData), null); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._processDocumentThemeData = function (data) { + this._changeDocumentThemeData(data); + this._pseudoDocumentObject.addHandlerAsync(Microsoft.Office.WebExtension.EventType.DocumentThemeChanged, Function.createDelegate(this, this._changeDocumentThemeData), null); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._areAllCallsCompleted = function (completedCall) { + var asyncCallsCompleted; + + if (!(asyncCallsCompleted = this._asyncCallsCompleted)) { + return true; + } + if (completedCall && asyncCallsCompleted.hasOwnProperty(completedCall)) { + asyncCallsCompleted[completedCall] = true; + } + for (var call in asyncCallsCompleted) { + if (asyncCallsCompleted.hasOwnProperty(call) && asyncCallsCompleted[call]) { + continue; + } + return false; + } + return true; + }; + return OSF_DDA_Theming_InternalThemeHandler; +})(); +OSF.DDA.Theming.InternalThemeHandler = OSF_DDA_Theming_InternalThemeHandler; +var parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap; +parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.DocumentTheme, value: parameterMap.self } + ] +}); +parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OfficeTheme, value: parameterMap.self } + ] +}); +parameterMap.define({ + type: OSF.DDA.EventDispId.dispidDocumentThemeChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, value: parameterMap.self } + ], + isComplexType: true +}); +parameterMap.define({ + type: OSF.DDA.EventDispId.dispidOfficeThemeChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, value: parameterMap.self } + ], + isComplexType: true +}); +var destKeys = OSF.DDA.Theming.DocumentThemeEnum; +parameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.DocumentTheme, + fromHost: [ + { name: destKeys.PrimaryBackgroundColor, value: 0 }, + { name: destKeys.PrimaryFontColor, value: 1 }, + { name: destKeys.SecondaryBackgroundColor, value: 2 }, + { name: destKeys.SecondaryFontColor, value: 3 }, + { name: destKeys.Accent1, value: 4 }, + { name: destKeys.Accent2, value: 5 }, + { name: destKeys.Accent3, value: 6 }, + { name: destKeys.Accent4, value: 7 }, + { name: destKeys.Accent5, value: 8 }, + { name: destKeys.Accent6, value: 9 }, + { name: destKeys.Hyperlink, value: 10 }, + { name: destKeys.FollowedHyperlink, value: 11 }, + { name: destKeys.HeaderLatinFont, value: 12 }, + { name: destKeys.HeaderEastAsianFont, value: 13 }, + { name: destKeys.HeaderScriptFont, value: 14 }, + { name: destKeys.HeaderLocalizedFont, value: 15 }, + { name: destKeys.BodyLatinFont, value: 16 }, + { name: destKeys.BodyEastAsianFont, value: 17 }, + { name: destKeys.BodyScriptFont, value: 18 }, + { name: destKeys.BodyLocalizedFont, value: 19 } + ], + isComplexType: true +}); +destKeys = OSF.DDA.Theming.OfficeThemeEnum; +parameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.OfficeTheme, + fromHost: [ + { name: destKeys.PrimaryFontColor, value: 0 }, + { name: destKeys.PrimaryBackgroundColor, value: 1 }, + { name: destKeys.SecondaryFontColor, value: 2 }, + { name: destKeys.SecondaryBackgroundColor, value: 3 } + ], + isComplexType: true +}); +parameterMap.define({ + type: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.DocumentTheme, value: parameterMap.self } + ], + isComplexType: true +}); +parameterMap.define({ + type: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OfficeTheme, value: parameterMap.self } + ], + isComplexType: true +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs = function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); + + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { ActiveViewChangedEvent: "ActiveViewChangedEvent" }); +Microsoft.Office.WebExtension.ActiveView = { + Read: "read", + Edit: "edit" +}; +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + ActiveViewChanged: "activeViewChanged" +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetActiveViewAsync: "getActiveViewAsync" +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + var data = response[Microsoft.Office.WebExtension.Parameters.ActiveView]; + return data == undefined ? null : data; + } +}); +OSF.DDA.ActiveViewChangedEventArgs = function OSF_DDA_ActiveViewChangedEventArgs(activeView) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ActiveViewChanged + }, + "activeView": { + value: activeView.activeView + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.ActiveView, + fromHost: [ + { name: 0, value: Microsoft.Office.WebExtension.ActiveView.Read }, + { name: 1, value: Microsoft.Office.WebExtension.ActiveView.Edit } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidActiveViewChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.PowerPointDocument = function OSF_DDA_PowerPointDocument(officeAppContext, settings) { + OSF.DDA.PowerPointDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + OSF.DDA.AsyncMethodNames.GoToByIdAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged, + Microsoft.Office.WebExtension.EventType.ActiveViewChanged + ])); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.PowerPointDocument, OSF.DDA.Document); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.PowerPointDocument(appContext, this._initializeSettings(appContext, false)); + appReady(); +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$PowerPointWin32_prepareRightBeforeWebExtensionInitialize(appContext) { + var license = new OSF.DDA.License(appContext.get_eToken()); + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license)); + var reason = appContext.get_reason(); + reason = OSF.DDA.RichInitializationReason[reason]; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.DispIdHost.getClientDelegateMethods, OSF.DDA.SafeArray.Delegate.ParameterMap)); + var themeHandler = new OSF.DDA.Theming.InternalThemeHandler(); + themeHandler.InitializeAndChangeOnce(); + Microsoft.Office.WebExtension.initialize(reason); +}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-ios-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-ios-16.00.js new file mode 100644 index 000000000..8e99e061b --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-ios-16.00.js @@ -0,0 +1,11 @@ +/* PowerPoint iOS specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b0&&b.push(c)}}}catch(i){}return b}var c=[],b={};b[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,b=1;return {toHost:function(a){if(typeof a!="string"&&a[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=a[OSF.DDA.TableDataProperties.TableRows];d[b]=a[OSF.DDA.TableDataProperties.TableHeaders];a=d}return a},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=a(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=a(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=a(d[b])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,b);this.unpack=function(c,a){var d;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c)){var e=(a||typeof a==="unknown")&&a.toArray;d=e?a.toArray():a||{}}else if(this.isDynamicType(c))d=b[c].fromHost(a);else d=a;return d}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(a){function c(a){var b=a;if(OSF.OUtil.isArray(a))for(var f=b.length,d=0;d2){c=[];for(var g=1;g=a.MESSAGE_TIME_DELTA){f();b.lastMessageTimestamp=d}else{b.lastMessageTimestamp+=a.MESSAGE_TIME_DELTA;setTimeout(function(){f()},b.lastMessageTimestamp-d)}return e};a.prototype.generateCorrelationId=function(){++this.callingIndex;return this.conversationId+this.callingIndex};a.getCurrentTimeMS=function(){return (new Date).getTime()};a.MESSAGE_TIME_DELTA=10;return a}();b.WebkitScriptMessaging=c})(a.ScriptMessaging||(a.ScriptMessaging={}));var b=a.ScriptMessaging})(OSFWebkit||(OSFWebkit={}));OSF.ScriptMessaging=OSFWebkit.ScriptMessaging;var OSFWebkit;(function(a){a.MessageHandlerName="Agave";(function(a){var u="RequirementMatrix",t="CommerceAllowed",s="TouchEnabled",r="InstanceId",q="CorrelationId",p="APISetVersion",o="SolutionToken",n="ControlIntegrationLevel",m="ActivationMode",l="DocumentUrl",k="BindingCount",j="AppDataLocale",i="APPUILocale",h="AppCapabilities",g="APIVersionSequence",f="RevisionVersion",e="MinorVersion",d="MajorVersion",c="SolutionReferenceId",b="Settings";a[a[b]=0]=b;a[a[c]=1]=c;a[a["AppType"]=2]="AppType";a[a[d]=3]=d;a[a[e]=4]=e;a[a[f]=5]=f;a[a[g]=6]=g;a[a[h]=7]=h;a[a[i]=8]=i;a[a[j]=9]=j;a[a[k]=10]=k;a[a[l]=11]=l;a[a[m]=12]=m;a[a[n]=13]=n;a[a[o]=14]=o;a[a[p]=15]=p;a[a[q]=16]=q;a[a[r]=17]=r;a[a[s]=18]=s;a[a[t]=19]=t;a[a[u]=20]=u})(a.AppContextProperties||(a.AppContextProperties={}));var c=a.AppContextProperties;(function(a){var e="GetContext",d="WriteSettings",c="UnregisterEvent",b="RegisterEvent";a[a["Execute"]=1]="Execute";a[a[b]=2]=b;a[a[c]=3]=c;a[a[d]=4]=d;a[a[e]=5]=e})(a.MethodId||(a.MethodId={}));var d=a.MethodId,b=function(){function b(a){this.hostScriptProxy=a}b.prototype.execute=function(g,f,c){var b=f;if(b==null)b=[];var e={id:g,apiArgs:b},d=function(b){var d=b;if(OSF.OUtil.isArray(b)&&b.length>=2){var e=b[0];d=b[1]}c&&c(new a.WebkitSafeArray(d))};this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.Execute,e,d)};b.prototype.registerEvent=function(g,f,c,b){var d=function(b){var d=b,e=0;if(OSF.OUtil.isArray(b)&&b.length>=2){d=b[0];e=b[1]}c&&c(e,new a.WebkitSafeArray(d))},e=function(c){b&&b(new a.WebkitSafeArray(c))};this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.RegisterEvent,g,f,d,e)};b.prototype.unregisterEvent=function(e,d,c){var b=function(b){c(new a.WebkitSafeArray(b))};this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.UnregisterEvent,e,d,b)};return b}();a.WebkitHostController=b})(OSFWebkit||(OSFWebkit={}));OSF.Webkit=OSFWebkit;OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger());OSF.DDA.ClientSettingsManager={getSettingsExecuteMethod:function(a){return function(b){var e,d,c=function(c,a){b.onReceiving&&b.onReceiving();b.onComplete&&b.onComplete(c,a)};try{a(b.hostCallArgs,b.onCalling,c)}catch(f){e=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;d={name:Strings.OfficeOM.L_InternalError,message:f};c(e,d)}}},read:function(b,a){var f=[],e=[];b&&b();var c=OSF._OfficeAppFactory.getInitializationHelper(),d=function(b){a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,b.get_settings())};c.getAppContext(null,d)},write:function(b,i,d,c){var a={},f=[],e=[];for(var g in b){f.push(g);e.push(b[g])}a["keys"]=f;a["values"]=e;d&&d();var h=function(a){c&&c(a[0],null)};OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.WriteSettings,a,h)}};OSF.InitializationHelper.prototype.initializeSettings=function(c,b){var a=c.get_settings(),d=this.deserializeSettings(a,b);return d};OSF.InitializationHelper.prototype.getAppContext=function(c,b){var a=function(c){var f,a=OSF.Webkit.AppContextProperties,g=c[a.AppType],i=false;for(var u in OSF.AppName)if(OSF.AppName[u]==g){i=true;break}if(!i)throw"Unsupported client type "+g;for(var j=c[a.Settings],h={},k=j[0],z=j[1],e=0;e40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e4*1024*1024)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return b},onSucceeded:function(a,c,b){return new OSF.DDA.File(a[OSF.DDA.FileProperties.Handle],a[OSF.DDA.FileProperties.FileSize],b[Microsoft.Office.WebExtension.Parameters.SliceSize])}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(b,a){return a[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(a,d,c){var b=a[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(b<0||b>=d.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;a[OSF.DDA.FileSliceOffset]=parseInt((b*c[OSF.DDA.FileProperties.SliceSize]).toString());return a},onSucceeded:function(a,d,c){var b={};OSF.OUtil.defineEnumerableProperties(b,{data:{value:a[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:c[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:a[OSF.DDA.FileProperties.SliceSize]}});return b}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileProperties.FileSize,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:0},{name:OSF.DDA.FileProperties.SliceSize,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:0},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:5},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:6}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:0}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileSliceOffset,value:1},{name:OSF.DDA.FileProperties.SliceSize,value:2}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0}]});OSF.DDA.AsyncMethodNames.addNames({GetSelectedDataAsync:"getSelectedDataAsync",SetSelectedDataAsync:"setSelectedDataAsync"});(function(){function a(b,d,c){var a=b[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&a&&(a[OSF.DDA.TableDataProperties.TableRows]!=undefined||a[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))a=OSF.DDA.OMFactory.manufactureTableData(a);a=OSF.DDA.DataCoercion.coerceData(a,c[Microsoft.Office.WebExtension.Parameters.CoercionType]);return a==undefined?null:a}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,"enum":Microsoft.Office.WebExtension.CoercionType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}}],privateStateCallbacks:[],onSucceeded:a});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}}],privateStateCallbacks:[]})})();OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:1},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:0},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:1},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:2},{name:Microsoft.Office.WebExtension.GoToType.Index,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:0},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:1},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:1},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:2}]});OSF.DDA.SettingsManager={SerializedSettings:"serializedSettings",DateJSONPrefix:"Date(",DataJSONSuffix:")",serializeSettings:function(b){var d={};for(var c in b){var a=b[c];try{if(JSON)a=JSON.stringify(a,function(a,b){return OSF.OUtil.isDate(this[a])?OSF.DDA.SettingsManager.DateJSONPrefix+this[a].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix:b});else a=Sys.Serialization.JavaScriptSerializer.serialize(a);d[c]=a}catch(e){}}return d},deserializeSettings:function(b){var d={};b=b||{};for(var c in b){var a=b[c];try{if(JSON)a=JSON.parse(a,function(c,a){var b;if(typeof a==="string"&&a&&a.length>6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(a){this._eventHandlers={};for(var c in a){var b=a[c];this._eventHandlers[b]=[]}};OSF.EventDispatch.prototype={getSupportedEvents:function(){var a=[];for(var b in this._eventHandlers)a.push(b);return a},supportsEvent:function(c){var a=false;for(var b in this._eventHandlers)if(c==b){a=true;break}return a},hasEventHandler:function(b,c){var a=this._eventHandlers[b];if(a&&a.length>0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SettingsManager.SerializedSettings},{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});OSF.DDA.AsyncMethodNames.addNames({GetOfficeThemeAsync:"getOfficeThemeAsync",GetDocumentThemeAsync:"getDocumentThemeAsync"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{OfficeThemeChanged:"officeThemeChanged",DocumentThemeChanged:"documentThemeChanged"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.Parameters,{DocumentTheme:"documentTheme",OfficeTheme:"officeTheme"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DocumentThemeChangedEvent:"DocumentThemeChangedEvent",OfficeThemeChangedEvent:"OfficeThemeChangedEvent"});OSF.OUtil.setNamespace("Theming",OSF.DDA);OSF.DDA.Theming.OfficeThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor"};OSF.DDA.Theming.DocumentThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor",Accent1:"accent1",Accent2:"accent2",Accent3:"accent3",Accent4:"accent4",Accent5:"accent5",Accent6:"accent6",Hyperlink:"hyperlink",FollowedHyperlink:"followedHyperlink",HeaderLatinFont:"headerLatinFont",HeaderEastAsianFont:"headerEastAsianFont",HeaderScriptFont:"headerScriptFont",HeaderLocalizedFont:"headerLocalizedFont",BodyLatinFont:"bodyLatinFont",BodyEastAsianFont:"bodyEastAsianFont",BodyScriptFont:"bodyScriptFont",BodyLocalizedFont:"bodyLocalizedFont"};OSF.DDA.Theming.ConvertToDocumentTheme=function(f){var b=false,a=true;for(var d=[{name:"primaryFontColor",needToConvertToHex:a},{name:"primaryBackgroundColor",needToConvertToHex:a},{name:"secondaryFontColor",needToConvertToHex:a},{name:"secondaryBackgroundColor",needToConvertToHex:a},{name:"accent1",needToConvertToHex:a},{name:"accent2",needToConvertToHex:a},{name:"accent3",needToConvertToHex:a},{name:"accent4",needToConvertToHex:a},{name:"accent5",needToConvertToHex:a},{name:"accent6",needToConvertToHex:a},{name:"hyperlink",needToConvertToHex:a},{name:"followedHyperlink",needToConvertToHex:a},{name:"headerLatinFont",needToConvertToHex:b},{name:"headerEastAsianFont",needToConvertToHex:b},{name:"headerScriptFont",needToConvertToHex:b},{name:"headerLocalizedFont",needToConvertToHex:b},{name:"bodyLatinFont",needToConvertToHex:b},{name:"bodyEastAsianFont",needToConvertToHex:b},{name:"bodyScriptFont",needToConvertToHex:b},{name:"bodyLocalizedFont",needToConvertToHex:b}],e={},c=0;c 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Common", Microsoft.Office); +OSF.SerializerVersion = { + MsAjax: 0, + Browser: 1 +}; + +(function (window) { + "use strict"; + var stringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', 'g'), trueFalseNullRegEx = new RegExp('\\b(true|false|null)\\b', 'g'), numbersRegEx = new RegExp('-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?', 'g'), badBracketsRegEx = new RegExp('[^{:,\\[\\s](?=\\s*\\[)'), badRemainderRegEx = new RegExp('[^\\s\\[\\]{}:,]'), jsonErrorMsg = "Cannot deserialize. The data does not correspond to valid JSON."; + function addHandler(element, eventName, handler) { + if (element.addEventListener) { + element.addEventListener(eventName, handler, false); + } else if (element.attachEvent) { + element.attachEvent("on" + eventName, handler); + } + } + function getAjaxSerializer() { + if (OsfMsAjaxFactory.msAjaxSerializer) { + return OsfMsAjaxFactory.msAjaxSerializer; + } + return null; + } + function deserialize(data, secure, oldDeserialize) { + var transformed; + if (!secure) { + return oldDeserialize(data); + } + if (window.JSON && window.JSON.parse) { + return window.JSON.parse(data); + } + + transformed = data.replace(stringRegEx, "[]"); + + transformed = transformed.replace(trueFalseNullRegEx, "[]"); + + transformed = transformed.replace(numbersRegEx, "[]"); + + if (badBracketsRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + if (badRemainderRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + try { + eval("(" + data + ")"); + } catch (e) { + throw jsonErrorMsg; + } + } + function patchDeserializer() { + var serializer = getAjaxSerializer(), oldDeserialize; + if (serializer === null || typeof (serializer.deserialize) !== "function") { + return false; + } + if (serializer.__patchVersion >= 1) { + return true; + } + + oldDeserialize = serializer.deserialize; + + serializer.deserialize = function (data, secure) { + return deserialize(data, true, oldDeserialize); + }; + serializer.__patchVersion = 1; + return true; + } + if (!patchDeserializer()) { + addHandler(window, "load", function () { + patchDeserializer(); + }); + } +}(window)); + +Microsoft.Office.Common.InvokeType = { + "async": 0, + "sync": 1, + "asyncRegisterEvent": 2, + "asyncUnregisterEvent": 3, + "syncRegisterEvent": 4, + "syncUnregisterEvent": 5 +}; + +Microsoft.Office.Common.InvokeResultCode = { + "noError": 0, + "errorInRequest": -1, + "errorHandlingRequest": -2, + "errorInResponse": -3, + "errorHandlingResponse": -4, + "errorHandlingRequestAccessDenied": -5, + "errorHandlingMethodCallTimedout": -6 +}; + +Microsoft.Office.Common.MessageType = { + "request": 0, + "response": 1 +}; + +Microsoft.Office.Common.ActionType = { + "invoke": 0, + "registerEvent": 1, + "unregisterEvent": 2 }; + +Microsoft.Office.Common.ResponseType = { + "forCalling": 0, + "forEventing": 1 +}; + +Microsoft.Office.Common.MethodObject = function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) { + this._method = method; + + this._invokeType = invokeType; + + this._blockingOthers = blockingOthers; +}; +Microsoft.Office.Common.MethodObject.prototype = { + getMethod: function Microsoft_Office_Common_MethodObject$getMethod() { + return this._method; + }, + getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() { + return this._invokeType; + }, + getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() { + return this._blockingOthers; + } +}; + +Microsoft.Office.Common.EventMethodObject = function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) { + this._registerMethodObject = registerMethodObject; + + this._unregisterMethodObject = unregisterMethodObject; +}; +Microsoft.Office.Common.EventMethodObject.prototype = { + getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() { + return this._registerMethodObject; + }, + getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() { + return this._unregisterMethodObject; + } +}; + +Microsoft.Office.Common.ServiceEndPoint = function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) { + var e = Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + + this._methodObjectList = {}; + + this._eventHandlerProxyList = {}; + + this._Id = serviceEndPointId; + + this._conversations = {}; + + this._policyManager = null; + + this._appDomains = {}; +}; +Microsoft.Office.Common.ServiceEndPoint.prototype = { + registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) { + var e = Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false }, + { name: "method", type: Function, mayBeNull: false }, + { name: "invokeType", type: Number, mayBeNull: false }, + { name: "blockingOthers", type: Boolean, mayBeNull: false } + ]); + if (e) + throw e; + if (invokeType !== Microsoft.Office.Common.InvokeType.async && invokeType !== Microsoft.Office.Common.InvokeType.sync) { + throw OsfMsAjaxFactory.msAjaxError.argument("invokeType"); + } + var methodObject = new Microsoft.Office.Common.MethodObject(method, invokeType, blockingOthers); + this._methodObjectList[methodName] = methodObject; + }, + unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) { + var e = Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._methodObjectList[methodName]; + }, + registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject = new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, Microsoft.Office.Common.InvokeType.syncRegisterEvent, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, Microsoft.Office.Common.InvokeType.syncUnregisterEvent, false)); + this._methodObjectList[eventName] = methodObject; + }, + registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "registerMethodInvokeType", type: Number, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethodInvokeType", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject = new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, registerMethodInvokeType, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, unregisterMethodInvokeType, false)); + this._methodObjectList[eventName] = methodObject; + }, + unregisterEvent: function (eventName) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + this.unregisterMethod(eventName); + }, + registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId, conversationUrl, appDomains, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "conversationUrl", type: String, mayBeNull: false, optional: true }, + { name: "appDomains", type: Object, mayBeNull: true, optional: true }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + ; + if (appDomains) { + if (!(appDomains instanceof Array)) { + throw OsfMsAjaxFactory.msAjaxError.argument("appDomains"); + } + this._appDomains[conversationId] = appDomains; + } + this._conversations[conversationId] = { url: conversationUrl, serializerVersion: serializerVersion }; + }, + unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._conversations[conversationId]; + }, + setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) { + var e = Function._validateParams(arguments, [ + { name: "policyManager", type: Object, mayBeNull: false } + ]); + if (e) + throw e; + + if (!policyManager.checkPermission) { + throw OsfMsAjaxFactory.msAjaxError.argument("policyManager"); + } + this._policyManager = policyManager; + }, + getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() { + return this._policyManager; + } +}; + +Microsoft.Office.Common.ClientEndPoint = function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "targetWindow", mayBeNull: false }, + { name: "targetUrl", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + if (!targetWindow.postMessage) { + throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow"); + } + + this._conversationId = conversationId; + + this._targetWindow = targetWindow; + + this._targetUrl = targetUrl; + + this._callingIndex = 0; + + this._callbackList = {}; + + this._eventHandlerList = {}; + if (serializerVersion != null) { + this._serializerVersion = serializerVersion; + } else { + this._serializerVersion = OSF.SerializerVersion.MsAjax; + } +}; +Microsoft.Office.Common.ClientEndPoint.prototype = { + invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) { + var e = Function._validateParams(arguments, [ + { name: "targetMethodName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "param", mayBeNull: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + var callbackEntry = { "callback": callback, "createdOn": now.getTime() }; + + if (param && typeof param === "object" && typeof param.__timeout__ === "number") { + callbackEntry.timeout = param.__timeout__; + delete param.__timeout__; + } + this._callbackList[correlationId] = callbackEntry; + try { + var callRequest = new Microsoft.Office.Common.Request(targetMethodName, Microsoft.Office.Common.ActionType.invoke, this._conversationId, correlationId, param); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !== null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } finally { + delete this._callbackList[correlationId]; + } + } + }, + registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) { + var e = Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "eventHandler", type: Function, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + this._callbackList[correlationId] = { "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest = new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.registerEvent, this._conversationId, correlationId, data); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + + this._eventHandlerList[targetEventName] = eventHandler; + } catch (ex) { + try { + if (callback !== null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } + }, + unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) { + var e = Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + this._callbackList[correlationId] = { "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest = new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.unregisterEvent, this._conversationId, correlationId, data); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !== null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } finally { + delete this._eventHandlerList[targetEventName]; + } + } +}; + +Microsoft.Office.Common.XdmCommunicationManager = (function () { + var _invokerQueue = []; + + var _lastMessageProcessTime = null; + + var _messageProcessingTimer = null; + + var _processInterval = 10; + + var _blockingFlag = false; + + var _methodTimeoutTimer = null; + + var _methodTimeoutProcessInterval = 2000; + + var _methodTimeoutDefault = 65000; + var _methodTimeout = _methodTimeoutDefault; + var _serviceEndPoints = {}; + var _clientEndPoints = {}; + var _initialized = false; + + function _lookupServiceEndPoint(conversationId) { + for (var id in _serviceEndPoints) { + if (_serviceEndPoints[id]._conversations[conversationId]) { + return _serviceEndPoints[id]; + } + } + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + ; + + function _lookupClientEndPoint(conversationId) { + var clientEndPoint = _clientEndPoints[conversationId]; + if (!clientEndPoint) { + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + return clientEndPoint; + } + ; + + function _lookupMethodObject(serviceEndPoint, messageObject) { + var methodOrEventMethodObject = serviceEndPoint._methodObjectList[messageObject._actionName]; + if (!methodOrEventMethodObject) { + OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:" + messageObject._actionName); + throw OsfMsAjaxFactory.msAjaxError.argument("messageObject"); + } + var methodObject = null; + if (messageObject._actionType === Microsoft.Office.Common.ActionType.invoke) { + methodObject = methodOrEventMethodObject; + } else if (messageObject._actionType === Microsoft.Office.Common.ActionType.registerEvent) { + methodObject = methodOrEventMethodObject.getRegisterMethodObject(); + } else { + methodObject = methodOrEventMethodObject.getUnregisterMethodObject(); + } + return methodObject; + } + ; + + function _enqueInvoker(invoker) { + _invokerQueue.push(invoker); + } + ; + + function _dequeInvoker() { + if (_messageProcessingTimer !== null) { + if (!_blockingFlag) { + if (_invokerQueue.length > 0) { + var invoker = _invokerQueue.shift(); + _executeCommand(invoker); + } else { + clearInterval(_messageProcessingTimer); + _messageProcessingTimer = null; + } + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + function _executeCommand(invoker) { + _blockingFlag = invoker.getInvokeBlockingFlag(); + + invoker.invoke(); + _lastMessageProcessTime = (new Date()).getTime(); + } + ; + + function _checkMethodTimeout() { + if (_methodTimeoutTimer) { + var clientEndPoint; + var methodCallsNotTimedout = 0; + var now = new Date(); + var timeoutValue; + for (var conversationId in _clientEndPoints) { + clientEndPoint = _clientEndPoints[conversationId]; + for (var correlationId in clientEndPoint._callbackList) { + var callbackEntry = clientEndPoint._callbackList[correlationId]; + + timeoutValue = callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout; + if (timeoutValue >= 0 && Math.abs(now.getTime() - callbackEntry.createdOn) >= timeoutValue) { + try { + if (callbackEntry.callback) { + callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout, null); + } + } finally { + delete clientEndPoint._callbackList[correlationId]; + } + } else { + methodCallsNotTimedout++; + } + ; + } + } + if (methodCallsNotTimedout === 0) { + clearInterval(_methodTimeoutTimer); + _methodTimeoutTimer = null; + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + + function _postCallbackHandler() { + _blockingFlag = false; + } + ; + + function _registerListener(listener) { + if (window.addEventListener) { + window.addEventListener("message", listener, false); + } else if ((navigator.userAgent.indexOf("MSIE") > -1) && window.attachEvent) { + window.attachEvent("onmessage", listener); + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."); + throw OsfMsAjaxFactory.msAjaxError.argument("Browser"); + } + } + ; + + function _checkOrigin(url, origin) { + var res = false; + + if (url === true) { + return true; + } + if (!url || !origin || !url.length || !origin.length) { + return res; + } + var url_parser, org_parser; + url_parser = document.createElement('a'); + org_parser = document.createElement('a'); + url_parser.href = url; + org_parser.href = origin; + res = _urlCompare(url_parser, org_parser); + delete url_parser, org_parser; + return res; + } + + function _checkOriginWithAppDomains(allowed_domains, origin) { + var res = false; + if (!origin || !origin.length || !(allowed_domains) || !(allowed_domains instanceof Array) || !allowed_domains.length) { + return res; + } + var org_parser = document.createElement('a'); + var app_domain_parser = document.createElement('a'); + org_parser.href = origin; + for (var i = 0; i < allowed_domains.length && !res; i++) { + if (allowed_domains[i].indexOf("://") !== -1) { + app_domain_parser.href = allowed_domains[i]; + res = _urlCompare(org_parser, app_domain_parser); + } + } + delete org_parser, app_domain_parser; + return res; + } + + function _urlCompare(url_parser1, url_parser2) { + return ((url_parser1.hostname == url_parser2.hostname) && (url_parser1.protocol == url_parser2.protocol) && (url_parser1.port == url_parser2.port)); + } + + function _receive(e) { + if (e.data != '') { + var messageObject; + var serializerVersion = OSF.SerializerVersion.MsAjax; + var serializedMessage = e.data; + + try { + messageObject = Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, OSF.SerializerVersion.Browser); + serializerVersion = messageObject._serializerVersion != null ? messageObject._serializerVersion : serializerVersion; + } catch (ex) { + } + if (serializerVersion != OSF.SerializerVersion.Browser) { + try { + messageObject = Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, serializerVersion); + } catch (ex) { + return; + } + } + if (typeof (messageObject._messageType) == 'undefined') { + return; + } + + if (messageObject._messageType === Microsoft.Office.Common.MessageType.request) { + var requesterUrl = (e.origin == null || e.origin == "null") ? messageObject._origin : e.origin; + try { + var serviceEndPoint = _lookupServiceEndPoint(messageObject._conversationId); + ; + var conversation = serviceEndPoint._conversations[messageObject._conversationId]; + serializerVersion = conversation.serializerVersion != null ? conversation.serializerVersion : serializerVersion; + ; + if (!_checkOrigin(conversation.url, e.origin) && !_checkOriginWithAppDomains(serviceEndPoint._appDomains[messageObject._conversationId], e.origin)) { + throw "Failed origin check"; + } + var policyManager = serviceEndPoint.getPolicyManager(); + if (policyManager && !policyManager.checkPermission(messageObject._conversationId, messageObject._actionName, messageObject._data)) { + throw "Access Denied"; + } + var methodObject = _lookupMethodObject(serviceEndPoint, messageObject); + + var invokeCompleteCallback = new Microsoft.Office.Common.InvokeCompleteCallback(e.source, requesterUrl, messageObject._actionName, messageObject._conversationId, messageObject._correlationId, _postCallbackHandler, serializerVersion); + + var invoker = new Microsoft.Office.Common.Invoker(methodObject, messageObject._data, invokeCompleteCallback, serviceEndPoint._eventHandlerProxyList, messageObject._conversationId, messageObject._actionName, serializerVersion); + var shouldEnque = true; + + if (_messageProcessingTimer == null) { + if ((_lastMessageProcessTime == null || (new Date()).getTime() - _lastMessageProcessTime > _processInterval) && !_blockingFlag) { + _executeCommand(invoker); + shouldEnque = false; + } else { + _messageProcessingTimer = setInterval(_dequeInvoker, _processInterval); + } + } + if (shouldEnque) { + _enqueInvoker(invoker); + } + } catch (ex) { + var errorCode = Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest; + if (ex == "Access Denied") { + errorCode = Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied; + } + var callResponse = new Microsoft.Office.Common.Response(messageObject._actionName, messageObject._conversationId, messageObject._correlationId, errorCode, Microsoft.Office.Common.ResponseType.forCalling, ex); + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(callResponse, serializerVersion); + if (e.source && e.source.postMessage) { + e.source.postMessage(envelopedResult, requesterUrl); + } + } + } else if (messageObject._messageType === Microsoft.Office.Common.MessageType.response) { + var clientEndPoint = _lookupClientEndPoint(messageObject._conversationId); + clientEndPoint._serializerVersion = serializerVersion; + ; + if (!_checkOrigin(clientEndPoint._targetUrl, e.origin)) { + throw "Failed orgin check"; + } + if (messageObject._responseType === Microsoft.Office.Common.ResponseType.forCalling) { + var callbackEntry = clientEndPoint._callbackList[messageObject._correlationId]; + if (callbackEntry) { + try { + if (callbackEntry.callback) + callbackEntry.callback(messageObject._errorCode, messageObject._data); + } finally { + delete clientEndPoint._callbackList[messageObject._correlationId]; + } + } + } else { + var eventhandler = clientEndPoint._eventHandlerList[messageObject._actionName]; + if (eventhandler !== undefined && eventhandler !== null) { + eventhandler(messageObject._data); + } + } + } else { + return; + } + } + } + ; + + function _initialize() { + if (!_initialized) { + _registerListener(_receive); + _initialized = true; + } + } + ; + + return { + connect: function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl, serializerVersion) { + var clientEndPoint = _clientEndPoints[conversationId]; + if (!clientEndPoint) { + _initialize(); + clientEndPoint = new Microsoft.Office.Common.ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion); + _clientEndPoints[conversationId] = clientEndPoint; + } + return clientEndPoint; + }, + getClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _clientEndPoints[conversationId]; + }, + createServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) { + _initialize(); + var serviceEndPoint = new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId); + _serviceEndPoints[serviceEndPointId] = serviceEndPoint; + return serviceEndPoint; + }, + getServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) { + var e = Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _serviceEndPoints[serviceEndPointId]; + }, + deleteClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete _clientEndPoints[conversationId]; + }, + _setMethodTimeout: function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) { + var e = Function._validateParams(arguments, [ + { name: "methodTimeout", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + _methodTimeout = (methodTimeout <= 0) ? _methodTimeoutDefault : methodTimeout; + }, + _startMethodTimeoutTimer: function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() { + if (!_methodTimeoutTimer) { + _methodTimeoutTimer = setInterval(_checkMethodTimeout, _methodTimeoutProcessInterval); + } + } + }; +})(); + +Microsoft.Office.Common.Message = function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) { + var e = Function._validateParams(arguments, [ + { name: "messageType", type: Number, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._messageType = messageType; + + this._actionName = actionName; + + this._conversationId = conversationId; + + this._correlationId = correlationId; + + this._origin = window.location.href; + + if (typeof data == "undefined") { + this._data = null; + } else { + this._data = data; + } +}; +Microsoft.Office.Common.Message.prototype = { + getActionName: function Microsoft_Office_Common_Message$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_Message$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() { + return this._correlationId; + }, + getOrigin: function Microsoft_Office_Common_Message$getOrigin() { + return this._origin; + }, + getData: function Microsoft_Office_Common_Message$getData() { + return this._data; + }, + getMessageType: function Microsoft_Office_Common_Message$getMessageType() { + return this._messageType; + } +}; + +Microsoft.Office.Common.Request = function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) { + Microsoft.Office.Common.Request.uber.constructor.call(this, Microsoft.Office.Common.MessageType.request, actionName, conversationId, correlationId, data); + this._actionType = actionType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Request, Microsoft.Office.Common.Message); +Microsoft.Office.Common.Request.prototype.getActionType = function Microsoft_Office_Common_Request$getActionType() { + return this._actionType; +}; + +Microsoft.Office.Common.Response = function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) { + Microsoft.Office.Common.Response.uber.constructor.call(this, Microsoft.Office.Common.MessageType.response, actionName, conversationId, correlationId, data); + this._errorCode = errorCode; + this._responseType = responseType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Response, Microsoft.Office.Common.Message); + +Microsoft.Office.Common.Response.prototype.getErrorCode = function Microsoft_Office_Common_Response$getErrorCode() { + return this._errorCode; +}; + +Microsoft.Office.Common.Response.prototype.getResponseType = function Microsoft_Office_Common_Response$getResponseType() { + return this._responseType; +}; + +Microsoft.Office.Common.MessagePackager = { + envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject, serializerVersion) { + if (serializerVersion == OSF.SerializerVersion.Browser && (typeof (JSON) !== "undefined")) { + if (typeof (messageObject) === "object") { + messageObject._serializerVersion = serializerVersion; + } + return JSON.stringify(messageObject); + } else { + if (typeof (messageObject) === "object") { + messageObject._serializerVersion = OSF.SerializerVersion.MsAjax; + } + return OsfMsAjaxFactory.msAjaxSerializer.serialize(messageObject); + } + }, + unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject, serializerVersion) { + if (serializerVersion == OSF.SerializerVersion.Browser && (typeof (JSON) !== "undefined")) { + return JSON.parse(messageObject); + } else { + return OsfMsAjaxFactory.msAjaxSerializer.deserialize(messageObject, true); + } + } +}; + +Microsoft.Office.Common.ResponseSender = function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "requesterWindow", mayBeNull: false }, + { name: "requesterUrl", type: String, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "responsetype", type: Number, maybeNull: false }, + { name: "serializerVersion", type: Number, maybeNull: true, optional: true } + ]); + if (e) + throw e; + + this._requesterWindow = requesterWindow; + + this._requesterUrl = requesterUrl; + + this._actionName = actionName; + + this._conversationId = conversationId; + + this._correlationId = correlationId; + + this._invokeResultCode = Microsoft.Office.Common.InvokeResultCode.noError; + + this._responseType = responseType; + var me = this; + + this._send = function (result) { + try { + var response = new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + ; + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:" + ex.message); + } + }; +}; +Microsoft.Office.Common.ResponseSender.prototype = { + getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() { + return this._requesterWindow; + }, + getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() { + return this._requesterUrl; + }, + getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() { + return this._correlationId; + }, + getSend: function Microsoft_Office_Common_ResponseSender$getSend() { + return this._send; + }, + setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) { + this._invokeResultCode = resultCode; + } +}; + +Microsoft.Office.Common.InvokeCompleteCallback = function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler, serializerVersion) { + Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this, requesterWindow, requesterUrl, actionName, conversationId, correlationId, Microsoft.Office.Common.ResponseType.forCalling, serializerVersion); + + this._postCallbackHandler = postCallbackHandler; + var me = this; + + this._send = function (result) { + try { + var response = new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + + me._postCallbackHandler(); + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:" + ex.message); + } + }; +}; +OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback, Microsoft.Office.Common.ResponseSender); + +Microsoft.Office.Common.Invoker = function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "methodObject", mayBeNull: false }, + { name: "paramValue", mayBeNull: true }, + { name: "invokeCompleteCallback", mayBeNull: false }, + { name: "eventHandlerProxyList", mayBeNull: true }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "eventName", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._methodObject = methodObject; + + this._param = paramValue; + + this._invokeCompleteCallback = invokeCompleteCallback; + + this._eventHandlerProxyList = eventHandlerProxyList; + + this._conversationId = conversationId; + + this._eventName = eventName; + this._serializerVersion = serializerVersion; +}; +Microsoft.Office.Common.Invoker.prototype = { + invoke: function Microsoft_Office_Common_Invoker$invoke() { + try { + var result; + switch (this._methodObject.getInvokeType()) { + case Microsoft.Office.Common.InvokeType.async: + this._methodObject.getMethod()(this._param, this._invokeCompleteCallback.getSend()); + break; + case Microsoft.Office.Common.InvokeType.sync: + result = this._methodObject.getMethod()(this._param); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncRegisterEvent: + var eventHandlerProxy = this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + result = this._methodObject.getMethod()(eventHandlerProxy.getSend(), this._param); + + this._eventHandlerProxyList[this._conversationId + this._eventName] = eventHandlerProxy.getSend(); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncUnregisterEvent: + var eventHandler = this._eventHandlerProxyList[this._conversationId + this._eventName]; + + result = this._methodObject.getMethod()(eventHandler, this._param); + + delete this._eventHandlerProxyList[this._conversationId + this._eventName]; + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.asyncRegisterEvent: + var eventHandlerProxyAsync = this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(), this._invokeCompleteCallback.getSend(), this._param); + + this._eventHandlerProxyList[this._callerId + this._eventName] = eventHandlerProxyAsync.getSend(); + + break; + case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: + var eventHandlerAsync = this._eventHandlerProxyList[this._callerId + this._eventName]; + + this._methodObject.getMethod()(eventHandlerAsync, this._invokeCompleteCallback.getSend(), this._param); + + delete this._eventHandlerProxyList[this._callerId + this._eventName]; + + break; + default: + break; + } + } catch (ex) { + this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse); + this._invokeCompleteCallback.getSend()(ex); + } + }, + getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() { + return this._methodObject.getBlockingFlag(); + }, + _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) { + return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(), invokeCompleteObject.getRequesterUrl(), invokeCompleteObject.getActionName(), invokeCompleteObject.getConversationId(), invokeCompleteObject.getCorrelationId(), Microsoft.Office.Common.ResponseType.forEventing, this._serializerVersion); + } +}; + +OSF.OUtil.setNamespace("WAC", OSF.DDA); + +OSF.DDA.WAC.UniqueArguments = { + Data: "Data", + Properties: "Properties", + BindingRequest: "DdaBindingsMethod", + BindingResponse: "Bindings", + SingleBindingResponse: "singleBindingResponse", + GetData: "DdaGetBindingData", + AddRowsColumns: "DdaAddRowsColumns", + SetData: "DdaSetBindingData", + ClearFormats: "DdaClearBindingFormats", + SetFormats: "DdaSetBindingFormats", + SettingsRequest: "DdaSettingsMethod", + BindingEventSource: "ddaBinding", + ArrayData: "ArrayData" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.Delegate.SpecialProcessor = function OSF_DDA_WAC_Delegate_SpecialProcessor() { + var complexTypes = [ + OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + OSF.DDA.WAC.UniqueArguments.BindingRequest, + OSF.DDA.WAC.UniqueArguments.BindingResponse, + OSF.DDA.WAC.UniqueArguments.GetData, + OSF.DDA.WAC.UniqueArguments.AddRowsColumns, + OSF.DDA.WAC.UniqueArguments.SetData, + OSF.DDA.WAC.UniqueArguments.ClearFormats, + OSF.DDA.WAC.UniqueArguments.SetFormats, + OSF.DDA.WAC.UniqueArguments.SettingsRequest, + OSF.DDA.WAC.UniqueArguments.BindingEventSource + ]; + var dynamicTypes = {}; + OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); +}; + +OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.WAC.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor(), []); +OSF.OUtil.setNamespace("WAC", OSF.DDA); +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.getDelegateMethods = function OSF_DDA_WAC_getDelegateMethods() { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.WAC.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.WAC.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.WAC.Delegate.unregisterEventAsync; + return delegateMethods; +}; +OSF.DDA.WAC.Delegate.version = 1; +OSF.DDA.WAC.Delegate.executeAsync = function OSF_DDA_WAC_Delegate$executeAsync(args) { + if (!args.hostCallArgs) { + args.hostCallArgs = {}; + } + args.hostCallArgs["DdaMethod"] = { + "ControlId": OSF._OfficeAppFactory.getId(), + "Version": OSF.DDA.WAC.Delegate.version, + "DispatchId": args.dispId + }; + + args.hostCallArgs["__timeout__"] = -1; + + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.getClientEndPoint().invoke("executeMethod", function OSF_DDA_WAC_Delegate$OMFacade$OnResponse(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var error; + if (xdmStatus == Microsoft.Office.Common.InvokeResultCode.noError) { + OSF.DDA.WAC.Delegate.version = payload["Version"]; + error = payload["Error"]; + } else { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + error = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + error = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(error, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, null, Math.abs((new Date()).getTime() - startTime), error); + } + }, args.hostCallArgs); +}; +OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent = function OSF_DDA_WAC_Delegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_WAC_Delegate$OnAfterRegisterEvent(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var status; + if (xdmStatus != Microsoft.Office.Common.InvokeResultCode.noError) { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } else { + if (payload) { + if (payload["Error"]) { + status = payload["Error"]; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.WAC.Delegate.registerEventAsync = function OSF_DDA_WAC_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), function OSF_DDA_WACOMFacade$OnEvent(payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.DDA.WAC.Delegate.unregisterEventAsync = function OSF_DDA_WAC_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.OUtil.setNamespace("WebApp", OSF); + +OSF.WebApp.AddHostInfoAndXdmInfo = function OSF_WebApp$AddHostInfoAndXdmInfo(url) { + if (OSF._OfficeAppFactory.getWindowLocationSearch && OSF._OfficeAppFactory.getWindowLocationHash) { + return url + OSF._OfficeAppFactory.getWindowLocationSearch() + OSF._OfficeAppFactory.getWindowLocationHash(); + } else { + return url; + } +}; + +OSF.WebApp._UpdateLinksForHostAndXdmInfo = function OSF_WebApp$_UpdateLinksForHostAndXdmInfo() { + var links = document.querySelectorAll("a[data-officejs-navigate]"); + for (var i = 0; i < links.length; i++) { + if (OSF.WebApp._isGoodUrl(links[i].href)) { + links[i].href = OSF.WebApp.AddHostInfoAndXdmInfo(links[i].href); + } + } + + var forms = document.querySelectorAll("form[data-officejs-navigate]"); + for (var i = 0; i < forms.length; i++) { + var form = forms[i]; + if (OSF.WebApp._isGoodUrl(form.action)) { + form.action = OSF.WebApp.AddHostInfoAndXdmInfo(form.action); + } + } +}; + +OSF.WebApp._isGoodUrl = function OSF_WebApp$_isGoodUrl(url) { + if (typeof url == 'undefined') + return false; + url = url.trim(); + var colonIndex = url.indexOf(':'); + var protocol = colonIndex > 0 ? url.substr(0, colonIndex) : null; + + var goodUrl = protocol !== null ? protocol.toLowerCase() === "http" || protocol.toLowerCase() === "https" : true; + + goodUrl = goodUrl && url != "#" && url != "/" && url != "" && url != OSF._OfficeAppFactory.getWebAppState().webAppUrl; + return goodUrl; +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) { + var settings; + var serializedSettings = appContext.get_settings(); + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = typeof (JSON) !== "undefined" ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = typeof (JSON) !== "undefined" ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; + }; + + var windowOpen = function OSF_InitializationHelper$windowOpen(windowObj) { + var proxy = window.open; + windowObj.open = function (strUrl, strWindowName, strWindowFeatures) { + var windowObject = null; + try { + windowObject = proxy(strUrl, strWindowName, strWindowFeatures); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen." + ex); + } + } + if (!windowObject) { + var params = { + "strUrl": strUrl, + "strWindowName": strWindowName, + "strWindowFeatures": strWindowFeatures + }; + OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost", null, params); + } + return windowObject; + }; + }; + windowOpen(window); +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var getInvocationCallbackWebApp = function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) { + var settings; + if (appContext._appName === OSF.AppName.ExcelWebApp) { + var serializedSettings = appContext._settings; + settings = {}; + for (var index in serializedSettings) { + var setting = serializedSettings[index]; + settings[setting[0]] = setting[1]; + } + } else { + settings = appContext._settings; + } + if (errorCode === 0 && appContext._id != undefined && appContext._appName != undefined && appContext._appVersion != undefined && appContext._appUILocale != undefined && appContext._dataLocale != undefined && appContext._docUrl != undefined && appContext._clientMode != undefined && appContext._settings != undefined && appContext._reason != undefined) { + var appInstanceId = appContext._id; + + var touchEnabled = false; + + var commerceAllowed = true; + var minorVersion = 0; + if (appContext._minorVersion != undefined) { + minorVersion = appContext._minorVersion; + } + var requirementMatrix = undefined; + if (appContext._requirementMatrix != undefined) { + requirementMatrix = appContext._requirementMatrix; + } + var returnedContext = new OSF.OfficeAppContext(appContext._id, appContext._appName, appContext._appVersion, appContext._appUILocale, appContext._dataLocale, appContext._docUrl, appContext._clientMode, settings, appContext._reason, appContext._osfControlType, appContext._eToken, appContext._correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + } else { + var errorMsg = "Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is " + errorCode + ", exception: " + appContext; + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException(errorMsg); + } + throw errorMsg; + } + }; + try { + this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync", getInvocationCallbackWebApp, this._webAppState.id); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:[" + ex + "]"); + } + throw ex; + } +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { + try { + var me = this; + var xdmInfoValue = OSF.OUtil.parseXdmInfoWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + if (xdmInfoValue) { + var xdmItems = OSF.OUtil.getInfoItems(xdmInfoValue); + if (xdmItems != undefined && xdmItems.length >= 3) { + me._webAppState.conversationID = xdmItems[0]; + me._webAppState.id = xdmItems[1]; + me._webAppState.webAppUrl = xdmItems[2]; + } + } + me._webAppState.serializerVersion = OSF.OUtil.parseSerializerVersionWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + me._webAppState.clientEndPoint = Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID, me._webAppState.wnd, me._webAppState.webAppUrl, me._webAppState.serializerVersion); + me._webAppState.serviceEndPoint = Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id); + var notificationConversationId = me._webAppState.conversationID + OSF.SharedConstants.NotificationConversationIdSuffix; + me._webAppState.serviceEndPoint.registerConversation(notificationConversationId, me._webAppState.webAppUrl); + var focusFirstItem = function OSF_OfficeAppFactory_initialize$focusFirstItem() { + if (!me._webAppState.focused) { + me._webAppState.focused = true; + var list = document.querySelectorAll('input,a,button'); + for (var i = 0; i < list.length; i++) { + var node = list[i]; + if (node instanceof HTMLElement) { + var element = node; + element.focus(); + break; + } + } + } + }; + var notifyAgave = function OSF__OfficeAppFactory_initialize$notifyAgave(actionId) { + switch (actionId) { + case OSF.AgaveHostAction.Select: + me._webAppState.focused = true; + break; + case OSF.AgaveHostAction.UnSelect: + me._webAppState.focused = false; + break; + case OSF.AgaveHostAction.CtrlF6In: + focusFirstItem(); + default: + OsfMsAjaxFactory.msAjaxDebug.trace("actionId " + actionId + " notifyAgave is wrong."); + break; + } + }; + me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave", notifyAgave, Microsoft.Office.Common.InvokeType.async, false); + OSF.OUtil.addEventListener(window, "focus", function () { + if (!me._webAppState.focused) { + me._webAppState.focused = true; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.Select]); + }); + OSF.OUtil.addEventListener(window, "blur", function () { + if (me._webAppState.focused) { + me._webAppState.focused = false; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.UnSelect]); + }); + + OSF.OUtil.addEventListener(window, "keydown", function (e) { + if (e.keyCode == 117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + var actionId = OSF.AgaveHostAction.CtrlF6Exit; + if (e.shiftKey) { + actionId = OSF.AgaveHostAction.CtrlF6ExitShift; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, actionId]); + } + }); + + OSF.OUtil.addEventListener(window, "keypress", function (e) { + if (e.keyCode == 117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + } + }); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:[" + ex + "]"); + } + throw ex; + } +}; +OSF.getClientEndPoint = function OSF$getClientEndPoint() { + var initializationHelper = OSF._OfficeAppFactory.getInitializationHelper(); + return initializationHelper._webAppState.clientEndPoint; +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { SlideRange: "slideRange" }); + +OSF.DDA.SlideProperties = { + Id: 0, + Title: 1, + Index: 2 +}; +OSF.DDA.Slide = function OSF_DDA_Slide(id, title, index) { + OSF.OUtil.defineEnumerableProperties(this, { + "id": { + value: id + }, + "title": { + value: title + }, + "index": { + value: index + } + }); +}; +OSF.DDA.SlideRange = function OSF_DDA_SlideRange(slides) { + OSF.OUtil.defineEnumerableProperties(this, { + "slides": { + value: slides + } + }); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureSlideRange = function OSF_DDA_OMFactory$manufactureSlideRange(input) { + var items = null; + if (JSON) { + items = JSON.parse(input); + } else { + items = Sys.Serialization.JavaScriptSerializer.deserialize(input); + } + if (items == null) { + return null; + } + var numField = 0; + for (var key in OSF.DDA.SlideProperties) { + if (OSF.DDA.SlideProperties.hasOwnProperty(key)) { + numField++; + } + } + var slides = []; + var dataValid = true; + for (var i = 0; i < items.length && dataValid; i++) { + dataValid = false; + if (items[i].length == numField) { + var id = parseInt(items[i][OSF.DDA.SlideProperties.Id]); + var title = items[i][OSF.DDA.SlideProperties.Title]; + var index = parseInt(items[i][OSF.DDA.SlideProperties.Index]); + if (!isNaN(id) && !isNaN(index)) { + dataValid = true; + slides.push(new OSF.DDA.Slide(id, title, index)); + } + } + } + if (!dataValid) { + return null; + } + return new OSF.DDA.SlideRange(slides); +}; + +Microsoft.Office.WebExtension.BindingType = { + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties = { + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise = function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id = bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t = typeof onError; + if (t != "undefined" && t != "function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback = onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype = { + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me = this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status == Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade = function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches = []; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding = function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding = function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et = Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches = docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id] = new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch = bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId = function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_" + OSF.OUtil.getUniqueId() + "_" + new Date().getTime(); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding = function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id = bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows = bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols = bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders = bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding = new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding = new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp = function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject = OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject = OSF.DDA.TableBinding; + } + binding = new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding = new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id = callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties = { + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding = function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.GetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: "ValueFormat" }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: "FilterType" }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" }, + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" } + ] +}); +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.BindingRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: "ItemName" }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: "BindingType" }, + { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: "PromptText" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.SampleData, value: "SampleData" }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: "FailOnCollision" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 2 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 3 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 1 } + ], + invertible: true +}); +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: "Name" }, + { name: OSF.DDA.BindingProperties.Type, value: "BindingType" }, + { name: OSF.DDA.BindingProperties.RowCount, value: "RowCount" }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: "ColCount" }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: "HasHeaders" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddRowsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddColumnsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.Subset, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" }, + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { ActiveViewChangedEvent: "ActiveViewChangedEvent" }); +Microsoft.Office.WebExtension.ActiveView = { + Read: "read", + Edit: "edit" +}; +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + ActiveViewChanged: "activeViewChanged" +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetActiveViewAsync: "getActiveViewAsync" +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + var data = response[Microsoft.Office.WebExtension.Parameters.ActiveView]; + return data == undefined ? null : data; + } +}); +OSF.DDA.ActiveViewChangedEventArgs = function OSF_DDA_ActiveViewChangedEventArgs(activeView) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ActiveViewChanged + }, + "activeView": { + value: activeView.activeView + } + }); +}; +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: Microsoft.Office.WebExtension.Parameters.Data } + ] +}); + +Microsoft.Office.WebExtension.GoToType = { + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode = { + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index = { + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +OSF.DDA.Marshaling.NavigationKeys = { + NavigationRequest: "DdaGoToByIdMethod", + Id: "Id", + GoToType: "GoToType", + SelectionMode: "SelectionMode" +}; + +var OSF_DDA_Marshaling_GoToType; +(function (OSF_DDA_Marshaling_GoToType) { + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Binding"] = 0] = "Binding"; + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["NamedItem"] = 1] = "NamedItem"; + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Slide"] = 2] = "Slide"; + OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Index"] = 3] = "Index"; +})(OSF_DDA_Marshaling_GoToType || (OSF_DDA_Marshaling_GoToType = {})); +; +OSF.DDA.Marshaling.GoToType = OSF_DDA_Marshaling_GoToType; + +var OSF_DDA_Marshaling_SelectionMode; +(function (OSF_DDA_Marshaling_SelectionMode) { + OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Default"] = 0] = "Default"; + OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Selected"] = 1] = "Selected"; + OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["None"] = 2] = "None"; +})(OSF_DDA_Marshaling_SelectionMode || (OSF_DDA_Marshaling_SelectionMode = {})); +; +OSF.DDA.Marshaling.SelectionMode = OSF_DDA_Marshaling_SelectionMode; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.Marshaling.NavigationKeys.NavigationRequest); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.NavigationKeys.Id }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: OSF.DDA.Marshaling.NavigationKeys.GoToType }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: OSF.DDA.Marshaling.NavigationKeys.SelectionMode } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: OSF.DDA.Marshaling.GoToType.Binding }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: OSF.DDA.Marshaling.GoToType.NamedItem }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: OSF.DDA.Marshaling.GoToType.Slide }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: OSF.DDA.Marshaling.GoToType.Index } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: OSF.DDA.Marshaling.SelectionMode.Default }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: OSF.DDA.Marshaling.SelectionMode.Selected }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: OSF.DDA.Marshaling.SelectionMode.None } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.FilePropertiesDescriptor = { + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties = function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +var OSF_DDA_Marshaling_FilePropertiesKeys; +(function (OSF_DDA_Marshaling_FilePropertiesKeys) { + OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Properties"] = 0] = "Properties"; + + OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Url"] = 1] = "Url"; +})(OSF_DDA_Marshaling_FilePropertiesKeys || (OSF_DDA_Marshaling_FilePropertiesKeys = {})); +; +OSF.DDA.Marshaling.FilePropertiesKeys = OSF_DDA_Marshaling_FilePropertiesKeys; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: OSF.DDA.Marshaling.FilePropertiesKeys.Url } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.Marshaling.FilePropertiesKeys.Properties } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetOfficeThemeAsync: "getOfficeThemeAsync", + GetDocumentThemeAsync: "getDocumentThemeAsync" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + OfficeThemeChanged: "officeThemeChanged", + DocumentThemeChanged: "documentThemeChanged" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.Parameters, { + DocumentTheme: "documentTheme", + OfficeTheme: "officeTheme" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { + DocumentThemeChangedEvent: "DocumentThemeChangedEvent", + OfficeThemeChangedEvent: "OfficeThemeChangedEvent" +}); +OSF.OUtil.setNamespace("Theming", OSF.DDA); +OSF.DDA.Theming.OfficeThemeEnum = { + PrimaryFontColor: "primaryFontColor", + PrimaryBackgroundColor: "primaryBackgroundColor", + SecondaryFontColor: "secondaryFontColor", + SecondaryBackgroundColor: "secondaryBackgroundColor" +}; +OSF.DDA.Theming.DocumentThemeEnum = { + PrimaryFontColor: "primaryFontColor", + PrimaryBackgroundColor: "primaryBackgroundColor", + SecondaryFontColor: "secondaryFontColor", + SecondaryBackgroundColor: "secondaryBackgroundColor", + Accent1: "accent1", + Accent2: "accent2", + Accent3: "accent3", + Accent4: "accent4", + Accent5: "accent5", + Accent6: "accent6", + Hyperlink: "hyperlink", + FollowedHyperlink: "followedHyperlink", + HeaderLatinFont: "headerLatinFont", + HeaderEastAsianFont: "headerEastAsianFont", + HeaderScriptFont: "headerScriptFont", + HeaderLocalizedFont: "headerLocalizedFont", + BodyLatinFont: "bodyLatinFont", + BodyEastAsianFont: "bodyEastAsianFont", + BodyScriptFont: "bodyScriptFont", + BodyLocalizedFont: "bodyLocalizedFont" +}; +OSF.DDA.Theming.ConvertToDocumentTheme = function OSF_DDA_Theming_ConvertToDocumentTheme(response) { + var mappingDocumentTheme = [ + { name: "primaryFontColor", needToConvertToHex: true }, + { name: "primaryBackgroundColor", needToConvertToHex: true }, + { name: "secondaryFontColor", needToConvertToHex: true }, + { name: "secondaryBackgroundColor", needToConvertToHex: true }, + { name: "accent1", needToConvertToHex: true }, + { name: "accent2", needToConvertToHex: true }, + { name: "accent3", needToConvertToHex: true }, + { name: "accent4", needToConvertToHex: true }, + { name: "accent5", needToConvertToHex: true }, + { name: "accent6", needToConvertToHex: true }, + { name: "hyperlink", needToConvertToHex: true }, + { name: "followedHyperlink", needToConvertToHex: true }, + { name: "headerLatinFont", needToConvertToHex: false }, + { name: "headerEastAsianFont", needToConvertToHex: false }, + { name: "headerScriptFont", needToConvertToHex: false }, + { name: "headerLocalizedFont", needToConvertToHex: false }, + { name: "bodyLatinFont", needToConvertToHex: false }, + { name: "bodyEastAsianFont", needToConvertToHex: false }, + { name: "bodyScriptFont", needToConvertToHex: false }, + { name: "bodyLocalizedFont", needToConvertToHex: false } + ]; + var result = {}; + for (var i = 0; i < mappingDocumentTheme.length; i++) { + if (mappingDocumentTheme[i].needToConvertToHex) { + result[mappingDocumentTheme[i].name] = OSF.OUtil.convertIntToCssHexColor(response[mappingDocumentTheme[i].name]); + } else { + result[mappingDocumentTheme[i].name] = response[mappingDocumentTheme[i].name]; + } + } + return result; +}; +OSF.DDA.Theming.ConvertToOfficeTheme = function OSF_DDA_Theming_ConvertToOfficeTheme(response) { + var result = {}; + for (var key in response) { + result[key] = OSF.OUtil.convertIntToCssHexColor(response[key]); + } + return result; +}; +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: OSF.DDA.Theming.ConvertToDocumentTheme +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: OSF.DDA.Theming.ConvertToOfficeTheme +}); +OSF.DDA.Theming.OfficeThemeChangedEventArgs = function OSF_DDA_Theming_OfficeThemeChangedEventArgs(officeTheme) { + var ret = OSF.DDA.Theming.ConvertToOfficeTheme(officeTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.OfficeThemeChanged + }, + "officeTheme": { + value: ret + } + }); +}; +OSF.DDA.Theming.DocumentThemeChangedEventArgs = function OSF_DDA_Theming_DocumentThemeChangedEventArgs(documentTheme) { + var ret = OSF.DDA.Theming.ConvertToDocumentTheme(documentTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentThemeChanged + }, + "documentTheme": { + value: ret + } + }); +}; +var OSF_DDA_Theming_InternalThemeHandler = (function () { + function OSF_DDA_Theming_InternalThemeHandler() { + this._pseudoDocumentObject = null; + this._previousDocumentThemeData = null; + this._previousOfficeThemeData = null; + this._officeCss = null; + this._asyncCallsCompleted = null; + this._onAsyncCallsCompleted = null; + } + OSF_DDA_Theming_InternalThemeHandler.prototype.InitializeAndChangeOnce = function (callback) { + this._officeCss = this._getOfficeThemesCss(); + if (!this._officeCss) { + if (callback) { + callback(); + } + return; + } + this._onAsyncCallsCompleted = callback; + this._pseudoDocumentObject = {}; + var pseudoDoc = this._pseudoDocumentObject; + OSF.DDA.DispIdHost.addAsyncMethods(pseudoDoc, [ + OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(pseudoDoc, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.OfficeThemeChanged, + Microsoft.Office.WebExtension.EventType.DocumentThemeChanged + ])); + this._asyncCallsCompleted = {}; + this._asyncCallsCompleted[OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync] = false; + this._asyncCallsCompleted[OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync] = false; + this._getAndProcessThemeData(pseudoDoc.getDocumentThemeAsync, Function.createDelegate(this, this._processDocumentThemeData), OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync); + this._getAndProcessThemeData(pseudoDoc.getOfficeThemeAsync, Function.createDelegate(this, this._processOfficeThemeData), OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._getOfficeThemesCss = function () { + function getOfficeThemesCssInternal() { + var cssFileName = "officethemes.css"; + for (var i = 0; i < document.styleSheets.length; i++) { + var ss = document.styleSheets[i]; + if (!ss.disabled && ss.href && cssFileName == ss.href.substring(ss.href.length - cssFileName.length, ss.href.length).toLowerCase()) { + if ((!ss.cssRules) && (!ss.rules)) { + return null; + } else { + return ss; + } + } + } + } + + try { + return getOfficeThemesCssInternal(); + } catch (e) { + return null; + } + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeCss = function (officeCss, selector, newRule) { + var length = officeCss.cssRules ? officeCss.cssRules.length : officeCss.rules.length; + for (var i = 0; i < length; i++) { + var rule; + if (officeCss.cssRules) { + rule = officeCss.cssRules[i]; + } else { + rule = officeCss.rules[i]; + } + var ruleSelector = rule.selectorText; + if (ruleSelector !== "" && ruleSelector.toLowerCase() == selector.toLowerCase()) { + if (officeCss.cssRules) { + officeCss.deleteRule(i); + officeCss.insertRule(ruleSelector + newRule, i); + } else { + officeCss.removeRule(i); + officeCss.addRule(ruleSelector, newRule, i); + } + } + } + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeDocumentThemeData = function (data) { + var documentThemeCssMapping = [ + { name: "primaryFontColor", cssSelector: ".office-docTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-docTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-docTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-docTheme-secondary-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-color", cssProperty: "color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-color", cssProperty: "color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-color", cssProperty: "color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-color", cssProperty: "color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-color", cssProperty: "color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-color", cssProperty: "color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-bgColor", cssProperty: "background-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-bgColor", cssProperty: "background-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-bgColor", cssProperty: "background-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-bgColor", cssProperty: "background-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-bgColor", cssProperty: "background-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-borderColor", cssProperty: "border-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-borderColor", cssProperty: "border-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-borderColor", cssProperty: "border-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-borderColor", cssProperty: "border-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-borderColor", cssProperty: "border-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-borderColor", cssProperty: "border-color" }, + { name: "hyperlink", cssSelector: ".office-a", cssProperty: "color" }, + { name: "followedHyperlink", cssSelector: ".office-a:visited", cssProperty: "color" }, + { name: "headerLatinFont", cssSelector: ".office-headerFont-latin", cssProperty: "font-family" }, + { name: "headerEastAsianFont", cssSelector: ".office-headerFont-eastAsian", cssProperty: "font-family" }, + { name: "headerScriptFont", cssSelector: ".office-headerFont-script", cssProperty: "font-family" }, + { name: "headerLocalizedFont", cssSelector: ".office-headerFont-localized", cssProperty: "font-family" }, + { name: "bodyLatinFont", cssSelector: ".office-bodyFont-latin", cssProperty: "font-family" }, + { name: "bodyEastAsianFont", cssSelector: ".office-bodyFont-eastAsian", cssProperty: "font-family" }, + { name: "bodyScriptFont", cssSelector: ".office-bodyFont-script", cssProperty: "font-family" }, + { name: "bodyLocalizedFont", cssSelector: ".office-bodyFont-localized", cssProperty: "font-family" } + ]; + var realData = data.type == "documentThemeChanged" ? data.documentTheme : data; + for (var i = 0; i < documentThemeCssMapping.length; i++) { + if (this._previousDocumentThemeData === null || this._previousDocumentThemeData[documentThemeCssMapping[i].name] != realData[documentThemeCssMapping[i].name]) { + if (realData[documentThemeCssMapping[i].name] != null && realData[documentThemeCssMapping[i].name] != "") { + var insertableText = realData[documentThemeCssMapping[i].name]; + + if (documentThemeCssMapping[i].cssProperty === "font-family") { + insertableText = '"' + insertableText.replace(/"/g, '\\"') + '"'; + } + this._changeCss(this._officeCss, documentThemeCssMapping[i].cssSelector, "{" + documentThemeCssMapping[i].cssProperty + ":" + insertableText + ";}"); + } else { + this._changeCss(this._officeCss, documentThemeCssMapping[i].cssSelector, "{}"); + } + } + } + this._previousDocumentThemeData = realData; + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeOfficeThemeData = function (data) { + var officeThemeCssMapping = [ + { name: "primaryFontColor", cssSelector: ".office-officeTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-officeTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-officeTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-officeTheme-secondary-bgColor", cssProperty: "background-color" } + ]; + var realData = data.type == "officeThemeChanged" ? data.officeTheme : data; + for (var i = 0; i < officeThemeCssMapping.length; i++) { + if (this._previousOfficeThemeData === null || this._previousOfficeThemeData[officeThemeCssMapping[i].name] != realData[officeThemeCssMapping[i].name]) { + if (realData[officeThemeCssMapping[i].name] !== undefined) { + this._changeCss(this._officeCss, officeThemeCssMapping[i].cssSelector, "{" + officeThemeCssMapping[i].cssProperty + ":" + realData[officeThemeCssMapping[i].name] + ";}"); + } + } + } + this._previousOfficeThemeData = realData; + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._getAndProcessThemeData = function (getThemeMethod, processResultCallback, getThemeMethodIdentifier) { + getThemeMethod(Function.createDelegate(this, function (asyncResult) { + if (asyncResult.status == "succeeded") { + var data = asyncResult.value; + processResultCallback(data); + } + if (this._areAllCallsCompleted(getThemeMethodIdentifier) && this._onAsyncCallsCompleted) { + this._onAsyncCallsCompleted(); + this._onAsyncCallsCompleted = null; + } + })); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._processOfficeThemeData = function (data) { + this._changeOfficeThemeData(data); + this._pseudoDocumentObject.addHandlerAsync(Microsoft.Office.WebExtension.EventType.OfficeThemeChanged, Function.createDelegate(this, this._changeOfficeThemeData), null); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._processDocumentThemeData = function (data) { + this._changeDocumentThemeData(data); + this._pseudoDocumentObject.addHandlerAsync(Microsoft.Office.WebExtension.EventType.DocumentThemeChanged, Function.createDelegate(this, this._changeDocumentThemeData), null); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._areAllCallsCompleted = function (completedCall) { + var asyncCallsCompleted; + + if (!(asyncCallsCompleted = this._asyncCallsCompleted)) { + return true; + } + if (completedCall && asyncCallsCompleted.hasOwnProperty(completedCall)) { + asyncCallsCompleted[completedCall] = true; + } + for (var call in asyncCallsCompleted) { + if (asyncCallsCompleted.hasOwnProperty(call) && asyncCallsCompleted[call]) { + continue; + } + return false; + } + return true; + }; + return OSF_DDA_Theming_InternalThemeHandler; +})(); +OSF.DDA.Theming.InternalThemeHandler = OSF_DDA_Theming_InternalThemeHandler; +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +var OSF_DDA_Marshaling_ThemingKeys; +(function (OSF_DDA_Marshaling_ThemingKeys) { + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["DocumentTheme"] = 0] = "DocumentTheme"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["OfficeTheme"] = 1] = "OfficeTheme"; + + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Background1"] = 2] = "Background1"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Text1"] = 3] = "Text1"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Background2"] = 4] = "Background2"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Text2"] = 5] = "Text2"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Accent1"] = 6] = "Accent1"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Accent2"] = 7] = "Accent2"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Accent3"] = 8] = "Accent3"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Accent4"] = 9] = "Accent4"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Accent5"] = 10] = "Accent5"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Accent6"] = 11] = "Accent6"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["Hyperlink"] = 12] = "Hyperlink"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["FollowedHyperlink"] = 13] = "FollowedHyperlink"; + + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["HdLatin"] = 14] = "HdLatin"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["HdEastAsian"] = 15] = "HdEastAsian"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["HdScript"] = 16] = "HdScript"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["HdLocalized"] = 17] = "HdLocalized"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["BdLatin"] = 18] = "BdLatin"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["BdEastAsian"] = 19] = "BdEastAsian"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["BdScript"] = 20] = "BdScript"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["BdLocalized"] = 21] = "BdLocalized"; + + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["BackgroundColor"] = 22] = "BackgroundColor"; + + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["PrimaryText"] = 23] = "PrimaryText"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["PrimaryBackground"] = 24] = "PrimaryBackground"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["SecondaryText"] = 25] = "SecondaryText"; + OSF_DDA_Marshaling_ThemingKeys[OSF_DDA_Marshaling_ThemingKeys["SecondaryBackground"] = 26] = "SecondaryBackground"; +})(OSF_DDA_Marshaling_ThemingKeys || (OSF_DDA_Marshaling_ThemingKeys = {})); +; +OSF.DDA.Marshaling.ThemingKeys = OSF_DDA_Marshaling_ThemingKeys; +var parameterMap = OSF.DDA.WAC.Delegate.ParameterMap; +var hostKeys = OSF.DDA.Marshaling.ThemingKeys; +parameterMap.addComplexType(Microsoft.Office.WebExtension.Parameters.DocumentTheme); +parameterMap.addComplexType(Microsoft.Office.WebExtension.Parameters.OfficeTheme); +parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.DocumentTheme, value: hostKeys.DocumentTheme } + ] +}); +parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OfficeTheme, value: hostKeys.OfficeTheme } + ] +}); +var destKeys = OSF.DDA.Theming.DocumentThemeEnum; +parameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.DocumentTheme, + fromHost: [ + { name: destKeys.PrimaryBackgroundColor, value: hostKeys.Background1 }, + { name: destKeys.PrimaryFontColor, value: hostKeys.Text1 }, + { name: destKeys.SecondaryBackgroundColor, value: hostKeys.Background2 }, + { name: destKeys.SecondaryFontColor, value: hostKeys.Text2 }, + { name: destKeys.Accent1, value: hostKeys.Accent1 }, + { name: destKeys.Accent2, value: hostKeys.Accent2 }, + { name: destKeys.Accent3, value: hostKeys.Accent3 }, + { name: destKeys.Accent4, value: hostKeys.Accent4 }, + { name: destKeys.Accent5, value: hostKeys.Accent5 }, + { name: destKeys.Accent6, value: hostKeys.Accent6 }, + { name: destKeys.Hyperlink, value: hostKeys.Hyperlink }, + { name: destKeys.FollowedHyperlink, value: hostKeys.FollowedHyperlink }, + { name: destKeys.HeaderLatinFont, value: hostKeys.HdLatin }, + { name: destKeys.HeaderEastAsianFont, value: hostKeys.HdEastAsian }, + { name: destKeys.HeaderScriptFont, value: hostKeys.HdScript }, + { name: destKeys.HeaderLocalizedFont, value: hostKeys.HdLocalized }, + { name: destKeys.BodyLatinFont, value: hostKeys.BdLatin }, + { name: destKeys.BodyEastAsianFont, value: hostKeys.BdEastAsian }, + { name: destKeys.BodyScriptFont, value: hostKeys.BdScript }, + { name: destKeys.BodyLocalizedFont, value: hostKeys.BdLocalized } + ] +}); +destKeys = OSF.DDA.Theming.OfficeThemeEnum; +parameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.OfficeTheme, + fromHost: [ + { name: destKeys.PrimaryFontColor, value: hostKeys.PrimaryText }, + { name: destKeys.PrimaryBackgroundColor, value: hostKeys.PrimaryBackground }, + { name: destKeys.SecondaryFontColor, value: hostKeys.SecondaryText }, + { name: destKeys.SecondaryBackgroundColor, value: hostKeys.SecondaryBackground } + ] +}); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); +OSF.DDA.WAC.SettingsTranslator = (function () { + var keyIndex = 0; + var valueIndex = 1; + return { + read: function OSF_DDA_WAC_SettingsTranslator$read(payload) { + if (payload.Settings) { + var serializedSettings = {}; + var settingsPayload = payload.Settings; + for (var index in settingsPayload) { + var setting = settingsPayload[index]; + serializedSettings[setting[keyIndex]] = setting[valueIndex]; + } + return serializedSettings; + } else if (typeof window["OSFPPTWAC"] != "undefined") { + return payload; + } else { + var serializedSettings = {}; + return serializedSettings; + } + }, + write: function OSF_DDA_WAC_SettingsTranslator$write(serializedSettings) { + var settingsPayload = []; + for (var key in serializedSettings) { + var setting = []; + setting[keyIndex] = key; + setting[valueIndex] = serializedSettings[key]; + settingsPayload.push(setting); + } + return settingsPayload; + } + }; +})(); +OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings, { + toHost: OSF.DDA.WAC.SettingsTranslator.write, + fromHost: OSF.DDA.WAC.SettingsTranslator.read +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SettingsRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: "OverwriteIfStale" }, + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ], + invertible: true +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SettingsRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); +var OSFPPTWAC; +(function (OSFPPTWAC) { + var PowerPointDocument = (function () { + function PowerPointDocument(officeAppContext, settings) { + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.ActiveViewChanged])); + OSF.DDA.PowerPointDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.GoToByIdAsync, + OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync + ]); + OSF.OUtil.finalizeProperties(this); + } + return PowerPointDocument; + })(); + OSFPPTWAC.PowerPointDocument = PowerPointDocument; +})(OSFPPTWAC || (OSFPPTWAC = {})); +OSF.DDA.PowerPointDocument = OSFPPTWAC.PowerPointDocument; + +OSF.OUtil.extend(OSF.DDA.PowerPointDocument, OSF.DDA.Document); + +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.GoToType, { + Slide: "slide", + Index: "index" +}); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.PowerPointDocument(appContext, this._initializeSettings(appContext, true)); + appReady(); +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + OSF.WebApp._UpdateLinksForHostAndXdmInfo(); + var license = new OSF.DDA.License(appContext.get_eToken()); + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license)); + var getActivationCompletedStatusCallback; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.WAC.getDelegateMethods, OSF.DDA.WAC.Delegate.ParameterMap)); + getActivationCompletedStatusCallback = function (invokeResultCode, status) { + if (invokeResultCode == 0 && status != true) { + OSF.getClientEndPoint().registerForEvent("activationCompleted", function () { + var reason = appContext.get_reason(); + Microsoft.Office.WebExtension.initialize(reason); + }, null, { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": OSF.DDA.EventDispId.dispidActivationStatusChangedEvent, + "targetId": "" + }); + } else { + var reason = appContext.get_reason(); + Microsoft.Office.WebExtension.initialize(reason); + } + }; + OSF.getClientEndPoint().invoke("getActivationCompletedStatus", getActivationCompletedStatusCallback, this._webAppState.id); + var themeHandler = new OSF.DDA.Theming.InternalThemeHandler(); + themeHandler.InitializeAndChangeOnce(); +}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-web-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-web-16.00.js new file mode 100644 index 000000000..4b9abbb26 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-web-16.00.js @@ -0,0 +1,11 @@ +/* PowerPointer web application specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b=1)return true;b=a.deserialize;a.deserialize=function(a){return i(a,true,b)};a.__patchVersion=1;return true}!c()&&k(a,"load",function(){c()})})(window);Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5};Microsoft.Office.Common.InvokeResultCode={noError:0,errorInRequest:-1,errorHandlingRequest:-2,errorInResponse:-3,errorHandlingResponse:-4,errorHandlingRequestAccessDenied:-5,errorHandlingMethodCallTimedout:-6};Microsoft.Office.Common.MessageType={request:0,response:1};Microsoft.Office.Common.ActionType={invoke:0,registerEvent:1,unregisterEvent:2};Microsoft.Office.Common.ResponseType={forCalling:0,forEventing:1};Microsoft.Office.Common.MethodObject=function(c,b,a){this._method=c;this._invokeType=b;this._blockingOthers=a};Microsoft.Office.Common.MethodObject.prototype={getMethod:function(){return this._method},getInvokeType:function(){return this._invokeType},getBlockingFlag:function(){return this._blockingOthers}};Microsoft.Office.Common.EventMethodObject=function(b,a){this._registerMethodObject=b;this._unregisterMethodObject=a};Microsoft.Office.Common.EventMethodObject.prototype={getRegisterMethodObject:function(){return this._registerMethodObject},getUnregisterMethodObject:function(){return this._unregisterMethodObject}};Microsoft.Office.Common.ServiceEndPoint=function(c){var a=this,b=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:false}]);if(b)throw b;a._methodObjectList={};a._eventHandlerProxyList={};a._Id=c;a._conversations={};a._policyManager=null;a._appDomains={}};Microsoft.Office.Common.ServiceEndPoint.prototype={registerMethod:function(g,h,b,e){var c="invokeType",a=false,d=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:a},{name:"method",type:Function,mayBeNull:a},{name:c,type:Number,mayBeNull:a},{name:"blockingOthers",type:Boolean,mayBeNull:a}]);if(d)throw d;if(b!==Microsoft.Office.Common.InvokeType.async&&b!==Microsoft.Office.Common.InvokeType.sync)throw OsfMsAjaxFactory.msAjaxError.argument(c);var f=new Microsoft.Office.Common.MethodObject(h,b,e);this._methodObjectList[g]=f},unregisterMethod:function(b){var a=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:false}]);if(a)throw a;delete this._methodObjectList[b]},registerEvent:function(f,d,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a}]);if(b)throw b;var e=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(d,Microsoft.Office.Common.InvokeType.syncRegisterEvent,a),new Microsoft.Office.Common.MethodObject(c,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,a));this._methodObjectList[f]=e},registerEventEx:function(h,f,d,e,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"registerMethodInvokeType",type:Number,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a},{name:"unregisterMethodInvokeType",type:Number,mayBeNull:a}]);if(b)throw b;var g=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(f,d,a),new Microsoft.Office.Common.MethodObject(e,c,a));this._methodObjectList[h]=g},unregisterEvent:function(b){var a=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:false}]);if(a)throw a;this.unregisterMethod(b)},registerConversation:function(c,g,b,f){var d="appDomains",a=true,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false},{name:"conversationUrl",type:String,mayBeNull:false,optional:a},{name:d,type:Object,mayBeNull:a,optional:a},{name:"serializerVersion",type:Number,mayBeNull:a,optional:a}]);if(e)throw e;if(b){if(!(b instanceof Array))throw OsfMsAjaxFactory.msAjaxError.argument(d);this._appDomains[c]=b}this._conversations[c]={url:g,serializerVersion:f}},unregisterConversation:function(b){var a=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false}]);if(a)throw a;delete this._conversations[b]},setPolicyManager:function(a){var b="policyManager",c=Function._validateParams(arguments,[{name:b,type:Object,mayBeNull:false}]);if(c)throw c;if(!a.checkPermission)throw OsfMsAjaxFactory.msAjaxError.argument(b);this._policyManager=a},getPolicyManager:function(){return this._policyManager}};Microsoft.Office.Common.ClientEndPoint=function(f,c,g,b){var d="targetWindow",a=this,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false},{name:d,mayBeNull:false},{name:"targetUrl",type:String,mayBeNull:false},{name:"serializerVersion",type:Number,mayBeNull:true,optional:true}]);if(e)throw e;if(!c.postMessage)throw OsfMsAjaxFactory.msAjaxError.argument(d);a._conversationId=f;a._targetWindow=c;a._targetUrl=g;a._callingIndex=0;a._callbackList={};a._eventHandlerList={};if(b!=null)a._serializerVersion=b;else a._serializerVersion=OSF.SerializerVersion.MsAjax};Microsoft.Office.Common.ClientEndPoint.prototype={invoke:function(h,d,b){var a=this,g=Function._validateParams(arguments,[{name:"targetMethodName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"param",mayBeNull:true}]);if(g)throw g;var c=a._callingIndex++,k=new Date,e={callback:d,createdOn:k.getTime()};if(b&&typeof b==="object"&&typeof b.__timeout__==="number"){e.timeout=b.__timeout__;delete b.__timeout__}a._callbackList[c]=e;try{var i=new Microsoft.Office.Common.Request(h,Microsoft.Office.Common.ActionType.invoke,a._conversationId,c,b),j=Microsoft.Office.Common.MessagePackager.envelope(i,a._serializerVersion);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(f){try{d!==null&&d(Microsoft.Office.Common.InvokeResultCode.errorInRequest,f)}finally{delete a._callbackList[c]}}},registerForEvent:function(d,g,c,i){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"eventHandler",type:Function,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,k=new Date;a._callbackList[b]={callback:c,createdOn:k.getTime()};try{var h=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.registerEvent,a._conversationId,b,i),j=Microsoft.Office.Common.MessagePackager.envelope(h,a._serializerVersion);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();a._eventHandlerList[d]=g}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}},unregisterForEvent:function(d,c,h){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,j=new Date;a._callbackList[b]={callback:c,createdOn:j.getTime()};try{var g=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.unregisterEvent,a._conversationId,b,h),i=Microsoft.Office.Common.MessagePackager.envelope(g,a._serializerVersion);a._targetWindow.postMessage(i,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}finally{delete a._eventHandlerList[d]}}};Microsoft.Office.Common.XdmCommunicationManager=function(){var d=true,k="channel is not ready.",c="conversationId",j="Unknown conversation Id.",b=false,a=null,m=[],l=a,f=a,o=10,i=b,g=a,v=2e3,n=65000,q=n,h={},e={},s=b;function x(b){for(var a in h)if(h[a]._conversations[b])return h[a];OsfMsAjaxFactory.msAjaxDebug.trace(j);throw OsfMsAjaxFactory.msAjaxError.argument(c)}function y(b){var a=e[b];if(!a){OsfMsAjaxFactory.msAjaxDebug.trace(j);throw OsfMsAjaxFactory.msAjaxError.argument(c)}return a}function B(e,c){var b=e._methodObjectList[c._actionName];if(!b){OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+c._actionName);throw OsfMsAjaxFactory.msAjaxError.argument("messageObject")}var d=a;if(c._actionType===Microsoft.Office.Common.ActionType.invoke)d=b;else if(c._actionType===Microsoft.Office.Common.ActionType.registerEvent)d=b.getRegisterMethodObject();else d=b.getUnregisterMethodObject();return d}function E(a){m.push(a)}function D(){if(f!==a){if(!i)if(m.length>0){var b=m.shift();p(b)}else{clearInterval(f);f=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(k)}function p(a){i=a.getInvokeBlockingFlag();a.invoke();l=(new Date).getTime()}function A(){if(g){var c,f=0,j=new Date,d;for(var i in e){c=e[i];for(var h in c._callbackList){var b=c._callbackList[h];d=b.timeout?b.timeout:q;if(d>=0&&Math.abs(j.getTime()-b.createdOn)>=d)try{b.callback&&b.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,a)}finally{delete c._callbackList[h]}else f++}}if(f===0){clearInterval(g);g=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(k)}function z(){i=b}function C(a){if(window.addEventListener)window.addEventListener("message",a,b);else if(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent)window.attachEvent("onmessage",a);else{OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API.");throw OsfMsAjaxFactory.msAjaxError.argument("Browser")}}function r(e,f){var g=b;if(e===d)return d;if(!e||!f||!e.length||!f.length)return g;var c,a;c=document.createElement("a");a=document.createElement("a");c.href=e;a.href=f;g=u(c,a);delete c,a;return g}function w(a,g){var c=b;if(!g||!g.length||!a||!(a instanceof Array)||!a.length)return c;var f=document.createElement("a"),e=document.createElement("a");f.href=g;for(var d=0;do)&&!i){p(F);A=b}else f=setInterval(D,o);A&&E(F)}catch(k){var C=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;if(k==m)C=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied;var I=new Microsoft.Office.Common.Response(c._actionName,c._conversationId,c._correlationId,C,Microsoft.Office.Common.ResponseType.forCalling,k),H=Microsoft.Office.Common.MessagePackager.envelope(I,g);e.source&&e.source.postMessage&&e.source.postMessage(H,v)}}else if(c._messageType===Microsoft.Office.Common.MessageType.response){var j=y(c._conversationId);j._serializerVersion=g;if(!r(j._targetUrl,e.origin))throw"Failed orgin check";if(c._responseType===Microsoft.Office.Common.ResponseType.forCalling){var n=j._callbackList[c._correlationId];if(n)try{n.callback&&n.callback(c._errorCode,c._data)}finally{delete j._callbackList[c._correlationId]}}else{var s=j._eventHandlerList[c._actionName];s!==undefined&&s!==a&&s(c._data)}}else return}}function t(){if(!s){C(F);s=d}}return {connect:function(b,d,f,c){var a=e[b];if(!a){t();a=new Microsoft.Office.Common.ClientEndPoint(b,d,f,c);e[b]=a}return a},getClientEndPoint:function(d){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;return e[d]},createServiceEndPoint:function(a){t();var b=new Microsoft.Office.Common.ServiceEndPoint(a);h[a]=b;return b},getServiceEndPoint:function(c){var a=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:b}]);if(a)throw a;return h[c]},deleteClientEndPoint:function(d){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;delete e[d]},_setMethodTimeout:function(a){var c=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:b}]);if(c)throw c;q=a<=0?n:a},_startMethodTimeoutTimer:function(){if(!g)g=setInterval(A,v)}}}();Microsoft.Office.Common.Message=function(g,h,e,f,c){var b=false,a=this,d=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:b},{name:"actionName",type:String,mayBeNull:b},{name:"conversationId",type:String,mayBeNull:b},{name:"correlationId",mayBeNull:b},{name:"data",mayBeNull:true,optional:true}]);if(d)throw d;a._messageType=g;a._actionName=h;a._conversationId=e;a._correlationId=f;a._origin=window.location.href;if(typeof c=="undefined")a._data=null;else a._data=c};Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}};Microsoft.Office.Common.Request=function(c,d,a,b,e){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,c,a,b,e);this._actionType=d};OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message);Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType};Microsoft.Office.Common.Response=function(d,a,b,e,c,f){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,d,a,b,f);this._errorCode=e;this._responseType=c};OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message);Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode};Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType};Microsoft.Office.Common.MessagePackager={envelope:function(a,b){if(b==OSF.SerializerVersion.Browser&&typeof JSON!=="undefined"){if(typeof a==="object")a._serializerVersion=b;return JSON.stringify(a)}else{if(typeof a==="object")a._serializerVersion=OSF.SerializerVersion.MsAjax;return OsfMsAjaxFactory.msAjaxSerializer.serialize(a)}},unenvelope:function(a,b){if(b==OSF.SerializerVersion.Browser&&typeof JSON!=="undefined")return JSON.parse(a);else return OsfMsAjaxFactory.msAjaxSerializer.deserialize(a,true)}};Microsoft.Office.Common.ResponseSender=function(f,i,k,g,h,j,e){var c=false,a=this,d=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:c},{name:"requesterUrl",type:String,mayBeNull:c},{name:"actionName",type:String,mayBeNull:c},{name:"conversationId",type:String,mayBeNull:c},{name:"correlationId",mayBeNull:c},{name:"responsetype",type:Number,maybeNull:c},{name:"serializerVersion",type:Number,maybeNull:true,optional:true}]);if(d)throw d;a._requesterWindow=f;a._requesterUrl=i;a._actionName=k;a._conversationId=g;a._correlationId=h;a._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;a._responseType=j;var b=a;a._send=function(f){try{var d=new Microsoft.Office.Common.Response(b._actionName,b._conversationId,b._correlationId,b._invokeResultCode,b._responseType,f),c=Microsoft.Office.Common.MessagePackager.envelope(d,e);b._requesterWindow.postMessage(c,b._requesterUrl)}catch(a){OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+a.message)}}};Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(a){this._invokeResultCode=a}};Microsoft.Office.Common.InvokeCompleteCallback=function(e,h,i,f,g,d,c){var b=this;Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(b,e,h,i,f,g,Microsoft.Office.Common.ResponseType.forCalling,c);b._postCallbackHandler=d;var a=b;b._send=function(f){try{var e=new Microsoft.Office.Common.Response(a._actionName,a._conversationId,a._correlationId,a._invokeResultCode,a._responseType,f),d=Microsoft.Office.Common.MessagePackager.envelope(e,c);a._requesterWindow.postMessage(d,a._requesterUrl);a._postCallbackHandler()}catch(b){OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+b.message)}}};OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender);Microsoft.Office.Common.Invoker=function(i,j,e,f,h,k,g){var c=true,b=false,a=this,d=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:b},{name:"paramValue",mayBeNull:c},{name:"invokeCompleteCallback",mayBeNull:b},{name:"eventHandlerProxyList",mayBeNull:c},{name:"conversationId",type:String,mayBeNull:b},{name:"eventName",type:String,mayBeNull:b},{name:"serializerVersion",type:Number,mayBeNull:c,optional:c}]);if(d)throw d;a._methodObject=i;a._param=j;a._invokeCompleteCallback=e;a._eventHandlerProxyList=f;a._conversationId=h;a._eventName=k;a._serializerVersion=g};Microsoft.Office.Common.Invoker.prototype={invoke:function(){var a=this;try{var b;switch(a._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:a._methodObject.getMethod()(a._param,a._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:b=a._methodObject.getMethod()(a._param);a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent:var d=a._createEventHandlerProxyObject(a._invokeCompleteCallback);b=a._methodObject.getMethod()(d.getSend(),a._param);a._eventHandlerProxyList[a._conversationId+a._eventName]=d.getSend();a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:var g=a._eventHandlerProxyList[a._conversationId+a._eventName];b=a._methodObject.getMethod()(g,a._param);delete a._eventHandlerProxyList[a._conversationId+a._eventName];a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:var c=a._createEventHandlerProxyObject(a._invokeCompleteCallback);a._methodObject.getMethod()(c.getSend(),a._invokeCompleteCallback.getSend(),a._param);a._eventHandlerProxyList[a._callerId+a._eventName]=c.getSend();break;case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:var f=a._eventHandlerProxyList[a._callerId+a._eventName];a._methodObject.getMethod()(f,a._invokeCompleteCallback.getSend(),a._param);delete a._eventHandlerProxyList[a._callerId+a._eventName]}}catch(e){a._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);a._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(a){return new Microsoft.Office.Common.ResponseSender(a.getRequesterWindow(),a.getRequesterUrl(),a.getActionName(),a.getConversationId(),a.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing,this._serializerVersion)}};OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"};OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var a=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource],b={};OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,a,b)};OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]);OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.getDelegateMethods=function(){var a={};a[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync;a[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync;a[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync;return a};OSF.DDA.WAC.Delegate.version=1;OSF.DDA.WAC.Delegate.executeAsync=function(a){if(!a.hostCallArgs)a.hostCallArgs={};a.hostCallArgs["DdaMethod"]={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:a.dispId};a.hostCallArgs["__timeout__"]=-1;a.onCalling&&a.onCalling();var b=(new Date).getTime();OSF.getClientEndPoint().invoke("executeMethod",function(e,d){a.onReceiving&&a.onReceiving();var c;if(e==Microsoft.Office.Common.InvokeResultCode.noError){OSF.DDA.WAC.Delegate.version=d["Version"];c=d["Error"]}else switch(e){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:c=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:c=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}a.onComplete&&a.onComplete(c,d);OSF.AppTelemetry&&OSF.AppTelemetry.onMethodDone(a.dispId,null,Math.abs((new Date).getTime()-b),c)},a.hostCallArgs)};OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(c,a){var b=(new Date).getTime();return function(f,e){a.onReceiving&&a.onReceiving();var d;if(f!=Microsoft.Office.Common.InvokeResultCode.noError)switch(f){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:d=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:d=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else if(e)if(e["Error"])d=e["Error"];else d=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;else d=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;a.onComplete&&a.onComplete(d);OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(c,a.dispId,Math.abs((new Date).getTime()-b),d)}};OSF.DDA.WAC.Delegate.registerEventAsync=function(a){a.onCalling&&a.onCalling();OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(a.targetId,a.eventType),function(b){a.onEvent&&a.onEvent(b);OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(a.dispId)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true,a),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:a.dispId,targetId:a.targetId})};OSF.DDA.WAC.Delegate.unregisterEventAsync=function(a){a.onCalling&&a.onCalling();OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(a.targetId,a.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false,a),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:a.dispId,targetId:a.targetId})};OSF.OUtil.setNamespace("WebApp",OSF);OSF.WebApp.AddHostInfoAndXdmInfo=function(a){if(OSF._OfficeAppFactory.getWindowLocationSearch&&OSF._OfficeAppFactory.getWindowLocationHash)return a+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash();else return a};OSF.WebApp._UpdateLinksForHostAndXdmInfo=function(){for(var b=document.querySelectorAll("a[data-officejs-navigate]"),a=0;a0?a.substr(0,d):null,c=b!==null?b.toLowerCase()==="http"||b.toLowerCase()==="https":true;c=c&&a!="#"&&a!="/"&&a!=""&&a!=OSF._OfficeAppFactory.getWebAppState().webAppUrl;return c};OSF.InitializationHelper=function(e,b,g,f,c){var a=this;a._hostInfo=e;a._webAppState=b;a._context=g;a._settings=f;a._hostFacade=c;a._initializeSettings=function(h,g){var c="undefined",e,b=h.get_settings(),d=OSF.OUtil.getSessionStorage();if(d){var a=d.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());if(a)b=typeof JSON!==c?JSON.parse(a):OsfMsAjaxFactory.msAjaxSerializer.deserialize(a,true);else{a=typeof JSON!==c?JSON.stringify(b):OsfMsAjaxFactory.msAjaxSerializer.serialize(b);d.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),a)}}var f=OSF.DDA.SettingsManager.deserializeSettings(b);if(g)e=new OSF.DDA.RefreshableSettings(f);else e=new OSF.DDA.Settings(f);return e};var d=function(a){var b=window.open;a.open=function(e,d,c){var a=null;try{a=b(e,d,c)}catch(f){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+f)}if(!a){var g={strUrl:e,strWindowName:d,strWindowFeatures:c};OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,g)}return a}};d(window)};OSF.InitializationHelper.prototype.getAppContext=function(d,c){var b=function(h,a){var b;if(a._appName===OSF.AppName.ExcelWebApp){var d=a._settings;b={};for(var n in d){var j=d[n];b[j[0]]=j[1]}}else b=a._settings;if(h===0&&a._id!=undefined&&a._appName!=undefined&&a._appVersion!=undefined&&a._appUILocale!=undefined&&a._dataLocale!=undefined&&a._docUrl!=undefined&&a._clientMode!=undefined&&a._settings!=undefined&&a._reason!=undefined){var l=a._id,m=false,k=true,g=0;if(a._minorVersion!=undefined)g=a._minorVersion;var e=undefined;if(a._requirementMatrix!=undefined)e=a._requirementMatrix;var f=new OSF.OfficeAppContext(a._id,a._appName,a._appVersion,a._appUILocale,a._dataLocale,a._docUrl,a._clientMode,b,a._reason,a._osfControlType,a._eToken,a._correlationId,l,m,k,g,e);OSF.AppTelemetry&&OSF.AppTelemetry.initialize(f);c(f)}else{var i="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+h+", exception: "+a;OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(i);throw i}};try{this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",b,this._webAppState.id)}catch(a){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+a+"]");throw a}};OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){var c="ContextActivationManager_notifyHost",b=false;try{var a=this,f=OSF.OUtil.parseXdmInfoWithGivenFragment(b,OSF._OfficeAppFactory.getWindowLocationHash());if(f){var d=OSF.OUtil.getInfoItems(f);if(d!=undefined&&d.length>=3){a._webAppState.conversationID=d[0];a._webAppState.id=d[1];a._webAppState.webAppUrl=d[2]}}a._webAppState.serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(b,OSF._OfficeAppFactory.getWindowLocationHash());a._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(a._webAppState.conversationID,a._webAppState.wnd,a._webAppState.webAppUrl,a._webAppState.serializerVersion);a._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(a._webAppState.id);var g=a._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;a._webAppState.serviceEndPoint.registerConversation(g,a._webAppState.webAppUrl);var h=function(){if(!a._webAppState.focused){a._webAppState.focused=true;for(var c=document.querySelectorAll("input,a,button"),b=0;b40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{ActiveViewChangedEvent:"ActiveViewChangedEvent"});Microsoft.Office.WebExtension.ActiveView={Read:"read",Edit:"edit"};OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ActiveViewChanged:"activeViewChanged"});OSF.DDA.AsyncMethodNames.addNames({GetActiveViewAsync:"getActiveViewAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetActiveViewAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(b){var a=b[Microsoft.Office.WebExtension.Parameters.ActiveView];return a==undefined?null:a}});OSF.DDA.ActiveViewChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.ActiveViewChanged},activeView:{value:a.activeView}})};OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetActiveViewMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.ActiveView,value:Microsoft.Office.WebExtension.Parameters.Data}]});Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"};Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"};Microsoft.Office.WebExtension.Index={First:"first",Last:"last",Next:"next",Previous:"previous"};OSF.DDA.AsyncMethodNames.addNames({GoToByIdAsync:"goToByIdAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GoToByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string","number"]},{name:Microsoft.Office.WebExtension.Parameters.GoToType,"enum":Microsoft.Office.WebExtension.GoToType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:{"enum":Microsoft.Office.WebExtension.SelectionMode,defaultValue:Microsoft.Office.WebExtension.SelectionMode.Default}}]});OSF.OUtil.setNamespace("Marshaling",OSF.DDA);OSF.DDA.Marshaling.NavigationKeys={NavigationRequest:"DdaGoToByIdMethod",Id:"Id",GoToType:"GoToType",SelectionMode:"SelectionMode"};var OSF_DDA_Marshaling_GoToType;(function(a){var b="NamedItem";a[a["Binding"]=0]="Binding";a[a[b]=1]=b;a[a["Slide"]=2]="Slide";a[a["Index"]=3]="Index"})(OSF_DDA_Marshaling_GoToType||(OSF_DDA_Marshaling_GoToType={}));OSF.DDA.Marshaling.GoToType=OSF_DDA_Marshaling_GoToType;var OSF_DDA_Marshaling_SelectionMode;(function(a){var b="Selected";a[a["Default"]=0]="Default";a[a[b]=1]=b;a[a["None"]=2]="None"})(OSF_DDA_Marshaling_SelectionMode||(OSF_DDA_Marshaling_SelectionMode={}));OSF.DDA.Marshaling.SelectionMode=OSF_DDA_Marshaling_SelectionMode;OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.Marshaling.NavigationKeys.NavigationRequest);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.NavigationKeys.Id},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:OSF.DDA.Marshaling.NavigationKeys.GoToType},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:OSF.DDA.Marshaling.NavigationKeys.SelectionMode}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:OSF.DDA.Marshaling.GoToType.Binding},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:OSF.DDA.Marshaling.GoToType.NamedItem},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:OSF.DDA.Marshaling.GoToType.Slide},{name:Microsoft.Office.WebExtension.GoToType.Index,value:OSF.DDA.Marshaling.GoToType.Index}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:OSF.DDA.Marshaling.SelectionMode.Default},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:OSF.DDA.Marshaling.SelectionMode.Selected},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:OSF.DDA.Marshaling.SelectionMode.None}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"});Microsoft.Office.WebExtension.FileProperties=function(a){OSF.OUtil.defineEnumerableProperties(this,{url:{value:a[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(a){return new Microsoft.Office.WebExtension.FileProperties(a)}});OSF.OUtil.setNamespace("Marshaling",OSF.DDA);var OSF_DDA_Marshaling_FilePropertiesKeys;(function(a){var b="Properties";a[a[b]=0]=b;a[a["Url"]=1]="Url"})(OSF_DDA_Marshaling_FilePropertiesKeys||(OSF_DDA_Marshaling_FilePropertiesKeys={}));OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys;OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:OSF.DDA.FilePropertiesDescriptor.Url,value:OSF.DDA.Marshaling.FilePropertiesKeys.Url}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:OSF.DDA.Marshaling.FilePropertiesKeys.Properties}]});OSF.DDA.AsyncMethodNames.addNames({GetOfficeThemeAsync:"getOfficeThemeAsync",GetDocumentThemeAsync:"getDocumentThemeAsync"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{OfficeThemeChanged:"officeThemeChanged",DocumentThemeChanged:"documentThemeChanged"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.Parameters,{DocumentTheme:"documentTheme",OfficeTheme:"officeTheme"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DocumentThemeChangedEvent:"DocumentThemeChangedEvent",OfficeThemeChangedEvent:"OfficeThemeChangedEvent"});OSF.OUtil.setNamespace("Theming",OSF.DDA);OSF.DDA.Theming.OfficeThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor"};OSF.DDA.Theming.DocumentThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor",Accent1:"accent1",Accent2:"accent2",Accent3:"accent3",Accent4:"accent4",Accent5:"accent5",Accent6:"accent6",Hyperlink:"hyperlink",FollowedHyperlink:"followedHyperlink",HeaderLatinFont:"headerLatinFont",HeaderEastAsianFont:"headerEastAsianFont",HeaderScriptFont:"headerScriptFont",HeaderLocalizedFont:"headerLocalizedFont",BodyLatinFont:"bodyLatinFont",BodyEastAsianFont:"bodyEastAsianFont",BodyScriptFont:"bodyScriptFont",BodyLocalizedFont:"bodyLocalizedFont"};OSF.DDA.Theming.ConvertToDocumentTheme=function(f){var b=false,a=true;for(var d=[{name:"primaryFontColor",needToConvertToHex:a},{name:"primaryBackgroundColor",needToConvertToHex:a},{name:"secondaryFontColor",needToConvertToHex:a},{name:"secondaryBackgroundColor",needToConvertToHex:a},{name:"accent1",needToConvertToHex:a},{name:"accent2",needToConvertToHex:a},{name:"accent3",needToConvertToHex:a},{name:"accent4",needToConvertToHex:a},{name:"accent5",needToConvertToHex:a},{name:"accent6",needToConvertToHex:a},{name:"hyperlink",needToConvertToHex:a},{name:"followedHyperlink",needToConvertToHex:a},{name:"headerLatinFont",needToConvertToHex:b},{name:"headerEastAsianFont",needToConvertToHex:b},{name:"headerScriptFont",needToConvertToHex:b},{name:"headerLocalizedFont",needToConvertToHex:b},{name:"bodyLatinFont",needToConvertToHex:b},{name:"bodyEastAsianFont",needToConvertToHex:b},{name:"bodyScriptFont",needToConvertToHex:b},{name:"bodyLocalizedFont",needToConvertToHex:b}],e={},c=0;c6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.WAC.SettingsTranslator=function(){var b=0,a=1;return {read:function(d){if(d.Settings){var c={},e=d.Settings;for(var g in e){var f=e[g];c[f[b]]=f[a]}return c}else if(typeof window["OSFPPTWAC"]!="undefined")return d;else{var c={};return c}},write:function(d){var e=[];for(var f in d){var c=[];c[b]=f;c[a]=d[f];e.push(c)}return e}}}();OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings,{toHost:OSF.DDA.WAC.SettingsTranslator.write,fromHost:OSF.DDA.WAC.SettingsTranslator.read});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SettingsRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:"OverwriteIfStale"},{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}],invertible:true});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SettingsRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});var OSFPPTWAC;(function(b){var a=function(){function a(b,c){var a=this;OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.ActiveViewChanged]));OSF.DDA.PowerPointDocument.uber.constructor.call(a,b,c);OSF.DDA.DispIdHost.addAsyncMethods(a,[OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,OSF.DDA.AsyncMethodNames.GoToByIdAsync,OSF.DDA.AsyncMethodNames.GetActiveViewAsync,OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);OSF.OUtil.finalizeProperties(a)}return a}();b.PowerPointDocument=a})(OSFPPTWAC||(OSFPPTWAC={}));OSF.DDA.PowerPointDocument=OSFPPTWAC.PowerPointDocument;OSF.OUtil.extend(OSF.DDA.PowerPointDocument,OSF.DDA.Document);OSF.OUtil.redefineList(Microsoft.Office.WebExtension.GoToType,{Slide:"slide",Index:"index"});OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(a,b){OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);a.doc=new OSF.DDA.PowerPointDocument(a,this._initializeSettings(a,true));b()};OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function(a){OSF.WebApp._UpdateLinksForHostAndXdmInfo();var d=new OSF.DDA.License(a.get_eToken());OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(a,a.doc,d));var b;OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.WAC.getDelegateMethods,OSF.DDA.WAC.Delegate.ParameterMap));b=function(b,d){if(b==0&&d!=true)OSF.getClientEndPoint().registerForEvent("activationCompleted",function(){var b=a.get_reason();Microsoft.Office.WebExtension.initialize(b)},null,{controlId:OSF._OfficeAppFactory.getId(),eventDispId:OSF.DDA.EventDispId.dispidActivationStatusChangedEvent,targetId:""});else{var c=a.get_reason();Microsoft.Office.WebExtension.initialize(c)}};OSF.getClientEndPoint().invoke("getActivationCompletedStatus",b,this._webAppState.id);var c=new OSF.DDA.Theming.InternalThemeHandler;c.InitializeAndChangeOnce()} \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-win32-16.00.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-win32-16.00.debug.js new file mode 100644 index 000000000..eb106fa1f --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-win32-16.00.debug.js @@ -0,0 +1,6151 @@ +/* PowerPoint specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var OfficeExt; +(function (OfficeExt) { + var MicrosoftAjaxFactory = (function () { + function MicrosoftAjaxFactory() { + } + MicrosoftAjaxFactory.prototype.isMsAjaxLoaded = function () { + if (typeof (Sys) !== 'undefined' && typeof (Type) !== 'undefined' && Sys.StringBuilder && typeof (Sys.StringBuilder) === "function" && Type.registerNamespace && typeof (Type.registerNamespace) === "function" && Type.registerClass && typeof (Type.registerClass) === "function" && typeof (Function._validateParams) === "function") { + return true; + } else { + return false; + } + }; + MicrosoftAjaxFactory.prototype.loadMsAjaxFull = function (callback) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OSF.OUtil.loadScript(msAjaxCDNPath, callback); + }; + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", { + get: function () { + if (this._msAjaxError == null && this.isMsAjaxLoaded()) { + this._msAjaxError = Error; + } + return this._msAjaxError; + }, + set: function (errorClass) { + this._msAjaxError = errorClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", { + get: function () { + if (this._msAjaxSerializer == null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer = Sys.Serialization.JavaScriptSerializer; + } + return this._msAjaxSerializer; + }, + set: function (serializerClass) { + this._msAjaxSerializer = serializerClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", { + get: function () { + if (this._msAjaxString == null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer = String; + } + return this._msAjaxString; + }, + set: function (stringClass) { + this._msAjaxString = stringClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", { + get: function () { + if (this._msAjaxDebug == null && this.isMsAjaxLoaded()) { + this._msAjaxDebug = Sys.Debug; + } + return this._msAjaxDebug; + }, + set: function (debugClass) { + this._msAjaxDebug = debugClass; + }, + enumerable: true, + configurable: true + }); + return MicrosoftAjaxFactory; + })(); + OfficeExt.MicrosoftAjaxFactory = MicrosoftAjaxFactory; +})(OfficeExt || (OfficeExt = {})); +var OsfMsAjaxFactory = new OfficeExt.MicrosoftAjaxFactory(); +var OSF = OSF || {}; +var OfficeExt; +(function (OfficeExt) { + var SafeStorage = (function () { + function SafeStorage(_internalStorage) { + this._internalStorage = _internalStorage; + } + SafeStorage.prototype.getItem = function (key) { + try { + return this._internalStorage && this._internalStorage.getItem(key); + } catch (e) { + return null; + } + }; + SafeStorage.prototype.setItem = function (key, data) { + try { + this._internalStorage && this._internalStorage.setItem(key, data); + } catch (e) { + } + }; + SafeStorage.prototype.clear = function () { + try { + this._internalStorage && this._internalStorage.clear(); + } catch (e) { + } + }; + SafeStorage.prototype.removeItem = function (key) { + try { + this._internalStorage && this._internalStorage.removeItem(key); + } catch (e) { + } + }; + SafeStorage.prototype.getKeysWithPrefix = function (keyPrefix) { + var keyList = []; + try { + var len = this._internalStorage && this._internalStorage.length || 0; + for (var i = 0; i < len; i++) { + var key = this._internalStorage.key(i); + if (key.indexOf(keyPrefix) === 0) { + keyList.push(key); + } + } + } catch (e) { + } + return keyList; + }; + return SafeStorage; + })(); + OfficeExt.SafeStorage = SafeStorage; +})(OfficeExt || (OfficeExt = {})); +OSF.OUtil = (function () { + var _uniqueId = -1; + var _xdmInfoKey = '&_xdm_Info='; + var _serializerVersionKey = '&_serializer_version='; + var _xdmSessionKeyPrefix = '_xdm_'; + var _serializerVersionKeyPrefix = '_serializer_version='; + var _fragmentSeparator = '#'; + var _loadedScripts = {}; + var _defaultScriptLoadingTimeout = 30000; + var _safeSessionStorage = null; + var _safeLocalStorage = null; + + var _rndentropy = new Date().getTime(); + function _random() { + var nextrand = 0x7fffffff * (Math.random()); + nextrand ^= _rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10))); + + return nextrand.toString(16); + } + ; + function _getSessionStorage() { + if (!_safeSessionStorage) { + try { + var sessionStorage = window.sessionStorage; + } catch (ex) { + sessionStorage = null; + } + _safeSessionStorage = new OfficeExt.SafeStorage(sessionStorage); + } + return _safeSessionStorage; + } + ; + return { + set_entropy: function OSF_OUtil$set_entropy(entropy) { + if (typeof entropy == "string") { + for (var i = 0; i < entropy.length; i += 4) { + var temp = 0; + for (var j = 0; j < 4 && i + j < entropy.length; j++) { + temp = (temp << 8) + entropy.charCodeAt(i + j); + } + _rndentropy ^= temp; + } + } else if (typeof entropy == "number") { + _rndentropy ^= entropy; + } else { + _rndentropy ^= 0x7fffffff * Math.random(); + } + _rndentropy &= 0x7fffffff; + }, + extend: function OSF_OUtil$extend(child, parent) { + var F = function () { + }; + F.prototype = parent.prototype; + child.prototype = new F(); + child.prototype.constructor = child; + child.uber = parent.prototype; + if (parent.prototype.constructor === Object.prototype.constructor) { + parent.prototype.constructor = parent; + } + }, + setNamespace: function OSF_OUtil$setNamespace(name, parent) { + if (parent && name && !parent[name]) { + parent[name] = {}; + } + }, + unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) { + if (parent && name && parent[name]) { + delete parent[name]; + } + }, + loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) { + if (url && callback) { + var doc = window.document; + var _loadedScriptEntry = _loadedScripts[url]; + if (!_loadedScriptEntry) { + var script = doc.createElement("script"); + script.type = "text/javascript"; + _loadedScriptEntry = { loaded: false, pendingCallbacks: [callback], timer: null }; + _loadedScripts[url] = _loadedScriptEntry; + var onLoadCallback = function OSF_OUtil_loadScript$onLoadCallback() { + if (_loadedScriptEntry.timer != null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + _loadedScriptEntry.loaded = true; + var pendingCallbackCount = _loadedScriptEntry.pendingCallbacks.length; + for (var i = 0; i < pendingCallbackCount; i++) { + var currentCallback = _loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + var onLoadError = function OSF_OUtil_loadScript$onLoadError() { + delete _loadedScripts[url]; + if (_loadedScriptEntry.timer != null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + var pendingCallbackCount = _loadedScriptEntry.pendingCallbacks.length; + for (var i = 0; i < pendingCallbackCount; i++) { + var currentCallback = _loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + if (script.readyState) { + script.onreadystatechange = function () { + if (script.readyState == "loaded" || script.readyState == "complete") { + script.onreadystatechange = null; + onLoadCallback(); + } + }; + } else { + script.onload = onLoadCallback; + } + script.onerror = onLoadError; + + timeoutInMs = timeoutInMs || _defaultScriptLoadingTimeout; + _loadedScriptEntry.timer = setTimeout(onLoadError, timeoutInMs); + script.src = url; + doc.getElementsByTagName("head")[0].appendChild(script); + } else if (_loadedScriptEntry.loaded) { + callback(); + } else { + _loadedScriptEntry.pendingCallbacks.push(callback); + } + } + }, + loadCSS: function OSF_OUtil$loadCSS(url) { + if (url) { + var doc = window.document; + var link = doc.createElement("link"); + link.type = "text/css"; + link.rel = "stylesheet"; + link.href = url; + doc.getElementsByTagName("head")[0].appendChild(link); + } + }, + parseEnum: function OSF_OUtil$parseEnum(str, enumObject) { + var parsed = enumObject[str.trim()]; + if (typeof (parsed) == 'undefined') { + OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:" + str); + throw OsfMsAjaxFactory.msAjaxError.argument("str"); + } + return parsed; + }, + delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() { + var obj = { calc: arguments[0] }; + return function () { + if (obj.calc) { + obj.val = obj.calc.apply(this, arguments); + delete obj.calc; + } + return obj.val; + }; + }, + getUniqueId: function OSF_OUtil$getUniqueId() { + _uniqueId = _uniqueId + 1; + return _uniqueId.toString(); + }, + formatString: function OSF_OUtil$formatString() { + var args = arguments; + var source = args[0]; + return source.replace(/{(\d+)}/gm, function (match, number) { + var index = parseInt(number, 10) + 1; + return args[index] === undefined ? '{' + number + '}' : args[index]; + }); + }, + generateConversationId: function OSF_OUtil$generateConversationId() { + return [_random(), _random(), (new Date()).getTime().toString()].join('_'); + }, + getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame) { + var frameName = _xdmSessionKeyPrefix + cacheKey + this.generateConversationId(); + frame.setAttribute("name", frameName); + return this.generateConversationId(); + }, + addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) { + return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue); + }, + addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) { + return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion); + }, + addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue) { + url = url.trim() || ''; + var urlParts = url.split(_fragmentSeparator); + var urlWithoutFragment = urlParts.shift(); + var fragment = urlParts.join(_fragmentSeparator); + return [urlWithoutFragment, _fragmentSeparator, fragment, keyName, infoValue].join(''); + }, + parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) { + return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) { + return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, skipSessionStorage, fragment); + }, + parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) { + return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) { + return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, skipSessionStorage, fragment)); + }, + parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment) { + var fragmentParts = fragment.split(infoKey); + var xdmInfoValue = fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + + +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response = { + Status: 0, + Payload: 1 +}; + +OSF.DDA.SafeArray.UniqueArguments = { + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException = function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number = ex.number; + if (number) { + switch (number) { + case -2146828218: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor = function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows = vbArr.ubound(1); + var cols = vbArr.ubound(2); + vbArr = vbArr.toArray(); + if (rows == 1 && cols == 1) { + ret = [vbArr]; + } else { + ret = []; + for (var row = 0; row < rows; row++) { + var rowArr = []; + for (var col = 0; col < cols; col++) { + var datum = vbArr[row * cols + col]; + if (datum != OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes = []; + var dynamicTypes = {}; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = (function () { + var tableRows = 0; + var tableHeaders = 1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data != "string" && data[OSF.DDA.TableDataProperties.TableRows] !== undefined) { + var tableData = []; + tableData[tableRows] = data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders] = data[OSF.DDA.TableDataProperties.TableHeaders]; + data = tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs.toArray) { + var dimensions = hostArgs.dimensions(); + if (dimensions === 2) { + ret = _2DVBArrayToJaggedArray(hostArgs); + } else { + var array = hostArgs.toArray(); + if (array.length === 2 && ((array[0] != null && array[0].toArray) || (array[1] != null && array[1].toArray))) { + ret = {}; + ret[OSF.DDA.TableDataProperties.TableRows] = _2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders] = _2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret = array; + } + } + } else { + ret = hostArgs; + } + return ret; + } + }; + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + + this.unpack = function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + var toArraySupported = (arg || typeof arg === "unknown") && arg.toArray; + value = toArraySupported ? arg.toArray() : arg || {}; + } else if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; + +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); + +OSF.DDA.SafeArray.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [ + { + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 }, + { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 } + ] + }, + { + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 } + ] + } +]); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 }, + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 } + ] +}); +OSF.DDA.SafeArray.Delegate.executeAsync = function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + function toArray(args) { + var arrArgs = args; + if (OSF.OUtil.isArray(args)) { + var len = arrArgs.length; + for (var i = 0; i < len; i++) { + arrArgs[i] = toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs = args.getVarDate(); + } else if (typeof args === "object" && !OSF.OUtil.isArray(args)) { + arrArgs = []; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index] = toArray(args[index]); + } + } + } + return arrArgs; + } + function fromSafeArray(value) { + var ret = value; + if (value != null && value.toArray) { + var arrayResult = value.toArray(); + for (var i = 0; i < arrayResult.length; i++) { + arrayResult[i] = fromSafeArray(arrayResult[i]); + } + ret = arrayResult; + } + return ret; + } + try { + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + var result = hostResponseArgs.toArray(); + var status = result[OSF.DDA.SafeArray.Response.Status]; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) { + var payload = result[OSF.DDA.SafeArray.Response.Payload]; + payload = fromSafeArray(payload); + if (payload != null) { + if (!args._chunkResultData) { + args._chunkResultData = new Array(); + } + + args._chunkResultData[payload[0]] = payload[1]; + } + } else { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload = []; + for (var i = 1; i < result.length; i++) + payload[i - 1] = result[i]; + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + if (args._chunkResultData) { + payload = fromSafeArray(payload); + if (payload != null) { + var expectedChunkCount = payload[payload.length - 1]; + if (args._chunkResultData.length == expectedChunkCount) { + payload[payload.length - 1] = args._chunkResultData; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + } + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + }); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent = function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status = hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync = function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync = function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; + +OSF.ClientMode = { + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason = { + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = this.initializeSettings; +}; +OSF.InitializationHelper.prototype.deserializeSettings = function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) { + var settings; + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = (typeof (JSON) !== "undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = (typeof (JSON) !== "undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface = function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + var license = new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler = (OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler)); + var getDelegateMethods, parameterMap; + getDelegateMethods = OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); +}; +OSF.InitializationHelper.prototype.getInitializationReason = function (appContext) { + return OSF.DDA.RichInitializationReason[appContext.get_reason()]; +}; + +OSF.DDA.DispIdHost.getClientDelegateMethods = function (actionId) { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + + if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId == OSF.DDA.AsyncMethodNames.RefreshAsync.id) { + var readSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings); + } + if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId == OSF.DDA.AsyncMethodNames.SaveAsync.id) { + var writeSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings); + } + return delegateMethods; +}; + +var OSFRichclient; +(function (OSFRichclient) { + var RichClientHostController = (function () { + function RichClientHostController() { + } + RichClientHostController.prototype.execute = function (id, params, callback) { + window.external.Execute(id, params, callback); + }; + RichClientHostController.prototype.registerEvent = function (id, targetId, handler, callback) { + window.external.RegisterEvent(id, targetId, handler, callback); + }; + RichClientHostController.prototype.unregisterEvent = function (id, targetId, callback) { + window.external.UnregisterEvent(id, targetId, callback); + }; + return RichClientHostController; + })(); + OSFRichclient.RichClientHostController = RichClientHostController; +})(OSFRichclient || (OSFRichclient = {})); +OSF.ClientHostController = new OSFRichclient.RichClientHostController(); + +var OfficeExt; +(function (OfficeExt) { + (function (OfficeTheme) { + var OfficeThemeManager = (function () { + function OfficeThemeManager() { + this._osfOfficeTheme = null; + this._osfOfficeThemeTimeStamp = null; + } + OfficeThemeManager.prototype.getOfficeTheme = function () { + if (OSF.DDA._OsfControlContext) { + if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0); + } + } else { + var startTime = (new Date()).getTime(); + var osfOfficeTheme = OSF.DDA._OsfControlContext.GetOfficeThemeInfo(); + var endTime = (new Date()).getTime(); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime)); + } + + this._osfOfficeTheme = JSON.parse(osfOfficeTheme); + for (var color in this._osfOfficeTheme) { + this._osfOfficeTheme[color] = OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]); + } + this._osfOfficeThemeTimeStamp = endTime; + } + return this._osfOfficeTheme; + } + }; + + OfficeThemeManager.instance = function () { + if (OfficeThemeManager._instance == null) { + OfficeThemeManager._instance = new OfficeThemeManager(); + } + return OfficeThemeManager._instance; + }; + OfficeThemeManager._osfOfficeThemeCacheValidPeriod = 5000; + + OfficeThemeManager._instance = null; + return OfficeThemeManager; + })(); + OfficeTheme.OfficeThemeManager = OfficeThemeManager; + + OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA); + OSF.DDA.OfficeTheme.getOfficeTheme = OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme; + })(OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme = {})); + var OfficeTheme = OfficeExt.OfficeTheme; +})(OfficeExt || (OfficeExt = {})); + +OSF.DDA.ClientSettingsManager = { + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + try { + response = hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } catch (ex) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response = { name: Strings.OfficeOM.L_InternalError, message: ex }; + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) { + var keys = []; + var values = []; + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Read(keys, values); + if (onReceiving) { + onReceiving(); + } + var serializedSettings = {}; + for (var index = 0; index < keys.length; index++) { + serializedSettings[keys[index]] = values[index]; + } + return serializedSettings; + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) { + var keys = []; + var values = []; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Write(keys, values); + if (onReceiving) { + onReceiving(); + } + } +}; + +OSF.InitializationHelper.prototype.initializeSettings = function OSF_InitializationHelper$initializeSettings(refreshSupported) { + var serializedSettings = OSF.DDA.ClientSettingsManager.read(); + var settings = this.deserializeSettings(serializedSettings, refreshSupported); + return settings; +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var returnedContext; + var context = OSF.DDA._OsfControlContext = window.external.GetContext(); + var appType = context.GetAppType(); + var appTypeSupported = false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry] == appType) { + appTypeSupported = true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type " + appType; + } + var id = context.GetSolutionRef(); + var version = context.GetAppVersionMajor(); + var minorVersion = context.GetAppVersionMinor(); + var UILocale = context.GetAppUILocale(); + var dataLocale = context.GetAppDataLocale(); + var docUrl = context.GetDocUrl(); + var clientMode = context.GetAppCapabilities(); + var reason = context.GetActivationMode(); + var osfControlType = context.GetControlIntegrationLevel(); + var settings = []; + var eToken; + try { + eToken = context.GetSolutionToken(); + } catch (ex) { + } + var correlationId; + + if (typeof context.GetCorrelationId !== "undefined") { + correlationId = context.GetCorrelationId(); + } + var appInstanceId; + if (typeof context.GetInstanceId !== "undefined") { + appInstanceId = context.GetInstanceId(); + } + var touchEnabled; + if (typeof context.GetTouchEnabled !== "undefined") { + touchEnabled = context.GetTouchEnabled(); + } + var commerceAllowed; + if (typeof context.GetCommerceAllowed !== "undefined") { + commerceAllowed = context.GetCommerceAllowed(); + } + var requirementMatrix; + if (typeof context.GetSupportedMatrix !== "undefined") { + requirementMatrix = context.GetSupportedMatrix(); + } + eToken = eToken ? eToken.toString() : ""; + returnedContext = new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.BindingType = { + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties = { + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise = function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id = bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t = typeof onError; + if (t != "undefined" && t != "function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback = onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype = { + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me = this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status == Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade = function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches = []; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding = function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding = function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et = Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches = docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id] = new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch = bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId = function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_" + OSF.OUtil.getUniqueId() + "_" + new Date().getTime(); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding = function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id = bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows = bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols = bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders = bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding = new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding = new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp = function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject = OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject = OSF.DDA.TableBinding; + } + binding = new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding = new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id = callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties = { + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding = function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); +OSF.DDA.FilePropertiesDescriptor = { + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties = function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); + +Microsoft.Office.WebExtension.GoToType = { + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode = { + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index = { + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); + +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType, { + Text: "text" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.ValueFormat, { + Unformatted: "unformatted" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.FilterType, { + All: "all" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.GoToType, { + Slide: "slide", + Index: "index" +}); +delete Microsoft.Office.WebExtension.BindingType; +delete Microsoft.Office.WebExtension.select; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { SlideRange: "slideRange" }); + +OSF.DDA.SlideProperties = { + Id: 0, + Title: 1, + Index: 2 +}; +OSF.DDA.Slide = function OSF_DDA_Slide(id, title, index) { + OSF.OUtil.defineEnumerableProperties(this, { + "id": { + value: id + }, + "title": { + value: title + }, + "index": { + value: index + } + }); +}; +OSF.DDA.SlideRange = function OSF_DDA_SlideRange(slides) { + OSF.OUtil.defineEnumerableProperties(this, { + "slides": { + value: slides + } + }); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureSlideRange = function OSF_DDA_OMFactory$manufactureSlideRange(input) { + var items = null; + if (JSON) { + items = JSON.parse(input); + } else { + items = Sys.Serialization.JavaScriptSerializer.deserialize(input); + } + if (items == null) { + return null; + } + var numField = 0; + for (var key in OSF.DDA.SlideProperties) { + if (OSF.DDA.SlideProperties.hasOwnProperty(key)) { + numField++; + } + } + var slides = []; + var dataValid = true; + for (var i = 0; i < items.length && dataValid; i++) { + dataValid = false; + if (items[i].length == numField) { + var id = parseInt(items[i][OSF.DDA.SlideProperties.Id]); + var title = items[i][OSF.DDA.SlideProperties.Title]; + var index = parseInt(items[i][OSF.DDA.SlideProperties.Index]); + if (!isNaN(id) && !isNaN(index)) { + dataValid = true; + slides.push(new OSF.DDA.Slide(id, title, index)); + } + } + } + if (!dataValid) { + return null; + } + return new OSF.DDA.SlideRange(slides); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.SlideRange, value: 7 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Html: "html" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Html, value: 3 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Ooxml: "ooxml" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Ooxml, value: 4 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { OoxmlPackage: "ooxmlPackage" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.OoxmlPackage, value: 5 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { PdfFile: "pdf" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.PdfFile, value: 6 } + ] +}); +Microsoft.Office.WebExtension.FileType = { + Text: "text", + Compressed: "compressed", + Pdf: "pdf" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FileProperties: "FileProperties", + FileSliceProperties: "FileSliceProperties" +}); +OSF.DDA.FileProperties = { + Handle: "FileHandle", + FileSize: "FileSize", + SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize +}; +OSF.DDA.File = function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState = {}; + privateState[OSF.DDA.FileProperties.Handle] = handle; + privateState[OSF.DDA.FileProperties.SliceSize] = sliceSize; + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], privateState); +}; + +OSF.DDA.FileSliceOffset = "fileSliceoffset"; +OSF.DDA.AsyncMethodNames.addNames({ + GetDocumentCopyAsync: "getFileAsync", + GetDocumentCopyChunkAsync: "getSliceAsync", + ReleaseDocumentCopyAsync: "closeAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.FileType, + "enum": Microsoft.Office.WebExtension.FileType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SliceSize, + value: { + "types": ["number"], + "defaultValue": 4 * 1024 * 1024 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var sliceSize = callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]; + + if (sliceSize <= 0 || sliceSize > (4 * 1024 * 1024)) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize; + } + return callArgs; + }, + onSucceeded: function (fileDescriptor, caller, callArgs) { + return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]); + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.SliceIndex, + "types": ["number"] + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + }, + { + name: OSF.DDA.FileProperties.SliceSize, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.SliceSize]; + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var index = callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]; + + if (index < 0 || index >= caller.sliceCount) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange; + } + + callArgs[OSF.DDA.FileSliceOffset] = parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString()); + return callArgs; + }, + onSucceeded: function (sliceDescriptor, caller, callArgs) { + var slice = {}; + OSF.OUtil.defineEnumerableProperties(slice, { + "data": { + value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data] + }, + "index": { + value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex] + }, + "size": { + value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize] + } + }); + return slice; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync, + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileProperties.FileSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: Microsoft.Office.WebExtension.FileType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.FileType.Compressed, value: 5 }, + { name: Microsoft.Office.WebExtension.FileType.Pdf, value: 6 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod, + toHost: [{ name: Microsoft.Office.WebExtension.Parameters.FileType, value: 0 }], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0 }] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 } + ] +}); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); +OSF.DDA.AsyncMethodNames.addNames({ + GetOfficeThemeAsync: "getOfficeThemeAsync", + GetDocumentThemeAsync: "getDocumentThemeAsync" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + OfficeThemeChanged: "officeThemeChanged", + DocumentThemeChanged: "documentThemeChanged" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.Parameters, { + DocumentTheme: "documentTheme", + OfficeTheme: "officeTheme" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { + DocumentThemeChangedEvent: "DocumentThemeChangedEvent", + OfficeThemeChangedEvent: "OfficeThemeChangedEvent" +}); +OSF.OUtil.setNamespace("Theming", OSF.DDA); +OSF.DDA.Theming.OfficeThemeEnum = { + PrimaryFontColor: "primaryFontColor", + PrimaryBackgroundColor: "primaryBackgroundColor", + SecondaryFontColor: "secondaryFontColor", + SecondaryBackgroundColor: "secondaryBackgroundColor" +}; +OSF.DDA.Theming.DocumentThemeEnum = { + PrimaryFontColor: "primaryFontColor", + PrimaryBackgroundColor: "primaryBackgroundColor", + SecondaryFontColor: "secondaryFontColor", + SecondaryBackgroundColor: "secondaryBackgroundColor", + Accent1: "accent1", + Accent2: "accent2", + Accent3: "accent3", + Accent4: "accent4", + Accent5: "accent5", + Accent6: "accent6", + Hyperlink: "hyperlink", + FollowedHyperlink: "followedHyperlink", + HeaderLatinFont: "headerLatinFont", + HeaderEastAsianFont: "headerEastAsianFont", + HeaderScriptFont: "headerScriptFont", + HeaderLocalizedFont: "headerLocalizedFont", + BodyLatinFont: "bodyLatinFont", + BodyEastAsianFont: "bodyEastAsianFont", + BodyScriptFont: "bodyScriptFont", + BodyLocalizedFont: "bodyLocalizedFont" +}; +OSF.DDA.Theming.ConvertToDocumentTheme = function OSF_DDA_Theming_ConvertToDocumentTheme(response) { + var mappingDocumentTheme = [ + { name: "primaryFontColor", needToConvertToHex: true }, + { name: "primaryBackgroundColor", needToConvertToHex: true }, + { name: "secondaryFontColor", needToConvertToHex: true }, + { name: "secondaryBackgroundColor", needToConvertToHex: true }, + { name: "accent1", needToConvertToHex: true }, + { name: "accent2", needToConvertToHex: true }, + { name: "accent3", needToConvertToHex: true }, + { name: "accent4", needToConvertToHex: true }, + { name: "accent5", needToConvertToHex: true }, + { name: "accent6", needToConvertToHex: true }, + { name: "hyperlink", needToConvertToHex: true }, + { name: "followedHyperlink", needToConvertToHex: true }, + { name: "headerLatinFont", needToConvertToHex: false }, + { name: "headerEastAsianFont", needToConvertToHex: false }, + { name: "headerScriptFont", needToConvertToHex: false }, + { name: "headerLocalizedFont", needToConvertToHex: false }, + { name: "bodyLatinFont", needToConvertToHex: false }, + { name: "bodyEastAsianFont", needToConvertToHex: false }, + { name: "bodyScriptFont", needToConvertToHex: false }, + { name: "bodyLocalizedFont", needToConvertToHex: false } + ]; + var result = {}; + for (var i = 0; i < mappingDocumentTheme.length; i++) { + if (mappingDocumentTheme[i].needToConvertToHex) { + result[mappingDocumentTheme[i].name] = OSF.OUtil.convertIntToCssHexColor(response[mappingDocumentTheme[i].name]); + } else { + result[mappingDocumentTheme[i].name] = response[mappingDocumentTheme[i].name]; + } + } + return result; +}; +OSF.DDA.Theming.ConvertToOfficeTheme = function OSF_DDA_Theming_ConvertToOfficeTheme(response) { + var result = {}; + for (var key in response) { + result[key] = OSF.OUtil.convertIntToCssHexColor(response[key]); + } + return result; +}; +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: OSF.DDA.Theming.ConvertToDocumentTheme +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: OSF.DDA.Theming.ConvertToOfficeTheme +}); +OSF.DDA.Theming.OfficeThemeChangedEventArgs = function OSF_DDA_Theming_OfficeThemeChangedEventArgs(officeTheme) { + var ret = OSF.DDA.Theming.ConvertToOfficeTheme(officeTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.OfficeThemeChanged + }, + "officeTheme": { + value: ret + } + }); +}; +OSF.DDA.Theming.DocumentThemeChangedEventArgs = function OSF_DDA_Theming_DocumentThemeChangedEventArgs(documentTheme) { + var ret = OSF.DDA.Theming.ConvertToDocumentTheme(documentTheme); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentThemeChanged + }, + "documentTheme": { + value: ret + } + }); +}; +var OSF_DDA_Theming_InternalThemeHandler = (function () { + function OSF_DDA_Theming_InternalThemeHandler() { + this._pseudoDocumentObject = null; + this._previousDocumentThemeData = null; + this._previousOfficeThemeData = null; + this._officeCss = null; + this._asyncCallsCompleted = null; + this._onAsyncCallsCompleted = null; + } + OSF_DDA_Theming_InternalThemeHandler.prototype.InitializeAndChangeOnce = function (callback) { + this._officeCss = this._getOfficeThemesCss(); + if (!this._officeCss) { + if (callback) { + callback(); + } + return; + } + this._onAsyncCallsCompleted = callback; + this._pseudoDocumentObject = {}; + var pseudoDoc = this._pseudoDocumentObject; + OSF.DDA.DispIdHost.addAsyncMethods(pseudoDoc, [ + OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync, + OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(pseudoDoc, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.OfficeThemeChanged, + Microsoft.Office.WebExtension.EventType.DocumentThemeChanged + ])); + this._asyncCallsCompleted = {}; + this._asyncCallsCompleted[OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync] = false; + this._asyncCallsCompleted[OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync] = false; + this._getAndProcessThemeData(pseudoDoc.getDocumentThemeAsync, Function.createDelegate(this, this._processDocumentThemeData), OSF.DDA.AsyncMethodNames.GetDocumentThemeAsync); + this._getAndProcessThemeData(pseudoDoc.getOfficeThemeAsync, Function.createDelegate(this, this._processOfficeThemeData), OSF.DDA.AsyncMethodNames.GetOfficeThemeAsync); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._getOfficeThemesCss = function () { + function getOfficeThemesCssInternal() { + var cssFileName = "officethemes.css"; + for (var i = 0; i < document.styleSheets.length; i++) { + var ss = document.styleSheets[i]; + if (!ss.disabled && ss.href && cssFileName == ss.href.substring(ss.href.length - cssFileName.length, ss.href.length).toLowerCase()) { + if ((!ss.cssRules) && (!ss.rules)) { + return null; + } else { + return ss; + } + } + } + } + + try { + return getOfficeThemesCssInternal(); + } catch (e) { + return null; + } + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeCss = function (officeCss, selector, newRule) { + var length = officeCss.cssRules ? officeCss.cssRules.length : officeCss.rules.length; + for (var i = 0; i < length; i++) { + var rule; + if (officeCss.cssRules) { + rule = officeCss.cssRules[i]; + } else { + rule = officeCss.rules[i]; + } + var ruleSelector = rule.selectorText; + if (ruleSelector !== "" && ruleSelector.toLowerCase() == selector.toLowerCase()) { + if (officeCss.cssRules) { + officeCss.deleteRule(i); + officeCss.insertRule(ruleSelector + newRule, i); + } else { + officeCss.removeRule(i); + officeCss.addRule(ruleSelector, newRule, i); + } + } + } + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeDocumentThemeData = function (data) { + var documentThemeCssMapping = [ + { name: "primaryFontColor", cssSelector: ".office-docTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-docTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-docTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-docTheme-secondary-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-color", cssProperty: "color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-color", cssProperty: "color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-color", cssProperty: "color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-color", cssProperty: "color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-color", cssProperty: "color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-color", cssProperty: "color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-bgColor", cssProperty: "background-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-bgColor", cssProperty: "background-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-bgColor", cssProperty: "background-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-bgColor", cssProperty: "background-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-bgColor", cssProperty: "background-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-bgColor", cssProperty: "background-color" }, + { name: "accent1", cssSelector: ".office-contentAccent1-borderColor", cssProperty: "border-color" }, + { name: "accent2", cssSelector: ".office-contentAccent2-borderColor", cssProperty: "border-color" }, + { name: "accent3", cssSelector: ".office-contentAccent3-borderColor", cssProperty: "border-color" }, + { name: "accent4", cssSelector: ".office-contentAccent4-borderColor", cssProperty: "border-color" }, + { name: "accent5", cssSelector: ".office-contentAccent5-borderColor", cssProperty: "border-color" }, + { name: "accent6", cssSelector: ".office-contentAccent6-borderColor", cssProperty: "border-color" }, + { name: "hyperlink", cssSelector: ".office-a", cssProperty: "color" }, + { name: "followedHyperlink", cssSelector: ".office-a:visited", cssProperty: "color" }, + { name: "headerLatinFont", cssSelector: ".office-headerFont-latin", cssProperty: "font-family" }, + { name: "headerEastAsianFont", cssSelector: ".office-headerFont-eastAsian", cssProperty: "font-family" }, + { name: "headerScriptFont", cssSelector: ".office-headerFont-script", cssProperty: "font-family" }, + { name: "headerLocalizedFont", cssSelector: ".office-headerFont-localized", cssProperty: "font-family" }, + { name: "bodyLatinFont", cssSelector: ".office-bodyFont-latin", cssProperty: "font-family" }, + { name: "bodyEastAsianFont", cssSelector: ".office-bodyFont-eastAsian", cssProperty: "font-family" }, + { name: "bodyScriptFont", cssSelector: ".office-bodyFont-script", cssProperty: "font-family" }, + { name: "bodyLocalizedFont", cssSelector: ".office-bodyFont-localized", cssProperty: "font-family" } + ]; + var realData = data.type == "documentThemeChanged" ? data.documentTheme : data; + for (var i = 0; i < documentThemeCssMapping.length; i++) { + if (this._previousDocumentThemeData === null || this._previousDocumentThemeData[documentThemeCssMapping[i].name] != realData[documentThemeCssMapping[i].name]) { + if (realData[documentThemeCssMapping[i].name] != null && realData[documentThemeCssMapping[i].name] != "") { + var insertableText = realData[documentThemeCssMapping[i].name]; + + if (documentThemeCssMapping[i].cssProperty === "font-family") { + insertableText = '"' + insertableText.replace(/"/g, '\\"') + '"'; + } + this._changeCss(this._officeCss, documentThemeCssMapping[i].cssSelector, "{" + documentThemeCssMapping[i].cssProperty + ":" + insertableText + ";}"); + } else { + this._changeCss(this._officeCss, documentThemeCssMapping[i].cssSelector, "{}"); + } + } + } + this._previousDocumentThemeData = realData; + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._changeOfficeThemeData = function (data) { + var officeThemeCssMapping = [ + { name: "primaryFontColor", cssSelector: ".office-officeTheme-primary-fontColor", cssProperty: "color" }, + { name: "primaryBackgroundColor", cssSelector: ".office-officeTheme-primary-bgColor", cssProperty: "background-color" }, + { name: "secondaryFontColor", cssSelector: ".office-officeTheme-secondary-fontColor", cssProperty: "color" }, + { name: "secondaryBackgroundColor", cssSelector: ".office-officeTheme-secondary-bgColor", cssProperty: "background-color" } + ]; + var realData = data.type == "officeThemeChanged" ? data.officeTheme : data; + for (var i = 0; i < officeThemeCssMapping.length; i++) { + if (this._previousOfficeThemeData === null || this._previousOfficeThemeData[officeThemeCssMapping[i].name] != realData[officeThemeCssMapping[i].name]) { + if (realData[officeThemeCssMapping[i].name] !== undefined) { + this._changeCss(this._officeCss, officeThemeCssMapping[i].cssSelector, "{" + officeThemeCssMapping[i].cssProperty + ":" + realData[officeThemeCssMapping[i].name] + ";}"); + } + } + } + this._previousOfficeThemeData = realData; + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._getAndProcessThemeData = function (getThemeMethod, processResultCallback, getThemeMethodIdentifier) { + getThemeMethod(Function.createDelegate(this, function (asyncResult) { + if (asyncResult.status == "succeeded") { + var data = asyncResult.value; + processResultCallback(data); + } + if (this._areAllCallsCompleted(getThemeMethodIdentifier) && this._onAsyncCallsCompleted) { + this._onAsyncCallsCompleted(); + this._onAsyncCallsCompleted = null; + } + })); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._processOfficeThemeData = function (data) { + this._changeOfficeThemeData(data); + this._pseudoDocumentObject.addHandlerAsync(Microsoft.Office.WebExtension.EventType.OfficeThemeChanged, Function.createDelegate(this, this._changeOfficeThemeData), null); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._processDocumentThemeData = function (data) { + this._changeDocumentThemeData(data); + this._pseudoDocumentObject.addHandlerAsync(Microsoft.Office.WebExtension.EventType.DocumentThemeChanged, Function.createDelegate(this, this._changeDocumentThemeData), null); + }; + OSF_DDA_Theming_InternalThemeHandler.prototype._areAllCallsCompleted = function (completedCall) { + var asyncCallsCompleted; + + if (!(asyncCallsCompleted = this._asyncCallsCompleted)) { + return true; + } + if (completedCall && asyncCallsCompleted.hasOwnProperty(completedCall)) { + asyncCallsCompleted[completedCall] = true; + } + for (var call in asyncCallsCompleted) { + if (asyncCallsCompleted.hasOwnProperty(call) && asyncCallsCompleted[call]) { + continue; + } + return false; + } + return true; + }; + return OSF_DDA_Theming_InternalThemeHandler; +})(); +OSF.DDA.Theming.InternalThemeHandler = OSF_DDA_Theming_InternalThemeHandler; +var parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap; +parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.DocumentTheme, value: parameterMap.self } + ] +}); +parameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OfficeTheme, value: parameterMap.self } + ] +}); +parameterMap.define({ + type: OSF.DDA.EventDispId.dispidDocumentThemeChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, value: parameterMap.self } + ], + isComplexType: true +}); +parameterMap.define({ + type: OSF.DDA.EventDispId.dispidOfficeThemeChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, value: parameterMap.self } + ], + isComplexType: true +}); +var destKeys = OSF.DDA.Theming.DocumentThemeEnum; +parameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.DocumentTheme, + fromHost: [ + { name: destKeys.PrimaryBackgroundColor, value: 0 }, + { name: destKeys.PrimaryFontColor, value: 1 }, + { name: destKeys.SecondaryBackgroundColor, value: 2 }, + { name: destKeys.SecondaryFontColor, value: 3 }, + { name: destKeys.Accent1, value: 4 }, + { name: destKeys.Accent2, value: 5 }, + { name: destKeys.Accent3, value: 6 }, + { name: destKeys.Accent4, value: 7 }, + { name: destKeys.Accent5, value: 8 }, + { name: destKeys.Accent6, value: 9 }, + { name: destKeys.Hyperlink, value: 10 }, + { name: destKeys.FollowedHyperlink, value: 11 }, + { name: destKeys.HeaderLatinFont, value: 12 }, + { name: destKeys.HeaderEastAsianFont, value: 13 }, + { name: destKeys.HeaderScriptFont, value: 14 }, + { name: destKeys.HeaderLocalizedFont, value: 15 }, + { name: destKeys.BodyLatinFont, value: 16 }, + { name: destKeys.BodyEastAsianFont, value: 17 }, + { name: destKeys.BodyScriptFont, value: 18 }, + { name: destKeys.BodyLocalizedFont, value: 19 } + ], + isComplexType: true +}); +destKeys = OSF.DDA.Theming.OfficeThemeEnum; +parameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.OfficeTheme, + fromHost: [ + { name: destKeys.PrimaryFontColor, value: 0 }, + { name: destKeys.PrimaryBackgroundColor, value: 1 }, + { name: destKeys.SecondaryFontColor, value: 2 }, + { name: destKeys.SecondaryBackgroundColor, value: 3 } + ], + isComplexType: true +}); +parameterMap.define({ + type: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.DocumentTheme, value: parameterMap.self } + ], + isComplexType: true +}); +parameterMap.define({ + type: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OfficeTheme, value: parameterMap.self } + ], + isComplexType: true +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs = function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); + + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { ActiveViewChangedEvent: "ActiveViewChangedEvent" }); +Microsoft.Office.WebExtension.ActiveView = { + Read: "read", + Edit: "edit" +}; +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + ActiveViewChanged: "activeViewChanged" +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetActiveViewAsync: "getActiveViewAsync" +}); +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + var data = response[Microsoft.Office.WebExtension.Parameters.ActiveView]; + return data == undefined ? null : data; + } +}); +OSF.DDA.ActiveViewChangedEventArgs = function OSF_DDA_ActiveViewChangedEventArgs(activeView) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ActiveViewChanged + }, + "activeView": { + value: activeView.activeView + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.ActiveView, + fromHost: [ + { name: 0, value: Microsoft.Office.WebExtension.ActiveView.Read }, + { name: 1, value: Microsoft.Office.WebExtension.ActiveView.Edit } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidActiveViewChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.PowerPointDocument = function OSF_DDA_PowerPointDocument(officeAppContext, settings) { + OSF.DDA.PowerPointDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + OSF.DDA.AsyncMethodNames.GetActiveViewAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + OSF.DDA.AsyncMethodNames.GoToByIdAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged, + Microsoft.Office.WebExtension.EventType.ActiveViewChanged + ])); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.PowerPointDocument, OSF.DDA.Document); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.PowerPointDocument(appContext, this._initializeSettings(false)); + appReady(); +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$PowerPointWin32_prepareRightBeforeWebExtensionInitialize(appContext) { + var license = new OSF.DDA.License(appContext.get_eToken()); + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, OSF.DDA.OfficeTheme.getOfficeTheme)); + var reason = appContext.get_reason(); + reason = OSF.DDA.RichInitializationReason[reason]; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.DispIdHost.getClientDelegateMethods, OSF.DDA.SafeArray.Delegate.ParameterMap)); + var themeHandler = new OSF.DDA.Theming.InternalThemeHandler(); + themeHandler.InitializeAndChangeOnce(); + Microsoft.Office.WebExtension.initialize(reason); +}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-win32-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-win32-16.00.js new file mode 100644 index 000000000..ecaf0d878 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpoint-win32-16.00.js @@ -0,0 +1,11 @@ +/* PowerPoint specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b0&&b.push(c)}}}catch(i){}return b}var c=[],b={};b[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,b=1;return {toHost:function(a){if(typeof a!="string"&&a[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=a[OSF.DDA.TableDataProperties.TableRows];d[b]=a[OSF.DDA.TableDataProperties.TableHeaders];a=d}return a},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=a(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=a(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=a(d[b])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,b);this.unpack=function(c,a){var d;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c)){var e=(a||typeof a==="unknown")&&a.toArray;d=e?a.toArray():a||{}}else if(this.isDynamicType(c))d=b[c].fromHost(a);else d=a;return d}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(a){function c(a){var b=a;if(OSF.OUtil.isArray(a))for(var f=b.length,d=0;d2){c=[];for(var g=1;g40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e4*1024*1024)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return b},onSucceeded:function(a,c,b){return new OSF.DDA.File(a[OSF.DDA.FileProperties.Handle],a[OSF.DDA.FileProperties.FileSize],b[Microsoft.Office.WebExtension.Parameters.SliceSize])}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(b,a){return a[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(a,d,c){var b=a[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(b<0||b>=d.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;a[OSF.DDA.FileSliceOffset]=parseInt((b*c[OSF.DDA.FileProperties.SliceSize]).toString());return a},onSucceeded:function(a,d,c){var b={};OSF.OUtil.defineEnumerableProperties(b,{data:{value:a[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:c[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:a[OSF.DDA.FileProperties.SliceSize]}});return b}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileProperties.FileSize,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:0},{name:OSF.DDA.FileProperties.SliceSize,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:0},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:5},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:6}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:0}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileSliceOffset,value:1},{name:OSF.DDA.FileProperties.SliceSize,value:2}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0}]});OSF.DDA.AsyncMethodNames.addNames({GetSelectedDataAsync:"getSelectedDataAsync",SetSelectedDataAsync:"setSelectedDataAsync"});(function(){function a(b,d,c){var a=b[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&a&&(a[OSF.DDA.TableDataProperties.TableRows]!=undefined||a[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))a=OSF.DDA.OMFactory.manufactureTableData(a);a=OSF.DDA.DataCoercion.coerceData(a,c[Microsoft.Office.WebExtension.Parameters.CoercionType]);return a==undefined?null:a}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,"enum":Microsoft.Office.WebExtension.CoercionType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}}],privateStateCallbacks:[],onSucceeded:a});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}}],privateStateCallbacks:[]})})();OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:1},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:0},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:1},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:2},{name:Microsoft.Office.WebExtension.GoToType.Index,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:0},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:1},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:1},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:2}]});OSF.DDA.SettingsManager={SerializedSettings:"serializedSettings",DateJSONPrefix:"Date(",DataJSONSuffix:")",serializeSettings:function(b){var d={};for(var c in b){var a=b[c];try{if(JSON)a=JSON.stringify(a,function(a,b){return OSF.OUtil.isDate(this[a])?OSF.DDA.SettingsManager.DateJSONPrefix+this[a].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix:b});else a=Sys.Serialization.JavaScriptSerializer.serialize(a);d[c]=a}catch(e){}}return d},deserializeSettings:function(b){var d={};b=b||{};for(var c in b){var a=b[c];try{if(JSON)a=JSON.parse(a,function(c,a){var b;if(typeof a==="string"&&a&&a.length>6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(a){this._eventHandlers={};for(var c in a){var b=a[c];this._eventHandlers[b]=[]}};OSF.EventDispatch.prototype={getSupportedEvents:function(){var a=[];for(var b in this._eventHandlers)a.push(b);return a},supportsEvent:function(c){var a=false;for(var b in this._eventHandlers)if(c==b){a=true;break}return a},hasEventHandler:function(b,c){var a=this._eventHandlers[b];if(a&&a.length>0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SettingsManager.SerializedSettings},{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});OSF.DDA.AsyncMethodNames.addNames({GetOfficeThemeAsync:"getOfficeThemeAsync",GetDocumentThemeAsync:"getDocumentThemeAsync"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{OfficeThemeChanged:"officeThemeChanged",DocumentThemeChanged:"documentThemeChanged"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.Parameters,{DocumentTheme:"documentTheme",OfficeTheme:"officeTheme"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DocumentThemeChangedEvent:"DocumentThemeChangedEvent",OfficeThemeChangedEvent:"OfficeThemeChangedEvent"});OSF.OUtil.setNamespace("Theming",OSF.DDA);OSF.DDA.Theming.OfficeThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor"};OSF.DDA.Theming.DocumentThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor",Accent1:"accent1",Accent2:"accent2",Accent3:"accent3",Accent4:"accent4",Accent5:"accent5",Accent6:"accent6",Hyperlink:"hyperlink",FollowedHyperlink:"followedHyperlink",HeaderLatinFont:"headerLatinFont",HeaderEastAsianFont:"headerEastAsianFont",HeaderScriptFont:"headerScriptFont",HeaderLocalizedFont:"headerLocalizedFont",BodyLatinFont:"bodyLatinFont",BodyEastAsianFont:"bodyEastAsianFont",BodyScriptFont:"bodyScriptFont",BodyLocalizedFont:"bodyLocalizedFont"};OSF.DDA.Theming.ConvertToDocumentTheme=function(f){var b=false,a=true;for(var d=[{name:"primaryFontColor",needToConvertToHex:a},{name:"primaryBackgroundColor",needToConvertToHex:a},{name:"secondaryFontColor",needToConvertToHex:a},{name:"secondaryBackgroundColor",needToConvertToHex:a},{name:"accent1",needToConvertToHex:a},{name:"accent2",needToConvertToHex:a},{name:"accent3",needToConvertToHex:a},{name:"accent4",needToConvertToHex:a},{name:"accent5",needToConvertToHex:a},{name:"accent6",needToConvertToHex:a},{name:"hyperlink",needToConvertToHex:a},{name:"followedHyperlink",needToConvertToHex:a},{name:"headerLatinFont",needToConvertToHex:b},{name:"headerEastAsianFont",needToConvertToHex:b},{name:"headerScriptFont",needToConvertToHex:b},{name:"headerLocalizedFont",needToConvertToHex:b},{name:"bodyLatinFont",needToConvertToHex:b},{name:"bodyEastAsianFont",needToConvertToHex:b},{name:"bodyScriptFont",needToConvertToHex:b},{name:"bodyLocalizedFont",needToConvertToHex:b}],e={},c=0;c=WebkitScriptMessaging.MESSAGE_TIME_DELTA)) { + invokePostMessage(); + this.lastMessageTimestamp=currentTimestamp; + } else { + this.lastMessageTimestamp+=WebkitScriptMessaging.MESSAGE_TIME_DELTA; + setTimeout(function () { + invokePostMessage(); + }, this.lastMessageTimestamp - currentTimestamp); + } + return correlationId; + }; + WebkitScriptMessaging.prototype.generateCorrelationId=function () { +++this.callingIndex; + return this.conversationId+this.callingIndex; + }; + WebkitScriptMessaging.getCurrentTimeMS=function () { + return (new Date).getTime(); + }; + WebkitScriptMessaging.MESSAGE_TIME_DELTA=10; + return WebkitScriptMessaging; + })(); + ScriptMessaging.WebkitScriptMessaging=WebkitScriptMessaging; + })(OSFWebkit.ScriptMessaging || (OSFWebkit.ScriptMessaging={})); + var ScriptMessaging=OSFWebkit.ScriptMessaging; +})(OSFWebkit || (OSFWebkit={})); +OSF.ScriptMessaging=OSFWebkit.ScriptMessaging; +var OSFWebkit; +(function (OSFWebkit) { + OSFWebkit.MessageHandlerName="Agave"; + (function (AppContextProperties) { + AppContextProperties[AppContextProperties["Settings"]=0]="Settings"; + AppContextProperties[AppContextProperties["SolutionReferenceId"]=1]="SolutionReferenceId"; + AppContextProperties[AppContextProperties["AppType"]=2]="AppType"; + AppContextProperties[AppContextProperties["MajorVersion"]=3]="MajorVersion"; + AppContextProperties[AppContextProperties["MinorVersion"]=4]="MinorVersion"; + AppContextProperties[AppContextProperties["RevisionVersion"]=5]="RevisionVersion"; + AppContextProperties[AppContextProperties["APIVersionSequence"]=6]="APIVersionSequence"; + AppContextProperties[AppContextProperties["AppCapabilities"]=7]="AppCapabilities"; + AppContextProperties[AppContextProperties["APPUILocale"]=8]="APPUILocale"; + AppContextProperties[AppContextProperties["AppDataLocale"]=9]="AppDataLocale"; + AppContextProperties[AppContextProperties["BindingCount"]=10]="BindingCount"; + AppContextProperties[AppContextProperties["DocumentUrl"]=11]="DocumentUrl"; + AppContextProperties[AppContextProperties["ActivationMode"]=12]="ActivationMode"; + AppContextProperties[AppContextProperties["ControlIntegrationLevel"]=13]="ControlIntegrationLevel"; + AppContextProperties[AppContextProperties["SolutionToken"]=14]="SolutionToken"; + AppContextProperties[AppContextProperties["APISetVersion"]=15]="APISetVersion"; + AppContextProperties[AppContextProperties["CorrelationId"]=16]="CorrelationId"; + AppContextProperties[AppContextProperties["InstanceId"]=17]="InstanceId"; + })(OSFWebkit.AppContextProperties || (OSFWebkit.AppContextProperties={})); + var AppContextProperties=OSFWebkit.AppContextProperties; + (function (MethodId) { + MethodId[MethodId["Execute"]=1]="Execute"; + MethodId[MethodId["RegisterEvent"]=2]="RegisterEvent"; + MethodId[MethodId["UnregisterEvent"]=3]="UnregisterEvent"; + MethodId[MethodId["WriteSettings"]=4]="WriteSettings"; + MethodId[MethodId["GetContext"]=5]="GetContext"; + })(OSFWebkit.MethodId || (OSFWebkit.MethodId={})); + var MethodId=OSFWebkit.MethodId; + var WebkitHostController=(function () { + function WebkitHostController(hostScriptProxy) { + this.hostScriptProxy=hostScriptProxy; + } + WebkitHostController.prototype.execute=function (id, params, callback) { + var args=params; + if (args==null) { + args=[]; + } + var hostParams={ + id: id, + apiArgs: args + }; + var agaveResponseCallback=function (payload) { + var safeArraySource=payload; + if (OSF.OUtil.isArray(payload) && payload.length >=2) { + var hrStatus=payload[0]; + safeArraySource=payload[1]; + } + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.Execute, hostParams, agaveResponseCallback); + }; + WebkitHostController.prototype.registerEvent=function (id, targetId, handler, callback) { + var agaveEventHandlerCallback=function (payload) { + var safeArraySource=payload; + var eventId=0; + if (OSF.OUtil.isArray(payload) && payload.length >=2) { + safeArraySource=payload[0]; + eventId=payload[1]; + } + if (handler) { + handler(eventId, new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + var agaveResponseCallback=function (payload) { + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(payload)); + } + }; + this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.RegisterEvent, id, targetId, agaveEventHandlerCallback, agaveResponseCallback); + }; + WebkitHostController.prototype.unregisterEvent=function (id, targetId, callback) { + var agaveResponseCallback=function (response) { + callback(new OSFWebkit.WebkitSafeArray(response)); + }; + this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.UnregisterEvent, id, targetId, agaveResponseCallback); + }; + return WebkitHostController; + })(); + OSFWebkit.WebkitHostController=WebkitHostController; +})(OSFWebkit || (OSFWebkit={})); +OSF.Webkit=OSFWebkit; +OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger()); +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +} +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed" +}; +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], + privateState + ); +} +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() { + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id]=dispatch; + } + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], + partId + ); +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], + handle + ); +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.RichClientSettingsManager=(function OSF_DDA$RichClientSettingsManager() { + return { + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onComplete) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper(); + var onReceivedContext=function onReceivedContext(appContext) { + if (onComplete) { + onComplete(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, appContext.get_settings()); + } + }; + OSF._OfficeAppFactory.getWebkitAppContext(null, onReceivedContext); + }, + write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onComplete) { + var hostParams={}; + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + hostParams["keys"]=keys; + hostParams["values"]=values; + if (onCalling) { + onCalling(); + } + var onWriteCompleted=function onWriteCompleted(status) { + if (onComplete) { + onComplete(status[0], null); + } + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.WriteSettings, hostParams, onWriteCompleted); + } + }; +})(); +OSF._OfficeAppFactory.getWebkitAppContext=function OSF__OfficeAppFactory$getWebkitAppContext(wnd, gotAppContext) { + var getInvocationCallback=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(appContext) { + var returnedContext; + var appContextProperties=OSF.Webkit.AppContextProperties; + var appType=appContext[appContextProperties.AppType]; + var appTypeSupported=false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry]==appType) { + appTypeSupported=true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type "+appType; + } + var hostSettings=appContext[appContextProperties.Settings]; + var serializedSettings={}; + var keys=hostSettings[0]; + var values=hostSettings[1]; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + var id=appContext[appContextProperties.SolutionReferenceId]; + var version=appContext[appContextProperties.MajorVersion]; + var clientMode=appContext[appContextProperties.AppCapabilities]; + var UILocale=appContext[appContextProperties.APPUILocale]; + var dataLocale=appContext[appContextProperties.AppDataLocale]; + var docUrl=appContext[appContextProperties.DocumentUrl]; + var reason=appContext[appContextProperties.ActivationMode]; + var osfControlType=appContext[appContextProperties.ControlIntegrationLevel]; + var eToken=appContext[appContextProperties.SolutionToken]; + eToken=eToken ? eToken.toString() : ""; + var correlationId=appContext[appContextProperties.CorrelationId]; + returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, serializedSettings, reason, osfControlType, eToken, correlationId); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.GetContext, [], getInvocationCallback); +} +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + var onComplete=function onComplete(status, response) { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + try { + hostDelegateMethod(args.hostCallArgs, args.onCalling, onComplete); + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name: Strings.OfficeOM.L_InternalError, message: ex }; + onComplete(status, response); + } + }; + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving); + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.write( + hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], + hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], + onCalling, + onReceiving + ); + } + switch (actionId) { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break; + } + return delegateMethods; +} +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.FileType, { + Compressed: "compressed" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType, { + Text: "text" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.EventType, { + DocumentSelectionChanged: "documentSelectionChanged" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.ValueFormat, { + Unformatted: "unformatted" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.FilterType, { + All: "all" +}); +delete Microsoft.Office.WebExtension.BindingType; +delete Microsoft.Office.WebExtension.select; +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if (rows==1 && cols==1) { + ret=[vbArr]; + } else { + ret=[]; + for (var row=0; row < rows; row++) { + var rowArr=[]; + for (var col=0; col < cols; col++) { + var datum=vbArr[row * cols+col]; + if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + OSF.ClientHostController.execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.PowerPointDocument=function OSF_DDA_PowerPointDocument(officeAppContext, settings) { + OSF.DDA.PowerPointDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.PowerPointDocument, OSF.DDA.Document); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpointios-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpointios-15.js new file mode 100644 index 000000000..c792b6f1f --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/powerpointios-15.js @@ -0,0 +1,11 @@ +/* PowerPoint iOS specific API library */ +/* Version: 15.0.4420.1017 Build Time: 05/04/2015 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var OSF=OSF||{},OSFWebkit;(function(b){var a=function(){var a=false;function b(a){this.data=a;this.safeArrayFlag=this.isSafeArray(a)}b.prototype.dimensions=function(){var a=0;if(this.safeArrayFlag)a=this.data[0][0];else if(this.isArray())a=2;return a};b.prototype.getItem=function(){var b=[],a=null;if(this.safeArrayFlag)b=this.toArray();else b=this.data;a=b;for(var c=0;c=a.MESSAGE_TIME_DELTA){f();b.lastMessageTimestamp=d}else{b.lastMessageTimestamp+=a.MESSAGE_TIME_DELTA;setTimeout(function(){f()},b.lastMessageTimestamp-d)}return e};a.prototype.generateCorrelationId=function(){++this.callingIndex;return this.conversationId+this.callingIndex};a.getCurrentTimeMS=function(){return (new Date).getTime()};a.MESSAGE_TIME_DELTA=10;return a}();b.WebkitScriptMessaging=c})(a.ScriptMessaging||(a.ScriptMessaging={}));var b=a.ScriptMessaging})(OSFWebkit||(OSFWebkit={}));OSF.ScriptMessaging=OSFWebkit.ScriptMessaging;var OSFWebkit;(function(a){a.MessageHandlerName="Agave";(function(a){var j="InstanceId",i="CorrelationId",h="APISetVersion",g="SolutionToken",f="ControlIntegrationLevel",e="ActivationMode",d="DocumentUrl",c="BindingCount",b="AppDataLocale",r="APPUILocale",q="AppCapabilities",p="APIVersionSequence",o="RevisionVersion",n="MinorVersion",m="MajorVersion",l="SolutionReferenceId",k="Settings";a[a[k]=0]=k;a[a[l]=1]=l;a[a["AppType"]=2]="AppType";a[a[m]=3]=m;a[a[n]=4]=n;a[a[o]=5]=o;a[a[p]=6]=p;a[a[q]=7]=q;a[a[r]=8]=r;a[a[b]=9]=b;a[a[c]=10]=c;a[a[d]=11]=d;a[a[e]=12]=e;a[a[f]=13]=f;a[a[g]=14]=g;a[a[h]=15]=h;a[a[i]=16]=i;a[a[j]=17]=j})(a.AppContextProperties||(a.AppContextProperties={}));var c=a.AppContextProperties;(function(a){var e="GetContext",d="WriteSettings",c="UnregisterEvent",b="RegisterEvent";a[a["Execute"]=1]="Execute";a[a[b]=2]=b;a[a[c]=3]=c;a[a[d]=4]=d;a[a[e]=5]=e})(a.MethodId||(a.MethodId={}));var d=a.MethodId,b=function(){function b(a){this.hostScriptProxy=a}b.prototype.execute=function(g,f,c){var b=f;if(b==null)b=[];var e={id:g,apiArgs:b},d=function(b){var d=b;if(OSF.OUtil.isArray(b)&&b.length>=2){var e=b[0];d=b[1]}c&&c(new a.WebkitSafeArray(d))};this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.Execute,e,d)};b.prototype.registerEvent=function(g,f,c,b){var d=function(b){var d=b,e=0;if(OSF.OUtil.isArray(b)&&b.length>=2){d=b[0];e=b[1]}c&&c(e,new a.WebkitSafeArray(d))},e=function(c){b&&b(new a.WebkitSafeArray(c))};this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.RegisterEvent,g,f,d,e)};b.prototype.unregisterEvent=function(e,d,c){var b=function(b){c(new a.WebkitSafeArray(b))};this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.UnregisterEvent,e,d,b)};return b}();a.WebkitHostController=b})(OSFWebkit||(OSFWebkit={}));OSF.Webkit=OSFWebkit;OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger());OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.File=function(e,c,b){OSF.OUtil.defineEnumerableProperties(this,{size:{value:c},sliceCount:{value:Math.ceil(c/b)}});var a={};a[OSF.DDA.FileProperties.Handle]=e;a[OSF.DDA.FileProperties.SliceSize]=b;var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDocumentCopyChunkAsync,d.ReleaseDocumentCopyAsync],a)};OSF.DDA.FileSliceOffset="fileSliceoffset";OSF.DDA.CustomXmlParts=function(){this._eventDispatches=[];var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartAsync,a.GetDataPartByIdAsync,a.GetDataPartsByNameSpaceAsync])};OSF.DDA.CustomXmlPart=function(f,b,g){OSF.OUtil.defineEnumerableProperties(this,{builtIn:{value:g},id:{value:b},namespaceManager:{value:new OSF.DDA.CustomXmlPrefixMappings(b)}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[c.DeleteDataPartAsync,c.GetPartNodesAsync,c.GetPartXmlAsync]);var e=f._eventDispatches,a=e[b];if(!a){var d=Microsoft.Office.WebExtension.EventType;a=new OSF.EventDispatch([d.DataNodeDeleted,d.DataNodeInserted,d.DataNodeReplaced]);e[b]=a}OSF.DDA.DispIdHost.addEventSupport(this,a)};OSF.DDA.CustomXmlPrefixMappings=function(b){var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartNamespaceAsync,a.GetDataPartNamespaceAsync,a.GetDataPartPrefixAsync],b)};OSF.DDA.CustomXmlNode=function(d,c,e,b){OSF.OUtil.defineEnumerableProperties(this,{baseName:{value:b},namespaceUri:{value:e},nodeType:{value:c}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.GetRelativeNodesAsync,a.GetNodeValueAsync,a.GetNodeXmlAsync,a.SetNodeValueAsync,a.SetNodeXmlAsync],d)};OSF.DDA.NodeInsertedEventArgs=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeInserted},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeReplacedEventArgs=function(c,b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeReplaced},oldNode:{value:c},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeDeletedEventArgs=function(c,a,b){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeDeleted},oldNode:{value:c},oldNextSibling:{value:a},inUndoRedo:{value:b}})};OSF.DDA.RichClientSettingsManager=function(){return {read:function(b,a){var f=[],e=[];b&&b();var d=OSF._OfficeAppFactory.getInitializationHelper(),c=function(b){a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,b.get_settings())};OSF._OfficeAppFactory.getWebkitAppContext(null,c)},write:function(b,i,d,c){var a={},f=[],e=[];for(var g in b){f.push(g);e.push(b[g])}a["keys"]=f;a["values"]=e;d&&d();var h=function(a){c&&c(a[0],null)};OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.WriteSettings,a,h)}}}();OSF._OfficeAppFactory.getWebkitAppContext=function(c,b){var a=function(c){var f,a=OSF.Webkit.AppContextProperties,g=c[a.AppType],i=false;for(var p in OSF.AppName)if(OSF.AppName[p]==g){i=true;break}if(!i)throw"Unsupported client type "+g;for(var j=c[a.Settings],h={},k=j[0],u=j[1],e=0;e0&&b.push(c)}}}catch(i){}return b}var c=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,a=1;return {toHost:function(b){if(typeof b!="string"&&b[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=b[OSF.DDA.TableDataProperties.TableRows];d[a]=b[OSF.DDA.TableDataProperties.TableHeaders];b=d}return b},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=b(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=b(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=b(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,a);this.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};this.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var e=true,f=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=f.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode, + Microsoft.Office.Internal.Parameters.OfficeTheme, + Microsoft.Office.Internal.Parameters.DocumentTheme + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; + this.dynamicTypes=dynamicTypes; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.FilePropertiesDescriptor; + define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: ns.Url, value: 0 } + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: 0} + ] + }) + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 }, + { name: ns.SlideRange, value:7 } + ] + }); + ns=Microsoft.Office.WebExtension.GoToType; + define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: ns.Binding, value: 0 }, + { name: ns.NamedItem, value: 1 }, + { name: ns.Slide, value: 2 }, + { name: ns.Index, value: 3 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 }, + { name: ns.Pdf, value: 6 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.Internal.OfficeTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.OfficeTheme, + fromHost: [ + {name: ns.PrimaryFontColor, value: 0}, + {name: ns.PrimaryBackgroundColor, value: 1}, + {name: ns.SecondaryFontColor, value:2}, + {name: ns.SecondaryBackgroundColor, value:3} + ] + }) + } + ns=Microsoft.Office.WebExtension.ActiveView; + if (ns) { + define({ + type:Microsoft.Office.WebExtension.Parameters.ActiveView, + fromHost: [ + {name: 0, value: ns.Read}, + {name: 1, value: ns.Edit} + ] + }) + } + ns=Microsoft.Office.Internal.DocumentTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.DocumentTheme, + fromHost: [ + {name: ns.PrimaryBackgroundColor, value: 0}, + {name: ns.PrimaryFontColor, value: 1}, + {name: ns.SecondaryBackgroundColor, value: 2}, + {name: ns.SecondaryFontColor, value: 3}, + {name: ns.Accent1, value: 4}, + {name: ns.Accent2, value: 5}, + {name: ns.Accent3, value: 6}, + {name: ns.Accent4, value: 7}, + {name: ns.Accent5, value: 8}, + {name: ns.Accent6, value: 9}, + {name: ns.Hyperlink, value: 10}, + {name: ns.FollowedHyperlink, value: 11}, + {name: ns.HeaderLatinFont, value: 12}, + {name: ns.HeaderEastAsianFont, value: 13}, + {name: ns.HeaderScriptFont, value: 14}, + {name: ns.HeaderLocalizedFont, value: 15}, + {name: ns.BodyLatinFont, value: 16}, + {name: ns.BodyEastAsianFont, value: 17}, + {name: ns.BodyScriptFont, value: 18}, + {name: ns.BodyLocalizedFont, value: 19} + ] + }) + } + ns=Microsoft.Office.WebExtension.SelectionMode; + define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: ns.Default, value: 0 }, + { name: ns.Selected, value: 1 }, + { name: ns.None, value: 2 }, + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidNavigateToMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.GoToType, value: 1 }, + { name: ns.SelectionMode, value: 2 } + ] + }); + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidClearFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidSetTableOptionsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.TableOptions, value: 1 }, + ] + }); + define({ + type: cns.dispidSetFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CellFormat, value: 1 }, + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: self } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDocumentThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidOfficeThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidActiveViewChangedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + parameterMap.define=define; + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +Microsoft.Office.WebExtension.ProjectTaskFields={ + ActualCost: 0, + ActualDuration: 1, + ActualFinish: 2, + ActualOvertimeCost: 3, + ActualOvertimeWork: 4, + ActualStart: 5, + ActualWork: 6, + Text1: 7, + Text10: 8, + Finish10: 9, + Start10: 10, + Text11: 11, + Text12: 12, + Text13: 13, + Text14: 14, + Text15: 15, + Text16: 16, + Text17: 17, + Text18: 18, + Text19: 19, + Finish1: 20, + Start1: 21, + Text2: 22, + Text20: 23, + Text21: 24, + Text22: 25, + Text23: 26, + Text24: 27, + Text25: 28, + Text26: 29, + Text27: 30, + Text28: 31, + Text29: 32, + Finish2: 33, + Start2: 34, + Text3: 35, + Text30: 36, + Finish3: 37, + Start3: 38, + Text4: 39, + Finish4: 40, + Start4: 41, + Text5: 42, + Finish5: 43, + Start5: 44, + Text6: 45, + Finish6: 46, + Start6: 47, + Text7: 48, + Finish7: 49, + Start7: 50, + Text8: 51, + Finish8: 52, + Start8: 53, + Text9: 54, + Finish9: 55, + Start9: 56, + Baseline10BudgetCost: 57, + Baseline10BudgetWork: 58, + Baseline10Cost: 59, + Baseline10Duration: 60, + Baseline10Finish: 61, + Baseline10FixedCost: 62, + Baseline10FixedCostAccrual: 63, + Baseline10Start: 64, + Baseline10Work: 65, + Baseline1BudgetCost: 66, + Baseline1BudgetWork: 67, + Baseline1Cost: 68, + Baseline1Duration: 69, + Baseline1Finish: 70, + Baseline1FixedCost: 71, + Baseline1FixedCostAccrual: 72, + Baseline1Start: 73, + Baseline1Work: 74, + Baseline2BudgetCost: 75, + Baseline2BudgetWork: 76, + Baseline2Cost: 77, + Baseline2Duration: 78, + Baseline2Finish: 79, + Baseline2FixedCost: 80, + Baseline2FixedCostAccrual: 81, + Baseline2Start: 82, + Baseline2Work: 83, + Baseline3BudgetCost: 84, + Baseline3BudgetWork: 85, + Baseline3Cost: 86, + Baseline3Duration: 87, + Baseline3Finish: 88, + Baseline3FixedCost: 89, + Baseline3FixedCostAccrual: 90, + Basline3Start: 91, + Baseline3Work: 92, + Baseline4BudgetCost: 93, + Baseline4BudgetWork: 94, + Baseline4Cost: 95, + Baseline4Duration: 96, + Baseline4Finish: 97, + Baseline4FixedCost: 98, + Baseline4FixedCostAccrual: 99, + Baseline4Start: 100, + Baseline4Work: 101, + Baseline5BudgetCost: 102, + Baseline5BudgetWork: 103, + Baseline5Cost: 104, + Baseline5Duration: 105, + Baseline5Finish: 106, + Baseline5FixedCost: 107, + Baseline5FixedCostAccrual: 108, + Baseline5Start: 109, + Baseline5Work: 110, + Baseline6BudgetCost: 111, + Baseline6BudgetWork: 112, + Baseline6Cost: 113, + Baseline6Duration: 114, + Baseline6Finish: 115, + Baseline6FixedCost: 116, + Baseline6FixedCostAccrual: 117, + Baseline6Start: 118, + Baseline6Work: 119, + Baseline7BudgetCost: 120, + Baseline7BudgetWork: 121, + Baseline7Cost: 122, + Baseline7Duration: 123, + Baseline7Finish: 124, + Baseline7FixedCost: 125, + Baseline7FixedCostAccrual: 126, + Baseline7Start: 127, + Baseline7Work: 128, + Baseline8BudgetCost: 129, + Baseline8BudgetWork: 130, + Baseline8Cost: 131, + Baseline8Duration: 132, + Baseline8Finish: 133, + Baseline8FixedCost: 134, + Baseline8FixedCostAccrual: 135, + Baseline8Start: 136, + Baseline8Work: 137, + Baseline9BudgetCost: 138, + Baseline9BudgetWork: 139, + Baseline9Cost: 140, + Baseline9Duration: 141, + Baseline9Finish: 142, + Baseline9FixedCost: 143, + Baseline9FixedCostAccrual: 144, + Baseline9Start: 145, + Baseline9Work: 146, + BaselineBudgetCost: 147, + BaselineBudgetWork: 148, + BaselineCost: 149, + BaselineDuration: 150, + BaselineFinish: 151, + BaselineFixedCost: 152, + BaselineFixedCostAccrual: 153, + BaselineStart: 154, + BaselineWork: 155, + BudgetCost: 156, + BudgetWork: 157, + TaskCalendarGUID: 158, + ConstraintDate: 159, + ConstraintType: 160, + Cost1: 161, + Cost10: 162, + Cost2: 163, + Cost3: 164, + Cost4: 165, + Cost5: 166, + Cost6: 167, + Cost7: 168, + Cost8: 169, + Cost9: 170, + Date1: 171, + Date10: 172, + Date2: 173, + Date3: 174, + Date4: 175, + Date5: 176, + Date6: 177, + Date7: 178, + Date8: 179, + Date9: 180, + Deadline: 181, + Duration1: 182, + Duration10: 183, + Duration2: 184, + Duration3: 185, + Duration4: 186, + Duration5: 187, + Duration6: 188, + Duration7: 189, + Duration8: 190, + Duration9: 191, + Duration: 192, + EarnedValueMethod: 193, + FinishSlack: 194, + FixedCost: 195, + FixedCostAccrual: 196, + Flag10: 197, + Flag1: 198, + Flag11: 199, + Flag12: 200, + Flag13: 201, + Flag14: 202, + Flag15: 203, + Flag16: 204, + Flag17: 205, + Flag18: 206, + Flag19: 207, + Flag2: 208, + Flag20: 209, + Flag3: 210, + Flag4: 211, + Flag5: 212, + Flag6: 213, + Flag7: 214, + Flag8: 215, + Flag9: 216, + FreeSlack: 217, + HasRollupSubTasks: 218, + ID: 219, + Name: 220, + Notes: 221, + Number1: 222, + Number10: 223, + Number11: 224, + Number12: 225, + Number13: 226, + Number14: 227, + Number15: 228, + Number16: 229, + Number17: 230, + Number18: 231, + Number19: 232, + Number2: 233, + Number20: 234, + Number3: 235, + Number4: 236, + Number5: 237, + Number6: 238, + Number7: 239, + Number8: 240, + Number9: 241, + ScheduledDuration: 242, + ScheduledFinish: 243, + ScheduledStart: 244, + OutlineLevel: 245, + OvertimeCost: 246, + OvertimeWork: 247, + PercentComplete: 248, + PercentWorkComplete: 249, + Predecessors: 250, + PreleveledFinish: 251, + PreleveledStart: 252, + Priority: 253, + Active: 254, + Critical: 255, + Milestone: 256, + Overallocated: 257, + IsRollup: 258, + Summary: 259, + RegularWork: 260, + RemainingCost: 261, + RemainingDuration: 262, + RemainingOvertimeCost: 263, + RemainingWork: 264, + ResourceNames: 265, + ResourceNames: 266, + Cost: 267, + Finish: 268, + Start: 269, + Work: 270, + StartSlack: 271, + Status: 272, + Successors: 273, + StatusManager: 274, + TotalSlack: 275, + TaskGUID: 276, + Type: 277, + WBS: 278, + WBSPREDECESSORS: 279, + WBSSUCCESSORS: 280, + WSSID: 281 +} +Microsoft.Office.WebExtension.ProjectResourceFields={ + Accrual: 0, + ActualCost: 1, + ActualOvertimeCost: 2, + ActualOvertimeWork: 3, + ActualOvertimeWorkProtected: 4, + ActualWork: 5, + ActualWorkProtected: 6, + BaseCalendar: 7, + Baseline10BudgetCost: 8, + Baseline10BudgetWork: 9, + Baseline10Cost: 10, + Baseline10Work: 11, + Baseline1BudgetCost: 12, + Baseline1BudgetWork: 13, + Baseline1Cost: 14, + Baseline1Work: 15, + Baseline2BudgetCost: 16, + Baseline2BudgetWork: 17, + Baseline2Cost: 18, + Baseline2Work: 19, + Baseline3BudgetCost: 20, + Baseline3BudgetWork: 21, + Baseline3Cost: 22, + Baseline3Work: 23, + Baseline4BudgetCost: 24, + Baseline4BudgetWork: 25, + Baseline4Cost: 26, + Baseline4Work: 27, + Baseline5BudgetCost: 28, + Baseline5BudgetWork: 29, + Baseline5Cost: 30, + Baseline5Work: 31, + Baseline6BudgetCost: 32, + Baseline6BudgetWork: 33, + Baseline6Cost: 34, + Baseline6Work: 35, + Baseline7BudgetCost: 36, + Baseline7BudgetWork: 37, + Baseline7Cost: 38, + Baseline7Work: 39, + Baseline8BudgetCost: 40, + Baseline8BudgetWork: 41, + Baseline8Cost: 42, + Baseline8Work: 43, + Baseline9BudgetCost: 44, + Baseline9BudgetWork: 45, + Baseline9Cost: 46, + Baseline9Work: 47, + BaselineBudgetCost: 48, + BaselineBudgetWork: 49, + BaselineCost: 50, + BaselineWork: 51, + BudgetCost: 52, + BudgetWork: 53, + ResourceCalendarGUID: 54, + Code: 55, + Cost1: 56, + Cost10: 57, + Cost2: 58, + Cost3: 59, + Cost4: 60, + Cost5: 61, + Cost6: 62, + Cost7: 63, + Cost8: 64, + Cost9: 65, + ResourceCreationDate: 66, + Date1: 67, + Date10: 68, + Date2: 69, + Date3: 70, + Date4: 71, + Date5: 72, + Date6: 73, + Date7: 74, + Date8: 75, + Date9: 76, + Duration1: 77, + Duration10: 78, + Duration2: 79, + Duration3: 80, + Duration4: 81, + Duration5: 82, + Duration6: 83, + Duration7: 84, + Duration8: 85, + Duration9: 86, + Email: 87, + End: 88, + Finish1: 89, + Finish10: 90, + Finish2: 91, + Finish3: 92, + Finish4: 93, + Finish5: 94, + Finish6: 95, + Finish7: 96, + Finish8: 97, + Finish9: 98, + Flag10: 99, + Flag1: 100, + Flag11: 101, + Flag12: 102, + Flag13: 103, + Flag14: 104, + Flag15: 105, + Flag16: 106, + Flag17: 107, + Flag18: 108, + Flag19: 109, + Flag2: 110, + Flag20: 111, + Flag3: 112, + Flag4: 113, + Flag5: 114, + Flag6: 115, + Flag7: 116, + Flag8: 117, + Flag9: 118, + Group: 119, + Units: 120, + Name: 121, + Notes: 122, + Number1: 123, + Number10: 124, + Number11: 125, + Number12: 126, + Number13: 127, + Number14: 128, + Number15: 129, + Number16: 130, + Number17: 131, + Number18: 132, + Number19: 133, + Number2: 134, + Number20: 135, + Number3: 136, + Number4: 137, + Number5: 138, + Number6: 139, + Number7: 140, + Number8: 141, + Number9: 142, + OvertimeCost: 143, + OvertimeRate: 144, + OvertimeWork: 145, + PercentWorkComplete: 146, + CostPerUse: 147, + Generic: 148, + OverAllocated: 149, + RegularWork: 150, + RemainingCost: 151, + RemainingOvertimeCost: 152, + RemainingOvertimeWork: 153, + RemainingWork: 154, + ResourceGUID: 155, + Cost: 156, + Work: 157, + Start: 158, + Start1: 159, + Start10: 160, + Start2: 161, + Start3: 162, + Start4: 163, + Start5: 164, + Start6: 165, + Start7: 166, + Start8: 167, + Start9: 168, + StandardRate: 169, + Text1: 170, + Text10: 171, + Text11: 172, + Text12: 173, + Text13: 174, + Text14: 175, + Text15: 176, + Text16: 177, + Text17: 178, + Text18: 179, + Text19: 180, + Text2: 181, + Text20: 182, + Text21: 183, + Text22: 184, + Text23: 185, + Text24: 186, + Text25: 187, + Text26: 188, + Text27: 189, + Text28: 190, + Text29: 191, + Text3: 192, + Text30: 193, + Text4: 194, + Text5: 195, + Text6: 196, + Text7: 197, + Text8: 198, + Text9: 199 +} +Microsoft.Office.WebExtension.ProjectProjectFields={ + CurrencyDigits: 0, + CurrencySymbol: 1, + CurrencySymbolPosition: 2, + DurationUnits: 3, + GUID: 4, + Finish: 5, + Start: 6, + ReadOnly: 7, + VERSION: 8, + WorkUnits: 9, + ProjectServerUrl: 10, + WSSUrl: 11, + WSSList: 12 +} +OSF.DDA.ProjectDocument=function OSF_DDA_ProjectDocument(officeAppContext) { + OSF.DDA.ProjectDocument.uber.constructor.call(this, + officeAppContext + ); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.GetSelectedTask, + am.GetTask, + am.GetTaskField, + am.GetWSSUrl, + am.GetSelectedResource, + am.GetResourceField, + am.GetProjectField, + am.GetSelectedView + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.TaskSelectionChanged, + Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged, + Microsoft.Office.WebExtension.EventType.ViewSelectionChanged])); +} +OSF.OUtil.extend(OSF.DDA.ProjectDocument, OSF.DDA.Document); +OSF.DDA.TaskSelectionChangedEventArgs=function OSF_DDA_TaskSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.TaskSelectionChanged + }, + "document": { + value: doc + } + }); +} +OSF.DDA.ResourceSelectionChangedEventArgs=function OSF_DDA_ResourceSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged + }, + "document": { + value: doc + } + }); +} +OSF.DDA.ViewSelectionChangedEventArgs=function OSF_DDA_ViewSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ViewSelectionChanged + }, + "document": { + value: doc + } + }); +} + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-15.01.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-15.01.js new file mode 100644 index 000000000..c8b5ebe5e --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-15.01.js @@ -0,0 +1,11 @@ +/* Project specific JavaScript API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +Microsoft.Office.WebExtension.ProjectViewTypes={Gantt:1,NetworkDiagram:2,TaskDiagram:3,TaskForm:4,TaskSheet:5,ResourceForm:6,ResourceSheet:7,ResourceGraph:8,TeamPlanner:9,TaskDetails:10,TaskNameForm:11,ResourceNames:12,Calendar:13,TaskUsage:14,ResourceUsage:15,Timeline:16};OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType,{Text:"text"});OSF.OUtil.redefineList(Microsoft.Office.WebExtension.ValueFormat,{Unformatted:"unformatted"});OSF.OUtil.redefineList(Microsoft.Office.WebExtension.FilterType,{All:"all"});OSF.OUtil.redefineList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged",TaskSelectionChanged:"taskSelectionChanged",ResourceSelectionChanged:"resourceSelectionChanged",ViewSelectionChanged:"viewSelectionChanged"});delete Microsoft.Office.WebExtension.BindingType;delete Microsoft.Office.WebExtension.FileType;delete Microsoft.Office.WebExtension.select;OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.RichClientSettingsManager={read:function(e,d){var b=[],f=[];e&&e();window.external.GetContext().GetSettings().Read(b,f);d&&d();for(var c={},a=0;a0&&b.push(c)}}}catch(i){}return b}var d=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.EventDescriptors.DocumentThemeChangedEvent,OSF.DDA.EventDescriptors.OfficeThemeChangedEvent,OSF.DDA.EventDescriptors.ActiveViewChangedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode,Microsoft.Office.Internal.Parameters.OfficeTheme,Microsoft.Office.Internal.Parameters.DocumentTheme],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var b=0,a=1;return {toHost:function(c){if(typeof c!="string"&&c[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[b]=c[OSF.DDA.TableDataProperties.TableRows];d[a]=c[OSF.DDA.TableDataProperties.TableHeaders];c=d}return c},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=c(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=c(d[b]);e[OSF.DDA.TableDataProperties.TableHeaders]=c(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(b,d,a);b.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};b.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b};b.dynamicTypes=a};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var f=true,e=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=e.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +Microsoft.Office.WebExtension.ProjectTaskFields={ + ActualCost: 0, + ActualDuration: 1, + ActualFinish: 2, + ActualOvertimeCost: 3, + ActualOvertimeWork: 4, + ActualStart: 5, + ActualWork: 6, + Text1: 7, + Text10: 8, + Finish10: 9, + Start10: 10, + Text11: 11, + Text12: 12, + Text13: 13, + Text14: 14, + Text15: 15, + Text16: 16, + Text17: 17, + Text18: 18, + Text19: 19, + Finish1: 20, + Start1: 21, + Text2: 22, + Text20: 23, + Text21: 24, + Text22: 25, + Text23: 26, + Text24: 27, + Text25: 28, + Text26: 29, + Text27: 30, + Text28: 31, + Text29: 32, + Finish2: 33, + Start2: 34, + Text3: 35, + Text30: 36, + Finish3: 37, + Start3: 38, + Text4: 39, + Finish4: 40, + Start4: 41, + Text5: 42, + Finish5: 43, + Start5: 44, + Text6: 45, + Finish6: 46, + Start6: 47, + Text7: 48, + Finish7: 49, + Start7: 50, + Text8: 51, + Finish8: 52, + Start8: 53, + Text9: 54, + Finish9: 55, + Start9: 56, + Baseline10BudgetCost: 57, + Baseline10BudgetWork: 58, + Baseline10Cost: 59, + Baseline10Duration: 60, + Baseline10Finish: 61, + Baseline10FixedCost: 62, + Baseline10FixedCostAccrual: 63, + Baseline10Start: 64, + Baseline10Work: 65, + Baseline1BudgetCost: 66, + Baseline1BudgetWork: 67, + Baseline1Cost: 68, + Baseline1Duration: 69, + Baseline1Finish: 70, + Baseline1FixedCost: 71, + Baseline1FixedCostAccrual: 72, + Baseline1Start: 73, + Baseline1Work: 74, + Baseline2BudgetCost: 75, + Baseline2BudgetWork: 76, + Baseline2Cost: 77, + Baseline2Duration: 78, + Baseline2Finish: 79, + Baseline2FixedCost: 80, + Baseline2FixedCostAccrual: 81, + Baseline2Start: 82, + Baseline2Work: 83, + Baseline3BudgetCost: 84, + Baseline3BudgetWork: 85, + Baseline3Cost: 86, + Baseline3Duration: 87, + Baseline3Finish: 88, + Baseline3FixedCost: 89, + Baseline3FixedCostAccrual: 90, + Basline3Start: 91, + Baseline3Work: 92, + Baseline4BudgetCost: 93, + Baseline4BudgetWork: 94, + Baseline4Cost: 95, + Baseline4Duration: 96, + Baseline4Finish: 97, + Baseline4FixedCost: 98, + Baseline4FixedCostAccrual: 99, + Baseline4Start: 100, + Baseline4Work: 101, + Baseline5BudgetCost: 102, + Baseline5BudgetWork: 103, + Baseline5Cost: 104, + Baseline5Duration: 105, + Baseline5Finish: 106, + Baseline5FixedCost: 107, + Baseline5FixedCostAccrual: 108, + Baseline5Start: 109, + Baseline5Work: 110, + Baseline6BudgetCost: 111, + Baseline6BudgetWork: 112, + Baseline6Cost: 113, + Baseline6Duration: 114, + Baseline6Finish: 115, + Baseline6FixedCost: 116, + Baseline6FixedCostAccrual: 117, + Baseline6Start: 118, + Baseline6Work: 119, + Baseline7BudgetCost: 120, + Baseline7BudgetWork: 121, + Baseline7Cost: 122, + Baseline7Duration: 123, + Baseline7Finish: 124, + Baseline7FixedCost: 125, + Baseline7FixedCostAccrual: 126, + Baseline7Start: 127, + Baseline7Work: 128, + Baseline8BudgetCost: 129, + Baseline8BudgetWork: 130, + Baseline8Cost: 131, + Baseline8Duration: 132, + Baseline8Finish: 133, + Baseline8FixedCost: 134, + Baseline8FixedCostAccrual: 135, + Baseline8Start: 136, + Baseline8Work: 137, + Baseline9BudgetCost: 138, + Baseline9BudgetWork: 139, + Baseline9Cost: 140, + Baseline9Duration: 141, + Baseline9Finish: 142, + Baseline9FixedCost: 143, + Baseline9FixedCostAccrual: 144, + Baseline9Start: 145, + Baseline9Work: 146, + BaselineBudgetCost: 147, + BaselineBudgetWork: 148, + BaselineCost: 149, + BaselineDuration: 150, + BaselineFinish: 151, + BaselineFixedCost: 152, + BaselineFixedCostAccrual: 153, + BaselineStart: 154, + BaselineWork: 155, + BudgetCost: 156, + BudgetWork: 157, + TaskCalendarGUID: 158, + ConstraintDate: 159, + ConstraintType: 160, + Cost1: 161, + Cost10: 162, + Cost2: 163, + Cost3: 164, + Cost4: 165, + Cost5: 166, + Cost6: 167, + Cost7: 168, + Cost8: 169, + Cost9: 170, + Date1: 171, + Date10: 172, + Date2: 173, + Date3: 174, + Date4: 175, + Date5: 176, + Date6: 177, + Date7: 178, + Date8: 179, + Date9: 180, + Deadline: 181, + Duration1: 182, + Duration10: 183, + Duration2: 184, + Duration3: 185, + Duration4: 186, + Duration5: 187, + Duration6: 188, + Duration7: 189, + Duration8: 190, + Duration9: 191, + Duration: 192, + EarnedValueMethod: 193, + FinishSlack: 194, + FixedCost: 195, + FixedCostAccrual: 196, + Flag10: 197, + Flag1: 198, + Flag11: 199, + Flag12: 200, + Flag13: 201, + Flag14: 202, + Flag15: 203, + Flag16: 204, + Flag17: 205, + Flag18: 206, + Flag19: 207, + Flag2: 208, + Flag20: 209, + Flag3: 210, + Flag4: 211, + Flag5: 212, + Flag6: 213, + Flag7: 214, + Flag8: 215, + Flag9: 216, + FreeSlack: 217, + HasRollupSubTasks: 218, + ID: 219, + Name: 220, + Notes: 221, + Number1: 222, + Number10: 223, + Number11: 224, + Number12: 225, + Number13: 226, + Number14: 227, + Number15: 228, + Number16: 229, + Number17: 230, + Number18: 231, + Number19: 232, + Number2: 233, + Number20: 234, + Number3: 235, + Number4: 236, + Number5: 237, + Number6: 238, + Number7: 239, + Number8: 240, + Number9: 241, + ScheduledDuration: 242, + ScheduledFinish: 243, + ScheduledStart: 244, + OutlineLevel: 245, + OvertimeCost: 246, + OvertimeWork: 247, + PercentComplete: 248, + PercentWorkComplete: 249, + Predecessors: 250, + PreleveledFinish: 251, + PreleveledStart: 252, + Priority: 253, + Active: 254, + Critical: 255, + Milestone: 256, + Overallocated: 257, + IsRollup: 258, + Summary: 259, + RegularWork: 260, + RemainingCost: 261, + RemainingDuration: 262, + RemainingOvertimeCost: 263, + RemainingWork: 264, + ResourceNames: 265, + ResourceNames: 266, + Cost: 267, + Finish: 268, + Start: 269, + Work: 270, + StartSlack: 271, + Status: 272, + Successors: 273, + StatusManager: 274, + TotalSlack: 275, + TaskGUID: 276, + Type: 277, + WBS: 278, + WBSPREDECESSORS: 279, + WBSSUCCESSORS: 280, + WSSID: 281 +} +Microsoft.Office.WebExtension.ProjectResourceFields={ + Accrual: 0, + ActualCost: 1, + ActualOvertimeCost: 2, + ActualOvertimeWork: 3, + ActualOvertimeWorkProtected: 4, + ActualWork: 5, + ActualWorkProtected: 6, + BaseCalendar: 7, + Baseline10BudgetCost: 8, + Baseline10BudgetWork: 9, + Baseline10Cost: 10, + Baseline10Work: 11, + Baseline1BudgetCost: 12, + Baseline1BudgetWork: 13, + Baseline1Cost: 14, + Baseline1Work: 15, + Baseline2BudgetCost: 16, + Baseline2BudgetWork: 17, + Baseline2Cost: 18, + Baseline2Work: 19, + Baseline3BudgetCost: 20, + Baseline3BudgetWork: 21, + Baseline3Cost: 22, + Baseline3Work: 23, + Baseline4BudgetCost: 24, + Baseline4BudgetWork: 25, + Baseline4Cost: 26, + Baseline4Work: 27, + Baseline5BudgetCost: 28, + Baseline5BudgetWork: 29, + Baseline5Cost: 30, + Baseline5Work: 31, + Baseline6BudgetCost: 32, + Baseline6BudgetWork: 33, + Baseline6Cost: 34, + Baseline6Work: 35, + Baseline7BudgetCost: 36, + Baseline7BudgetWork: 37, + Baseline7Cost: 38, + Baseline7Work: 39, + Baseline8BudgetCost: 40, + Baseline8BudgetWork: 41, + Baseline8Cost: 42, + Baseline8Work: 43, + Baseline9BudgetCost: 44, + Baseline9BudgetWork: 45, + Baseline9Cost: 46, + Baseline9Work: 47, + BaselineBudgetCost: 48, + BaselineBudgetWork: 49, + BaselineCost: 50, + BaselineWork: 51, + BudgetCost: 52, + BudgetWork: 53, + ResourceCalendarGUID: 54, + Code: 55, + Cost1: 56, + Cost10: 57, + Cost2: 58, + Cost3: 59, + Cost4: 60, + Cost5: 61, + Cost6: 62, + Cost7: 63, + Cost8: 64, + Cost9: 65, + ResourceCreationDate: 66, + Date1: 67, + Date10: 68, + Date2: 69, + Date3: 70, + Date4: 71, + Date5: 72, + Date6: 73, + Date7: 74, + Date8: 75, + Date9: 76, + Duration1: 77, + Duration10: 78, + Duration2: 79, + Duration3: 80, + Duration4: 81, + Duration5: 82, + Duration6: 83, + Duration7: 84, + Duration8: 85, + Duration9: 86, + Email: 87, + End: 88, + Finish1: 89, + Finish10: 90, + Finish2: 91, + Finish3: 92, + Finish4: 93, + Finish5: 94, + Finish6: 95, + Finish7: 96, + Finish8: 97, + Finish9: 98, + Flag10: 99, + Flag1: 100, + Flag11: 101, + Flag12: 102, + Flag13: 103, + Flag14: 104, + Flag15: 105, + Flag16: 106, + Flag17: 107, + Flag18: 108, + Flag19: 109, + Flag2: 110, + Flag20: 111, + Flag3: 112, + Flag4: 113, + Flag5: 114, + Flag6: 115, + Flag7: 116, + Flag8: 117, + Flag9: 118, + Group: 119, + Units: 120, + Name: 121, + Notes: 122, + Number1: 123, + Number10: 124, + Number11: 125, + Number12: 126, + Number13: 127, + Number14: 128, + Number15: 129, + Number16: 130, + Number17: 131, + Number18: 132, + Number19: 133, + Number2: 134, + Number20: 135, + Number3: 136, + Number4: 137, + Number5: 138, + Number6: 139, + Number7: 140, + Number8: 141, + Number9: 142, + OvertimeCost: 143, + OvertimeRate: 144, + OvertimeWork: 145, + PercentWorkComplete: 146, + CostPerUse: 147, + Generic: 148, + OverAllocated: 149, + RegularWork: 150, + RemainingCost: 151, + RemainingOvertimeCost: 152, + RemainingOvertimeWork: 153, + RemainingWork: 154, + ResourceGUID: 155, + Cost: 156, + Work: 157, + Start: 158, + Start1: 159, + Start10: 160, + Start2: 161, + Start3: 162, + Start4: 163, + Start5: 164, + Start6: 165, + Start7: 166, + Start8: 167, + Start9: 168, + StandardRate: 169, + Text1: 170, + Text10: 171, + Text11: 172, + Text12: 173, + Text13: 174, + Text14: 175, + Text15: 176, + Text16: 177, + Text17: 178, + Text18: 179, + Text19: 180, + Text2: 181, + Text20: 182, + Text21: 183, + Text22: 184, + Text23: 185, + Text24: 186, + Text25: 187, + Text26: 188, + Text27: 189, + Text28: 190, + Text29: 191, + Text3: 192, + Text30: 193, + Text4: 194, + Text5: 195, + Text6: 196, + Text7: 197, + Text8: 198, + Text9: 199 +} +Microsoft.Office.WebExtension.ProjectProjectFields={ + CurrencyDigits: 0, + CurrencySymbol: 1, + CurrencySymbolPosition: 2, + DurationUnits: 3, + GUID: 4, + Finish: 5, + Start: 6, + ReadOnly: 7, + VERSION: 8, + WorkUnits: 9, + ProjectServerUrl: 10, + WSSUrl: 11, + WSSList: 12 +} +OSF.DDA.ProjectDocument=function OSF_DDA_ProjectDocument(officeAppContext) { + OSF.DDA.ProjectDocument.uber.constructor.call(this, + officeAppContext + ); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.GetSelectedTask, + am.GetTask, + am.GetTaskField, + am.GetWSSUrl, + am.GetSelectedResource, + am.GetResourceField, + am.GetProjectField, + am.GetSelectedView + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.TaskSelectionChanged, + Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged, + Microsoft.Office.WebExtension.EventType.ViewSelectionChanged])); +} +OSF.OUtil.extend(OSF.DDA.ProjectDocument, OSF.DDA.Document); +OSF.DDA.TaskSelectionChangedEventArgs=function OSF_DDA_TaskSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.TaskSelectionChanged + }, + "document": { + value: doc + } + }); +} +OSF.DDA.ResourceSelectionChangedEventArgs=function OSF_DDA_ResourceSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged + }, + "document": { + value: doc + } + }); +} +OSF.DDA.ViewSelectionChangedEventArgs=function OSF_DDA_ViewSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ViewSelectionChanged + }, + "document": { + value: doc + } + }); +} + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-15.js new file mode 100644 index 000000000..ef99a94f3 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-15.js @@ -0,0 +1,11 @@ +/* Project specific JavaScript API library */ +/* Version: 15.0.4420.1017 Build Time: 03/31/2014 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +Microsoft.Office.WebExtension.ProjectViewTypes={Gantt:1,NetworkDiagram:2,TaskDiagram:3,TaskForm:4,TaskSheet:5,ResourceForm:6,ResourceSheet:7,ResourceGraph:8,TeamPlanner:9,TaskDetails:10,TaskNameForm:11,ResourceNames:12,Calendar:13,TaskUsage:14,ResourceUsage:15,Timeline:16};OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType,{Text:"text"});OSF.OUtil.redefineList(Microsoft.Office.WebExtension.ValueFormat,{Unformatted:"unformatted"});OSF.OUtil.redefineList(Microsoft.Office.WebExtension.FilterType,{All:"all"});OSF.OUtil.redefineList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged",TaskSelectionChanged:"taskSelectionChanged",ResourceSelectionChanged:"resourceSelectionChanged",ViewSelectionChanged:"viewSelectionChanged"});delete Microsoft.Office.WebExtension.BindingType;delete Microsoft.Office.WebExtension.FileType;delete Microsoft.Office.WebExtension.select;OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.RichClientSettingsManager={read:function(e,d){var b=[],f=[];e&&e();window.external.GetContext().GetSettings().Read(b,f);d&&d();for(var c={},a=0;a0&&b.push(c)}}}catch(i){}return b}var c=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,a=1;return {toHost:function(b){if(typeof b!="string"&&b[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=b[OSF.DDA.TableDataProperties.TableRows];d[a]=b[OSF.DDA.TableDataProperties.TableHeaders];b=d}return b},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=b(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=b(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=b(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,a);this.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};this.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var e=true,f=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=f.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + + +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response = { + Status: 0, + Payload: 1 +}; + +OSF.DDA.SafeArray.UniqueArguments = { + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException = function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number = ex.number; + if (number) { + switch (number) { + case -2146828218: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor = function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows = vbArr.ubound(1); + var cols = vbArr.ubound(2); + vbArr = vbArr.toArray(); + if (rows == 1 && cols == 1) { + ret = [vbArr]; + } else { + ret = []; + for (var row = 0; row < rows; row++) { + var rowArr = []; + for (var col = 0; col < cols; col++) { + var datum = vbArr[row * cols + col]; + if (datum != OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes = []; + var dynamicTypes = {}; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = (function () { + var tableRows = 0; + var tableHeaders = 1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data != "string" && data[OSF.DDA.TableDataProperties.TableRows] !== undefined) { + var tableData = []; + tableData[tableRows] = data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders] = data[OSF.DDA.TableDataProperties.TableHeaders]; + data = tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs.toArray) { + var dimensions = hostArgs.dimensions(); + if (dimensions === 2) { + ret = _2DVBArrayToJaggedArray(hostArgs); + } else { + var array = hostArgs.toArray(); + if (array.length === 2 && ((array[0] != null && array[0].toArray) || (array[1] != null && array[1].toArray))) { + ret = {}; + ret[OSF.DDA.TableDataProperties.TableRows] = _2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders] = _2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret = array; + } + } + } else { + ret = hostArgs; + } + return ret; + } + }; + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + + this.unpack = function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + var toArraySupported = (arg || typeof arg === "unknown") && arg.toArray; + value = toArraySupported ? arg.toArray() : arg || {}; + } else if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; + +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); + +OSF.DDA.SafeArray.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [ + { + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 }, + { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 } + ] + }, + { + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 } + ] + } +]); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 }, + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 } + ] +}); +OSF.DDA.SafeArray.Delegate.executeAsync = function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + function toArray(args) { + var arrArgs = args; + if (OSF.OUtil.isArray(args)) { + var len = arrArgs.length; + for (var i = 0; i < len; i++) { + arrArgs[i] = toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs = args.getVarDate(); + } else if (typeof args === "object" && !OSF.OUtil.isArray(args)) { + arrArgs = []; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index] = toArray(args[index]); + } + } + } + return arrArgs; + } + function fromSafeArray(value) { + var ret = value; + if (value != null && value.toArray) { + var arrayResult = value.toArray(); + for (var i = 0; i < arrayResult.length; i++) { + arrayResult[i] = fromSafeArray(arrayResult[i]); + } + ret = arrayResult; + } + return ret; + } + try { + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + var result = hostResponseArgs.toArray(); + var status = result[OSF.DDA.SafeArray.Response.Status]; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) { + var payload = result[OSF.DDA.SafeArray.Response.Payload]; + payload = fromSafeArray(payload); + if (payload != null) { + if (!args._chunkResultData) { + args._chunkResultData = new Array(); + } + + args._chunkResultData[payload[0]] = payload[1]; + } + } else { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload = []; + for (var i = 1; i < result.length; i++) + payload[i - 1] = result[i]; + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + if (args._chunkResultData) { + payload = fromSafeArray(payload); + if (payload != null) { + var expectedChunkCount = payload[payload.length - 1]; + if (args._chunkResultData.length == expectedChunkCount) { + payload[payload.length - 1] = args._chunkResultData; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + } + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + }); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent = function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status = hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync = function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync = function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; + +OSF.ClientMode = { + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason = { + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = this.initializeSettings; +}; +OSF.InitializationHelper.prototype.deserializeSettings = function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) { + var settings; + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = (typeof (JSON) !== "undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = (typeof (JSON) !== "undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface = function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + var license = new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler = (OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler)); + var getDelegateMethods, parameterMap; + getDelegateMethods = OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); +}; +OSF.InitializationHelper.prototype.getInitializationReason = function (appContext) { + return OSF.DDA.RichInitializationReason[appContext.get_reason()]; +}; + +OSF.DDA.DispIdHost.getClientDelegateMethods = function (actionId) { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + + if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId == OSF.DDA.AsyncMethodNames.RefreshAsync.id) { + var readSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings); + } + if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId == OSF.DDA.AsyncMethodNames.SaveAsync.id) { + var writeSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings); + } + return delegateMethods; +}; + +var OSFRichclient; +(function (OSFRichclient) { + var RichClientHostController = (function () { + function RichClientHostController() { + } + RichClientHostController.prototype.execute = function (id, params, callback) { + window.external.Execute(id, params, callback); + }; + RichClientHostController.prototype.registerEvent = function (id, targetId, handler, callback) { + window.external.RegisterEvent(id, targetId, handler, callback); + }; + RichClientHostController.prototype.unregisterEvent = function (id, targetId, callback) { + window.external.UnregisterEvent(id, targetId, callback); + }; + return RichClientHostController; + })(); + OSFRichclient.RichClientHostController = RichClientHostController; +})(OSFRichclient || (OSFRichclient = {})); +OSF.ClientHostController = new OSFRichclient.RichClientHostController(); + +var OfficeExt; +(function (OfficeExt) { + (function (OfficeTheme) { + var OfficeThemeManager = (function () { + function OfficeThemeManager() { + this._osfOfficeTheme = null; + this._osfOfficeThemeTimeStamp = null; + } + OfficeThemeManager.prototype.getOfficeTheme = function () { + if (OSF.DDA._OsfControlContext) { + if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0); + } + } else { + var startTime = (new Date()).getTime(); + var osfOfficeTheme = OSF.DDA._OsfControlContext.GetOfficeThemeInfo(); + var endTime = (new Date()).getTime(); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime)); + } + + this._osfOfficeTheme = JSON.parse(osfOfficeTheme); + for (var color in this._osfOfficeTheme) { + this._osfOfficeTheme[color] = OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]); + } + this._osfOfficeThemeTimeStamp = endTime; + } + return this._osfOfficeTheme; + } + }; + + OfficeThemeManager.instance = function () { + if (OfficeThemeManager._instance == null) { + OfficeThemeManager._instance = new OfficeThemeManager(); + } + return OfficeThemeManager._instance; + }; + OfficeThemeManager._osfOfficeThemeCacheValidPeriod = 5000; + + OfficeThemeManager._instance = null; + return OfficeThemeManager; + })(); + OfficeTheme.OfficeThemeManager = OfficeThemeManager; + + OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA); + OSF.DDA.OfficeTheme.getOfficeTheme = OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme; + })(OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme = {})); + var OfficeTheme = OfficeExt.OfficeTheme; +})(OfficeExt || (OfficeExt = {})); + +OSF.DDA.ClientSettingsManager = { + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + try { + response = hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } catch (ex) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response = { name: Strings.OfficeOM.L_InternalError, message: ex }; + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) { + var keys = []; + var values = []; + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Read(keys, values); + if (onReceiving) { + onReceiving(); + } + var serializedSettings = {}; + for (var index = 0; index < keys.length; index++) { + serializedSettings[keys[index]] = values[index]; + } + return serializedSettings; + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) { + var keys = []; + var values = []; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Write(keys, values); + if (onReceiving) { + onReceiving(); + } + } +}; + +OSF.InitializationHelper.prototype.initializeSettings = function OSF_InitializationHelper$initializeSettings(refreshSupported) { + var serializedSettings = OSF.DDA.ClientSettingsManager.read(); + var settings = this.deserializeSettings(serializedSettings, refreshSupported); + return settings; +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var returnedContext; + var context = OSF.DDA._OsfControlContext = window.external.GetContext(); + var appType = context.GetAppType(); + var appTypeSupported = false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry] == appType) { + appTypeSupported = true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type " + appType; + } + var id = context.GetSolutionRef(); + var version = context.GetAppVersionMajor(); + var minorVersion = context.GetAppVersionMinor(); + var UILocale = context.GetAppUILocale(); + var dataLocale = context.GetAppDataLocale(); + var docUrl = context.GetDocUrl(); + var clientMode = context.GetAppCapabilities(); + var reason = context.GetActivationMode(); + var osfControlType = context.GetControlIntegrationLevel(); + var settings = []; + var eToken; + try { + eToken = context.GetSolutionToken(); + } catch (ex) { + } + var correlationId; + + if (typeof context.GetCorrelationId !== "undefined") { + correlationId = context.GetCorrelationId(); + } + var appInstanceId; + if (typeof context.GetInstanceId !== "undefined") { + appInstanceId = context.GetInstanceId(); + } + var touchEnabled; + if (typeof context.GetTouchEnabled !== "undefined") { + touchEnabled = context.GetTouchEnabled(); + } + var commerceAllowed; + if (typeof context.GetCommerceAllowed !== "undefined") { + commerceAllowed = context.GetCommerceAllowed(); + } + var requirementMatrix; + if (typeof context.GetSupportedMatrix !== "undefined") { + requirementMatrix = context.GetSupportedMatrix(); + } + eToken = eToken ? eToken.toString() : ""; + returnedContext = new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); +Microsoft.Office.WebExtension.ProjectViewTypes = { + Gantt: 1, + NetworkDiagram: 2, + TaskDiagram: 3, + TaskForm: 4, + TaskSheet: 5, + ResourceForm: 6, + ResourceSheet: 7, + ResourceGraph: 8, + TeamPlanner: 9, + TaskDetails: 10, + TaskNameForm: 11, + ResourceNames: 12, + Calendar: 13, + TaskUsage: 14, + ResourceUsage: 15, + Timeline: 16, + Drawing: 18, + ResourcePlan: 19 +}; + +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType, { + Text: "text" +}); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.ValueFormat, { + Unformatted: "unformatted" +}); + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + TaskSelectionChanged: "taskSelectionChanged", + ResourceSelectionChanged: "resourceSelectionChanged", + ViewSelectionChanged: "viewSelectionChanged" +}); + +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 } + ] +}); + +Microsoft.Office.WebExtension.ProjectTaskFields = { + ActualCost: 0, + ActualDuration: 1, + ActualFinish: 2, + ActualOvertimeCost: 3, + ActualOvertimeWork: 4, + ActualStart: 5, + ActualWork: 6, + Text1: 7, + Text10: 8, + Finish10: 9, + Start10: 10, + Text11: 11, + Text12: 12, + Text13: 13, + Text14: 14, + Text15: 15, + Text16: 16, + Text17: 17, + Text18: 18, + Text19: 19, + Finish1: 20, + Start1: 21, + Text2: 22, + Text20: 23, + Text21: 24, + Text22: 25, + Text23: 26, + Text24: 27, + Text25: 28, + Text26: 29, + Text27: 30, + Text28: 31, + Text29: 32, + Finish2: 33, + Start2: 34, + Text3: 35, + Text30: 36, + Finish3: 37, + Start3: 38, + Text4: 39, + Finish4: 40, + Start4: 41, + Text5: 42, + Finish5: 43, + Start5: 44, + Text6: 45, + Finish6: 46, + Start6: 47, + Text7: 48, + Finish7: 49, + Start7: 50, + Text8: 51, + Finish8: 52, + Start8: 53, + Text9: 54, + Finish9: 55, + Start9: 56, + Baseline10BudgetCost: 57, + Baseline10BudgetWork: 58, + Baseline10Cost: 59, + Baseline10Duration: 60, + Baseline10Finish: 61, + Baseline10FixedCost: 62, + Baseline10FixedCostAccrual: 63, + Baseline10Start: 64, + Baseline10Work: 65, + Baseline1BudgetCost: 66, + Baseline1BudgetWork: 67, + Baseline1Cost: 68, + Baseline1Duration: 69, + Baseline1Finish: 70, + Baseline1FixedCost: 71, + Baseline1FixedCostAccrual: 72, + Baseline1Start: 73, + Baseline1Work: 74, + Baseline2BudgetCost: 75, + Baseline2BudgetWork: 76, + Baseline2Cost: 77, + Baseline2Duration: 78, + Baseline2Finish: 79, + Baseline2FixedCost: 80, + Baseline2FixedCostAccrual: 81, + Baseline2Start: 82, + Baseline2Work: 83, + Baseline3BudgetCost: 84, + Baseline3BudgetWork: 85, + Baseline3Cost: 86, + Baseline3Duration: 87, + Baseline3Finish: 88, + Baseline3FixedCost: 89, + Baseline3FixedCostAccrual: 90, + Basline3Start: 91, + Baseline3Work: 92, + Baseline4BudgetCost: 93, + Baseline4BudgetWork: 94, + Baseline4Cost: 95, + Baseline4Duration: 96, + Baseline4Finish: 97, + Baseline4FixedCost: 98, + Baseline4FixedCostAccrual: 99, + Baseline4Start: 100, + Baseline4Work: 101, + Baseline5BudgetCost: 102, + Baseline5BudgetWork: 103, + Baseline5Cost: 104, + Baseline5Duration: 105, + Baseline5Finish: 106, + Baseline5FixedCost: 107, + Baseline5FixedCostAccrual: 108, + Baseline5Start: 109, + Baseline5Work: 110, + Baseline6BudgetCost: 111, + Baseline6BudgetWork: 112, + Baseline6Cost: 113, + Baseline6Duration: 114, + Baseline6Finish: 115, + Baseline6FixedCost: 116, + Baseline6FixedCostAccrual: 117, + Baseline6Start: 118, + Baseline6Work: 119, + Baseline7BudgetCost: 120, + Baseline7BudgetWork: 121, + Baseline7Cost: 122, + Baseline7Duration: 123, + Baseline7Finish: 124, + Baseline7FixedCost: 125, + Baseline7FixedCostAccrual: 126, + Baseline7Start: 127, + Baseline7Work: 128, + Baseline8BudgetCost: 129, + Baseline8BudgetWork: 130, + Baseline8Cost: 131, + Baseline8Duration: 132, + Baseline8Finish: 133, + Baseline8FixedCost: 134, + Baseline8FixedCostAccrual: 135, + Baseline8Start: 136, + Baseline8Work: 137, + Baseline9BudgetCost: 138, + Baseline9BudgetWork: 139, + Baseline9Cost: 140, + Baseline9Duration: 141, + Baseline9Finish: 142, + Baseline9FixedCost: 143, + Baseline9FixedCostAccrual: 144, + Baseline9Start: 145, + Baseline9Work: 146, + BaselineBudgetCost: 147, + BaselineBudgetWork: 148, + BaselineCost: 149, + BaselineDuration: 150, + BaselineFinish: 151, + BaselineFixedCost: 152, + BaselineFixedCostAccrual: 153, + BaselineStart: 154, + BaselineWork: 155, + BudgetCost: 156, + BudgetWork: 157, + TaskCalendarGUID: 158, + ConstraintDate: 159, + ConstraintType: 160, + Cost1: 161, + Cost10: 162, + Cost2: 163, + Cost3: 164, + Cost4: 165, + Cost5: 166, + Cost6: 167, + Cost7: 168, + Cost8: 169, + Cost9: 170, + Date1: 171, + Date10: 172, + Date2: 173, + Date3: 174, + Date4: 175, + Date5: 176, + Date6: 177, + Date7: 178, + Date8: 179, + Date9: 180, + Deadline: 181, + Duration1: 182, + Duration10: 183, + Duration2: 184, + Duration3: 185, + Duration4: 186, + Duration5: 187, + Duration6: 188, + Duration7: 189, + Duration8: 190, + Duration9: 191, + Duration: 192, + EarnedValueMethod: 193, + FinishSlack: 194, + FixedCost: 195, + FixedCostAccrual: 196, + Flag10: 197, + Flag1: 198, + Flag11: 199, + Flag12: 200, + Flag13: 201, + Flag14: 202, + Flag15: 203, + Flag16: 204, + Flag17: 205, + Flag18: 206, + Flag19: 207, + Flag2: 208, + Flag20: 209, + Flag3: 210, + Flag4: 211, + Flag5: 212, + Flag6: 213, + Flag7: 214, + Flag8: 215, + Flag9: 216, + FreeSlack: 217, + HasRollupSubTasks: 218, + ID: 219, + Name: 220, + Notes: 221, + Number1: 222, + Number10: 223, + Number11: 224, + Number12: 225, + Number13: 226, + Number14: 227, + Number15: 228, + Number16: 229, + Number17: 230, + Number18: 231, + Number19: 232, + Number2: 233, + Number20: 234, + Number3: 235, + Number4: 236, + Number5: 237, + Number6: 238, + Number7: 239, + Number8: 240, + Number9: 241, + ScheduledDuration: 242, + ScheduledFinish: 243, + ScheduledStart: 244, + OutlineLevel: 245, + OvertimeCost: 246, + OvertimeWork: 247, + PercentComplete: 248, + PercentWorkComplete: 249, + Predecessors: 250, + PreleveledFinish: 251, + PreleveledStart: 252, + Priority: 253, + Active: 254, + Critical: 255, + Milestone: 256, + Overallocated: 257, + IsRollup: 258, + Summary: 259, + RegularWork: 260, + RemainingCost: 261, + RemainingDuration: 262, + RemainingOvertimeCost: 263, + RemainingWork: 264, + ResourceNames: 265, + ResourceNames_deprecated: 266, + Cost: 267, + Finish: 268, + Start: 269, + Work: 270, + StartSlack: 271, + Status: 272, + Successors: 273, + StatusManager: 274, + TotalSlack: 275, + TaskGUID: 276, + Type: 277, + WBS: 278, + WBSPREDECESSORS: 279, + WBSSUCCESSORS: 280, + WSSID: 281 +}; + +Microsoft.Office.WebExtension.ProjectResourceFields = { + Accrual: 0, + ActualCost: 1, + ActualOvertimeCost: 2, + ActualOvertimeWork: 3, + ActualOvertimeWorkProtected: 4, + ActualWork: 5, + ActualWorkProtected: 6, + BaseCalendar: 7, + Baseline10BudgetCost: 8, + Baseline10BudgetWork: 9, + Baseline10Cost: 10, + Baseline10Work: 11, + Baseline1BudgetCost: 12, + Baseline1BudgetWork: 13, + Baseline1Cost: 14, + Baseline1Work: 15, + Baseline2BudgetCost: 16, + Baseline2BudgetWork: 17, + Baseline2Cost: 18, + Baseline2Work: 19, + Baseline3BudgetCost: 20, + Baseline3BudgetWork: 21, + Baseline3Cost: 22, + Baseline3Work: 23, + Baseline4BudgetCost: 24, + Baseline4BudgetWork: 25, + Baseline4Cost: 26, + Baseline4Work: 27, + Baseline5BudgetCost: 28, + Baseline5BudgetWork: 29, + Baseline5Cost: 30, + Baseline5Work: 31, + Baseline6BudgetCost: 32, + Baseline6BudgetWork: 33, + Baseline6Cost: 34, + Baseline6Work: 35, + Baseline7BudgetCost: 36, + Baseline7BudgetWork: 37, + Baseline7Cost: 38, + Baseline7Work: 39, + Baseline8BudgetCost: 40, + Baseline8BudgetWork: 41, + Baseline8Cost: 42, + Baseline8Work: 43, + Baseline9BudgetCost: 44, + Baseline9BudgetWork: 45, + Baseline9Cost: 46, + Baseline9Work: 47, + BaselineBudgetCost: 48, + BaselineBudgetWork: 49, + BaselineCost: 50, + BaselineWork: 51, + BudgetCost: 52, + BudgetWork: 53, + ResourceCalendarGUID: 54, + Code: 55, + Cost1: 56, + Cost10: 57, + Cost2: 58, + Cost3: 59, + Cost4: 60, + Cost5: 61, + Cost6: 62, + Cost7: 63, + Cost8: 64, + Cost9: 65, + ResourceCreationDate: 66, + Date1: 67, + Date10: 68, + Date2: 69, + Date3: 70, + Date4: 71, + Date5: 72, + Date6: 73, + Date7: 74, + Date8: 75, + Date9: 76, + Duration1: 77, + Duration10: 78, + Duration2: 79, + Duration3: 80, + Duration4: 81, + Duration5: 82, + Duration6: 83, + Duration7: 84, + Duration8: 85, + Duration9: 86, + Email: 87, + End: 88, + Finish1: 89, + Finish10: 90, + Finish2: 91, + Finish3: 92, + Finish4: 93, + Finish5: 94, + Finish6: 95, + Finish7: 96, + Finish8: 97, + Finish9: 98, + Flag10: 99, + Flag1: 100, + Flag11: 101, + Flag12: 102, + Flag13: 103, + Flag14: 104, + Flag15: 105, + Flag16: 106, + Flag17: 107, + Flag18: 108, + Flag19: 109, + Flag2: 110, + Flag20: 111, + Flag3: 112, + Flag4: 113, + Flag5: 114, + Flag6: 115, + Flag7: 116, + Flag8: 117, + Flag9: 118, + Group: 119, + Units: 120, + Name: 121, + Notes: 122, + Number1: 123, + Number10: 124, + Number11: 125, + Number12: 126, + Number13: 127, + Number14: 128, + Number15: 129, + Number16: 130, + Number17: 131, + Number18: 132, + Number19: 133, + Number2: 134, + Number20: 135, + Number3: 136, + Number4: 137, + Number5: 138, + Number6: 139, + Number7: 140, + Number8: 141, + Number9: 142, + OvertimeCost: 143, + OvertimeRate: 144, + OvertimeWork: 145, + PercentWorkComplete: 146, + CostPerUse: 147, + Generic: 148, + OverAllocated: 149, + RegularWork: 150, + RemainingCost: 151, + RemainingOvertimeCost: 152, + RemainingOvertimeWork: 153, + RemainingWork: 154, + ResourceGUID: 155, + Cost: 156, + Work: 157, + Start: 158, + Start1: 159, + Start10: 160, + Start2: 161, + Start3: 162, + Start4: 163, + Start5: 164, + Start6: 165, + Start7: 166, + Start8: 167, + Start9: 168, + StandardRate: 169, + Text1: 170, + Text10: 171, + Text11: 172, + Text12: 173, + Text13: 174, + Text14: 175, + Text15: 176, + Text16: 177, + Text17: 178, + Text18: 179, + Text19: 180, + Text2: 181, + Text20: 182, + Text21: 183, + Text22: 184, + Text23: 185, + Text24: 186, + Text25: 187, + Text26: 188, + Text27: 189, + Text28: 190, + Text29: 191, + Text3: 192, + Text30: 193, + Text4: 194, + Text5: 195, + Text6: 196, + Text7: 197, + Text8: 198, + Text9: 199 +}; + +Microsoft.Office.WebExtension.ProjectProjectFields = { + CurrencyDigits: 0, + CurrencySymbol: 1, + CurrencySymbolPosition: 2, + DurationUnits: 3, + GUID: 4, + Finish: 5, + Start: 6, + ReadOnly: 7, + VERSION: 8, + WorkUnits: 9, + ProjectServerUrl: 10, + WSSUrl: 11, + WSSList: 12 +}; +OSF.DDA.ProjectDocument = function OSF_DDA_ProjectDocument(officeAppContext) { + OSF.DDA.ProjectDocument.uber.constructor.call(this, officeAppContext); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.GetSelectedTask, + am.GetTask, + am.GetTaskField, + am.GetWSSUrl, + am.GetSelectedResource, + am.GetResourceField, + am.GetProjectField, + am.GetSelectedView, + am.GetTaskByIndex, + am.GetResourceByIndex, + am.SetTaskField, + am.SetResourceField, + am.GetMaxTaskIndex, + am.GetMaxResourceIndex + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.TaskSelectionChanged, + Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged, + Microsoft.Office.WebExtension.EventType.ViewSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.ProjectDocument, OSF.DDA.Document); +OSF.DDA.TaskSelectionChangedEventArgs = function OSF_DDA_TaskSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.TaskSelectionChanged + }, + "document": { + value: doc + } + }); +}; +OSF.DDA.ResourceSelectionChangedEventArgs = function OSF_DDA_ResourceSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged + }, + "document": { + value: doc + } + }); +}; +OSF.DDA.ViewSelectionChangedEventArgs = function OSF_DDA_ViewSelectionChangedEventArgs(doc) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.ViewSelectionChanged + }, + "document": { + value: doc + } + }); +}; + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.ProjectDocument(appContext, this._initializeSettings(false)); + appReady(); +}; +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedTask: "getSelectedTaskAsync", + GetTask: "getTaskAsync", + GetWSSUrl: "getWSSUrlAsync", + GetTaskField: "getTaskFieldAsync", + GetSelectedResource: "getSelectedResourceAsync", + GetResourceField: "getResourceFieldAsync", + GetProjectField: "getProjectFieldAsync", + GetSelectedView: "getSelectedViewAsync", + GetTaskByIndex: "getTaskByIndexAsync", + GetResourceByIndex: "getResourceByIndexAsync", + SetTaskField: "setTaskFieldAsync", + SetResourceField: "setResourceFieldAsync", + GetMaxTaskIndex: "getMaxTaskIndexAsync", + GetMaxResourceIndex: "getMaxResourceIndexAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedTask, + onSucceeded: function (taskIdDescriptor) { + return taskIdDescriptor[Microsoft.Office.WebExtension.Parameters.TaskId]; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetTaskByIndex, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.TaskIndex, + types: ["number"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (taskIdDescriptor) { + return taskIdDescriptor[Microsoft.Office.WebExtension.Parameters.TaskId]; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetTask, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.TaskId, + types: ["string"] + } + ] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetTaskField, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.TaskId, + types: ["string"] + }, + { + name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + }], + supportedOptions: [{ + name: Microsoft.Office.WebExtension.Parameters.GetRawValue, + value: { + "types": ["boolean"], + "defaultValue": false + } + }] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetResourceField, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.ResourceId, + types: ["string"] + }, + { + name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + }], + supportedOptions: [{ + name: Microsoft.Office.WebExtension.Parameters.GetRawValue, + value: { + "types": ["boolean"], + "defaultValue": false + } + }] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetProjectField, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + } + ], + supportedOptions: [{ + name: Microsoft.Office.WebExtension.Parameters.GetRawValue, + value: { + "types": ["boolean"], + "defaultValue": false + } + }] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedResource, + onSucceeded: function (resourceIdDescriptor) { + return resourceIdDescriptor[Microsoft.Office.WebExtension.Parameters.ResourceId]; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetResourceByIndex, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.ResourceIndex, + types: ["number"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (resourceIdDescriptor) { + return resourceIdDescriptor[Microsoft.Office.WebExtension.Parameters.ResourceId]; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetWSSUrl +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedView +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetTaskField, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.TaskId, + types: ["string"] + }, + { + name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.FieldValue, + "types": ["object", "string", "number", "boolean"] + } + ] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetResourceField, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.ResourceId, + types: ["string"] + }, + { + name: Microsoft.Office.WebExtension.Parameters.FieldId, + types: ["number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.FieldValue, + "types": ["object", "string", "number", "boolean"] + } + ] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetMaxTaskIndex, + onSucceeded: function (taskIndexDescriptor) { + return taskIndexDescriptor[Microsoft.Office.WebExtension.Parameters.TaskIndex]; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetMaxResourceIndex, + onSucceeded: function (resourceIndexDescriptor) { + return resourceIndexDescriptor[Microsoft.Office.WebExtension.Parameters.ResourceIndex]; + } +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedTaskMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetTaskByIndexMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.TaskIndex, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetTaskFieldMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.GetRawValue, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetWSSUrlMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ServerUrl, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ListName, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedResourceMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetResourceByIndexMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ResourceIndex, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetResourceFieldMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.GetRawValue, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetProjectFieldMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.GetRawValue, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ViewType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ViewName, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetTaskFieldMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetResourceFieldMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetMaxTaskIndexMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.TaskIndex, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetMaxResourceIndexMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ResourceIndex, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidTaskSelectionChangedEvent }); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidResourceSelectionChangedEvent }); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidViewSelectionChangedEvent }); diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-win32-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-win32-16.00.js new file mode 100644 index 000000000..6e96ff246 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/project-win32-16.00.js @@ -0,0 +1,11 @@ +/* Project specific JavaScript API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b0&&b.push(c)}}}catch(i){}return b}var c=[],b={};b[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,b=1;return {toHost:function(a){if(typeof a!="string"&&a[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=a[OSF.DDA.TableDataProperties.TableRows];d[b]=a[OSF.DDA.TableDataProperties.TableHeaders];a=d}return a},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=a(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=a(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=a(d[b])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,b);this.unpack=function(c,a){var d;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c)){var e=(a||typeof a==="unknown")&&a.toArray;d=e?a.toArray():a||{}}else if(this.isDynamicType(c))d=b[c].fromHost(a);else d=a;return d}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(a){function c(a){var b=a;if(OSF.OUtil.isArray(a))for(var f=b.length,d=0;d2){c=[];for(var g=1;g40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});Microsoft.Office.WebExtension.TableData=function(b,a){function c(a){if(a==null||a==undefined)return null;try{for(var b=OSF.DDA.DataCoercion.findArrayDimensionality(a,2);b<2;b++)a=[a];return a}catch(c){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{"get":function(){return a},"set":function(b){a=c(b)}},rows:{"get":function(){return b},"set":function(a){b=a==null||OSF.OUtil.isArray(a)&&a.length==0?[]:c(a)}}});this.headers=a;this.rows=b};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureTableData=function(a){return new Microsoft.Office.WebExtension.TableData(a[OSF.DDA.TableDataProperties.TableRows],a[OSF.DDA.TableDataProperties.TableHeaders])};Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"};OSF.DDA.DataCoercion=function(){var a=null;return {findArrayDimensionality:function(c){if(OSF.OUtil.isArray(c)){for(var b=0,a=0;a6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SettingsManager.SerializedSettings},{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.CoercionType,toHost:[{name:Microsoft.Office.WebExtension.CoercionType.Text,value:0},{name:Microsoft.Office.WebExtension.CoercionType.Matrix,value:1},{name:Microsoft.Office.WebExtension.CoercionType.Table,value:2}]});Microsoft.Office.WebExtension.ProjectTaskFields={ActualCost:0,ActualDuration:1,ActualFinish:2,ActualOvertimeCost:3,ActualOvertimeWork:4,ActualStart:5,ActualWork:6,Text1:7,Text10:8,Finish10:9,Start10:10,Text11:11,Text12:12,Text13:13,Text14:14,Text15:15,Text16:16,Text17:17,Text18:18,Text19:19,Finish1:20,Start1:21,Text2:22,Text20:23,Text21:24,Text22:25,Text23:26,Text24:27,Text25:28,Text26:29,Text27:30,Text28:31,Text29:32,Finish2:33,Start2:34,Text3:35,Text30:36,Finish3:37,Start3:38,Text4:39,Finish4:40,Start4:41,Text5:42,Finish5:43,Start5:44,Text6:45,Finish6:46,Start6:47,Text7:48,Finish7:49,Start7:50,Text8:51,Finish8:52,Start8:53,Text9:54,Finish9:55,Start9:56,Baseline10BudgetCost:57,Baseline10BudgetWork:58,Baseline10Cost:59,Baseline10Duration:60,Baseline10Finish:61,Baseline10FixedCost:62,Baseline10FixedCostAccrual:63,Baseline10Start:64,Baseline10Work:65,Baseline1BudgetCost:66,Baseline1BudgetWork:67,Baseline1Cost:68,Baseline1Duration:69,Baseline1Finish:70,Baseline1FixedCost:71,Baseline1FixedCostAccrual:72,Baseline1Start:73,Baseline1Work:74,Baseline2BudgetCost:75,Baseline2BudgetWork:76,Baseline2Cost:77,Baseline2Duration:78,Baseline2Finish:79,Baseline2FixedCost:80,Baseline2FixedCostAccrual:81,Baseline2Start:82,Baseline2Work:83,Baseline3BudgetCost:84,Baseline3BudgetWork:85,Baseline3Cost:86,Baseline3Duration:87,Baseline3Finish:88,Baseline3FixedCost:89,Baseline3FixedCostAccrual:90,Basline3Start:91,Baseline3Work:92,Baseline4BudgetCost:93,Baseline4BudgetWork:94,Baseline4Cost:95,Baseline4Duration:96,Baseline4Finish:97,Baseline4FixedCost:98,Baseline4FixedCostAccrual:99,Baseline4Start:100,Baseline4Work:101,Baseline5BudgetCost:102,Baseline5BudgetWork:103,Baseline5Cost:104,Baseline5Duration:105,Baseline5Finish:106,Baseline5FixedCost:107,Baseline5FixedCostAccrual:108,Baseline5Start:109,Baseline5Work:110,Baseline6BudgetCost:111,Baseline6BudgetWork:112,Baseline6Cost:113,Baseline6Duration:114,Baseline6Finish:115,Baseline6FixedCost:116,Baseline6FixedCostAccrual:117,Baseline6Start:118,Baseline6Work:119,Baseline7BudgetCost:120,Baseline7BudgetWork:121,Baseline7Cost:122,Baseline7Duration:123,Baseline7Finish:124,Baseline7FixedCost:125,Baseline7FixedCostAccrual:126,Baseline7Start:127,Baseline7Work:128,Baseline8BudgetCost:129,Baseline8BudgetWork:130,Baseline8Cost:131,Baseline8Duration:132,Baseline8Finish:133,Baseline8FixedCost:134,Baseline8FixedCostAccrual:135,Baseline8Start:136,Baseline8Work:137,Baseline9BudgetCost:138,Baseline9BudgetWork:139,Baseline9Cost:140,Baseline9Duration:141,Baseline9Finish:142,Baseline9FixedCost:143,Baseline9FixedCostAccrual:144,Baseline9Start:145,Baseline9Work:146,BaselineBudgetCost:147,BaselineBudgetWork:148,BaselineCost:149,BaselineDuration:150,BaselineFinish:151,BaselineFixedCost:152,BaselineFixedCostAccrual:153,BaselineStart:154,BaselineWork:155,BudgetCost:156,BudgetWork:157,TaskCalendarGUID:158,ConstraintDate:159,ConstraintType:160,Cost1:161,Cost10:162,Cost2:163,Cost3:164,Cost4:165,Cost5:166,Cost6:167,Cost7:168,Cost8:169,Cost9:170,Date1:171,Date10:172,Date2:173,Date3:174,Date4:175,Date5:176,Date6:177,Date7:178,Date8:179,Date9:180,Deadline:181,Duration1:182,Duration10:183,Duration2:184,Duration3:185,Duration4:186,Duration5:187,Duration6:188,Duration7:189,Duration8:190,Duration9:191,Duration:192,EarnedValueMethod:193,FinishSlack:194,FixedCost:195,FixedCostAccrual:196,Flag10:197,Flag1:198,Flag11:199,Flag12:200,Flag13:201,Flag14:202,Flag15:203,Flag16:204,Flag17:205,Flag18:206,Flag19:207,Flag2:208,Flag20:209,Flag3:210,Flag4:211,Flag5:212,Flag6:213,Flag7:214,Flag8:215,Flag9:216,FreeSlack:217,HasRollupSubTasks:218,ID:219,Name:220,Notes:221,Number1:222,Number10:223,Number11:224,Number12:225,Number13:226,Number14:227,Number15:228,Number16:229,Number17:230,Number18:231,Number19:232,Number2:233,Number20:234,Number3:235,Number4:236,Number5:237,Number6:238,Number7:239,Number8:240,Number9:241,ScheduledDuration:242,ScheduledFinish:243,ScheduledStart:244,OutlineLevel:245,OvertimeCost:246,OvertimeWork:247,PercentComplete:248,PercentWorkComplete:249,Predecessors:250,PreleveledFinish:251,PreleveledStart:252,Priority:253,Active:254,Critical:255,Milestone:256,Overallocated:257,IsRollup:258,Summary:259,RegularWork:260,RemainingCost:261,RemainingDuration:262,RemainingOvertimeCost:263,RemainingWork:264,ResourceNames:265,ResourceNames_deprecated:266,Cost:267,Finish:268,Start:269,Work:270,StartSlack:271,Status:272,Successors:273,StatusManager:274,TotalSlack:275,TaskGUID:276,Type:277,WBS:278,WBSPREDECESSORS:279,WBSSUCCESSORS:280,WSSID:281};Microsoft.Office.WebExtension.ProjectResourceFields={Accrual:0,ActualCost:1,ActualOvertimeCost:2,ActualOvertimeWork:3,ActualOvertimeWorkProtected:4,ActualWork:5,ActualWorkProtected:6,BaseCalendar:7,Baseline10BudgetCost:8,Baseline10BudgetWork:9,Baseline10Cost:10,Baseline10Work:11,Baseline1BudgetCost:12,Baseline1BudgetWork:13,Baseline1Cost:14,Baseline1Work:15,Baseline2BudgetCost:16,Baseline2BudgetWork:17,Baseline2Cost:18,Baseline2Work:19,Baseline3BudgetCost:20,Baseline3BudgetWork:21,Baseline3Cost:22,Baseline3Work:23,Baseline4BudgetCost:24,Baseline4BudgetWork:25,Baseline4Cost:26,Baseline4Work:27,Baseline5BudgetCost:28,Baseline5BudgetWork:29,Baseline5Cost:30,Baseline5Work:31,Baseline6BudgetCost:32,Baseline6BudgetWork:33,Baseline6Cost:34,Baseline6Work:35,Baseline7BudgetCost:36,Baseline7BudgetWork:37,Baseline7Cost:38,Baseline7Work:39,Baseline8BudgetCost:40,Baseline8BudgetWork:41,Baseline8Cost:42,Baseline8Work:43,Baseline9BudgetCost:44,Baseline9BudgetWork:45,Baseline9Cost:46,Baseline9Work:47,BaselineBudgetCost:48,BaselineBudgetWork:49,BaselineCost:50,BaselineWork:51,BudgetCost:52,BudgetWork:53,ResourceCalendarGUID:54,Code:55,Cost1:56,Cost10:57,Cost2:58,Cost3:59,Cost4:60,Cost5:61,Cost6:62,Cost7:63,Cost8:64,Cost9:65,ResourceCreationDate:66,Date1:67,Date10:68,Date2:69,Date3:70,Date4:71,Date5:72,Date6:73,Date7:74,Date8:75,Date9:76,Duration1:77,Duration10:78,Duration2:79,Duration3:80,Duration4:81,Duration5:82,Duration6:83,Duration7:84,Duration8:85,Duration9:86,Email:87,End:88,Finish1:89,Finish10:90,Finish2:91,Finish3:92,Finish4:93,Finish5:94,Finish6:95,Finish7:96,Finish8:97,Finish9:98,Flag10:99,Flag1:100,Flag11:101,Flag12:102,Flag13:103,Flag14:104,Flag15:105,Flag16:106,Flag17:107,Flag18:108,Flag19:109,Flag2:110,Flag20:111,Flag3:112,Flag4:113,Flag5:114,Flag6:115,Flag7:116,Flag8:117,Flag9:118,Group:119,Units:120,Name:121,Notes:122,Number1:123,Number10:124,Number11:125,Number12:126,Number13:127,Number14:128,Number15:129,Number16:130,Number17:131,Number18:132,Number19:133,Number2:134,Number20:135,Number3:136,Number4:137,Number5:138,Number6:139,Number7:140,Number8:141,Number9:142,OvertimeCost:143,OvertimeRate:144,OvertimeWork:145,PercentWorkComplete:146,CostPerUse:147,Generic:148,OverAllocated:149,RegularWork:150,RemainingCost:151,RemainingOvertimeCost:152,RemainingOvertimeWork:153,RemainingWork:154,ResourceGUID:155,Cost:156,Work:157,Start:158,Start1:159,Start10:160,Start2:161,Start3:162,Start4:163,Start5:164,Start6:165,Start7:166,Start8:167,Start9:168,StandardRate:169,Text1:170,Text10:171,Text11:172,Text12:173,Text13:174,Text14:175,Text15:176,Text16:177,Text17:178,Text18:179,Text19:180,Text2:181,Text20:182,Text21:183,Text22:184,Text23:185,Text24:186,Text25:187,Text26:188,Text27:189,Text28:190,Text29:191,Text3:192,Text30:193,Text4:194,Text5:195,Text6:196,Text7:197,Text8:198,Text9:199};Microsoft.Office.WebExtension.ProjectProjectFields={CurrencyDigits:0,CurrencySymbol:1,CurrencySymbolPosition:2,DurationUnits:3,GUID:4,Finish:5,Start:6,ReadOnly:7,VERSION:8,WorkUnits:9,ProjectServerUrl:10,WSSUrl:11,WSSList:12};OSF.DDA.ProjectDocument=function(b){OSF.DDA.ProjectDocument.uber.constructor.call(this,b);var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.GetSelectedDataAsync,a.GetSelectedTask,a.GetTask,a.GetTaskField,a.GetWSSUrl,a.GetSelectedResource,a.GetResourceField,a.GetProjectField,a.GetSelectedView,a.GetTaskByIndex,a.GetResourceByIndex,a.SetTaskField,a.SetResourceField,a.GetMaxTaskIndex,a.GetMaxResourceIndex]);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.TaskSelectionChanged,Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged,Microsoft.Office.WebExtension.EventType.ViewSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.ProjectDocument,OSF.DDA.Document);OSF.DDA.TaskSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.TaskSelectionChanged},document:{value:a}})};OSF.DDA.ResourceSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged},document:{value:a}})};OSF.DDA.ViewSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.ViewSelectionChanged},document:{value:a}})};OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(a,b){OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);a.doc=new OSF.DDA.ProjectDocument(a,this._initializeSettings(false));b()};OSF.DDA.AsyncMethodNames.addNames({GetSelectedTask:"getSelectedTaskAsync",GetTask:"getTaskAsync",GetWSSUrl:"getWSSUrlAsync",GetTaskField:"getTaskFieldAsync",GetSelectedResource:"getSelectedResourceAsync",GetResourceField:"getResourceFieldAsync",GetProjectField:"getProjectFieldAsync",GetSelectedView:"getSelectedViewAsync",GetTaskByIndex:"getTaskByIndexAsync",GetResourceByIndex:"getResourceByIndexAsync",SetTaskField:"setTaskFieldAsync",SetResourceField:"setResourceFieldAsync",GetMaxTaskIndex:"getMaxTaskIndexAsync",GetMaxResourceIndex:"getMaxResourceIndexAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedTask,onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.TaskId]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetTaskByIndex,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TaskIndex,types:["number"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.TaskId]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetTask,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,types:["string"]}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetTaskField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:["number"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:{types:["boolean"],defaultValue:false}}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetResourceField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ResourceId,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:["number"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:{types:["boolean"],defaultValue:false}}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetProjectField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:["number"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:{types:["boolean"],defaultValue:false}}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedResource,onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.ResourceId]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetResourceByIndex,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ResourceIndex,types:["number"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.ResourceId]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetWSSUrl});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedView});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetTaskField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:["number"]},{name:Microsoft.Office.WebExtension.Parameters.FieldValue,types:["object","string","number","boolean"]}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetResourceField,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ResourceId,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.FieldId,types:["number"]},{name:Microsoft.Office.WebExtension.Parameters.FieldValue,types:["object","string","number","boolean"]}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetMaxTaskIndex,onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.TaskIndex]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetMaxResourceIndex,onSucceeded:function(a){return a[Microsoft.Office.WebExtension.Parameters.ResourceIndex]}});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedTaskMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetTaskByIndexMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.TaskIndex,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetTaskMethod,fromHost:[{name:"taskName",value:0},{name:"wssTaskId",value:1},{name:"resourceNames",value:2}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetTaskFieldMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.FieldValue,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,value:0},{name:Microsoft.Office.WebExtension.Parameters.FieldId,value:1},{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetWSSUrlMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.ServerUrl,value:0},{name:Microsoft.Office.WebExtension.Parameters.ListName,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedResourceMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.ResourceId,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetResourceByIndexMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.ResourceId,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.ResourceIndex,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetResourceFieldMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.FieldValue,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.ResourceId,value:0},{name:Microsoft.Office.WebExtension.Parameters.FieldId,value:1},{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetProjectFieldMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.FieldValue,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.FieldId,value:0},{name:Microsoft.Office.WebExtension.Parameters.GetRawValue,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedViewMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.ViewType,value:0},{name:Microsoft.Office.WebExtension.Parameters.ViewName,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetTaskFieldMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.TaskId,value:0},{name:Microsoft.Office.WebExtension.Parameters.FieldId,value:1},{name:Microsoft.Office.WebExtension.Parameters.FieldValue,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetResourceFieldMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.ResourceId,value:0},{name:Microsoft.Office.WebExtension.Parameters.FieldId,value:1},{name:Microsoft.Office.WebExtension.Parameters.FieldValue,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetMaxTaskIndexMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.TaskIndex,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetMaxResourceIndexMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.ResourceIndex,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidTaskSelectionChangedEvent});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidResourceSelectionChangedEvent});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidViewSelectionChangedEvent}) \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/office_strings.debug.js new file mode 100644 index 000000000..3fc79e67e --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "O tipo de vinculação especificada não é compatível com o item nomeado fornecido."; +Strings.OfficeOM.L_EventHandlerNotExist = "O manipulador de eventos especificado não foi encontrado para esta associação."; +Strings.OfficeOM.L_UnknownBindingType = "Não há suporte para o tipo de vinculação."; +Strings.OfficeOM.L_InvalidNode = "Nó Inválido"; +Strings.OfficeOM.L_NotImplemented = "A função {0} não está implementada."; +Strings.OfficeOM.L_NoCapability = "Você não tem permissões suficientes para esta ação."; +Strings.OfficeOM.L_SettingsCannotSave = "Não foi possível salvar as configurações."; +Strings.OfficeOM.L_DataWriteReminder = "Lembrete de Gravação de Dados"; +Strings.OfficeOM.L_InvalidBinding = "Associação Inválida"; +Strings.OfficeOM.L_InvalidSetColumns = "As colunas especificadas são inválidas."; +Strings.OfficeOM.L_BindingCreationError = "Erro de criação de ligação"; +Strings.OfficeOM.L_FormatValueOutOfRange = "O valor está fora do intervalo permitido."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "A seleção atual não tem suporte para o tipo de coerção especificado."; +Strings.OfficeOM.L_InvalidBindingError = "Erro de Associação Inválida"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Os valores startRow ou startColumn especificados são inválidos."; +Strings.OfficeOM.L_InvalidSetRows = "As linhas especificadas são inválidas."; +Strings.OfficeOM.L_NetworkProblem = "Problema de Rede"; +Strings.OfficeOM.L_CannotWriteToSelection = "Não é possível gravar na seleção atual."; +Strings.OfficeOM.L_MissingParameter = "Parâmetro Ausente"; +Strings.OfficeOM.L_IndexOutOfRange = "Índice fora do intervalo."; +Strings.OfficeOM.L_SettingsStaleError = "Erro de configurações obsoletos"; +Strings.OfficeOM.L_CannotNavigateTo = "O objeto está localizado em um local onde a navegação não é suportada."; +Strings.OfficeOM.L_ReadSettingsError = "Erro de leitura de configurações"; +Strings.OfficeOM.L_InvalidGetColumns = "As colunas especificadas são inválidas."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "O tipo de coerção especificado não tem suporte."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "O aplicativo {0} não existe. Microsoft.Office.WebExtension.Initialize(reason) não é chamado."; +Strings.OfficeOM.L_OverwriteWorksheetData = "A operação definida falhou porque o objeto de dados fornecido irá sobrescrever ou deslocar os dados."; +Strings.OfficeOM.L_RowIndexOutOfRange = "O valor de índice de linha está fora do intervalo permitido. Use um valor (0 ou superior) que seja menor do que o número de linhas."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "A linha especificada está em branco."; +Strings.OfficeOM.L_ColIndexOutOfRange = "O valor de índice de coluna está fora do intervalo permitido. Use um valor (0 ou superior) que seja menor do que o número de colunas."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Enumeração sem Suporte"; +Strings.OfficeOM.L_InvalidParameters = "A função {0} possui parâmetros inválidos."; +Strings.OfficeOM.L_SetDataParametersConflict = "Os parâmetros especificados estão em conflito."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Chame closeAsync no arquivo atual antes de recuperar outro."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "O tipo do objeto de dados especificado não é compatível com a seleção atual."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "A enumeração não tem suporte no aplicativo host atual."; +Strings.OfficeOM.L_InvalidCoercion = "Tipo inválido de coerção"; +Strings.OfficeOM.L_NotSupportedEventType = "Não há suporte para o tipo de evento especificado {0}."; +Strings.OfficeOM.L_UnsupportedDataObject = "Não há suporte para o tipo de objeto de dados fornecido."; +Strings.OfficeOM.L_GetDataIsTooLarge = "O conjunto de dados solicitado é muito grande."; +Strings.OfficeOM.L_AppNameNotExist = "O AppName para {0} não existe."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Faça uma seleção."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Foram encontrados vários objetos com o mesmo nome."; +Strings.OfficeOM.L_InvalidCellsValue = "Um ou mais parâmetros de célula têm valores que não são permitidos. Verifique outra vez os valores e tente novamente."; +Strings.OfficeOM.L_DataNotMatchBindingType = "O objeto de dados especificado não é compatível com o tipo de ligação."; +Strings.OfficeOM.L_InvalidFormatValue = "Um ou mais parâmetros de formato têm valores que não são permitidos. Verifique outra vez os valores e tente novamente."; +Strings.OfficeOM.L_NotSupportedBindingType = "Não há suporte para o tipo de ligação especificado {0}."; +Strings.OfficeOM.L_InitializeNotReady = "O Office.js ainda não está totalmente carregado. Tente novamente mais tarde ou verifique se você adicionou seu código de inicialização na função Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Lembrete de Formatação"; +Strings.OfficeOM.L_ShuttingDown = "Falha na operação porque os dados não são atuais no servidor."; +Strings.OfficeOM.L_OperationNotSupported = "A operação não é suportada."; +Strings.OfficeOM.L_DocumentReadOnly = "A operação solicitada não é permitida no modo de documento atual."; +Strings.OfficeOM.L_NamedItemNotFound = "O item nomeado não existe."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Chamada de API inválida no contexto atual."; +Strings.OfficeOM.L_InvalidGetRows = "As linhas especificadas são inválidas."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Observação: é recomendável que os conjuntos de formatação definidos por uma chamada de API de formatação não ultrapassem 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Aguarde até que a chamada anterior for concluída."; +Strings.OfficeOM.L_SetDataIsTooLarge = "O objeto de dados especificado é muito grande."; +Strings.OfficeOM.L_DataWriteError = "Erro de gravação de dados"; +Strings.OfficeOM.L_InvalidBindingOperation = "Operação de Associação Inválida"; +Strings.OfficeOM.L_APICallFailed = "Falha na Chamada à API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "A ID especificada não existe."; +Strings.OfficeOM.L_FunctionCallFailed = "Falha na chamada de função {0}, código de erro: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "O objeto de dados fornecido não corresponde ao tamanho da seleção atual."; +Strings.OfficeOM.L_SaveSettingsError = "Salvar erro de configurações"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Esta API foi limitada para reduzir a frequência de chamada."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Os valores startRow ou startColumn especificados são inválidos."; +Strings.OfficeOM.L_InvalidFormat = "Erro de formato inválido"; +Strings.OfficeOM.L_BindingNotExist = "A ligação especificada não existe."; +Strings.OfficeOM.L_SettingNameNotExist = "O nome de configuração especificado não existe."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Falha ao adicionar o manipulador de eventos."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Este navegador não oferece suporte para a API solicitada."; +Strings.OfficeOM.L_InvalidAPICall = "Chamada de API inválida"; +Strings.OfficeOM.L_EventRegistrationError = "Erro de registro de eventos"; +Strings.OfficeOM.L_ElementMissing = "Não foi possível formatar a célula da tabela, pois faltam alguns valores de parâmetro. Verifique outra vez os parâmetros e tente novamente."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Parâmetros de coordenadas não podem ser usados com a Tabela de tipo de coerção quando a tabela contém células mescladas."; +Strings.OfficeOM.L_NavOutOfBound = "A operação falhou porque o índice está fora do intervalo."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "O retorno de chamada não pode ser especificado na lista de argumentos e no objeto opcional."; +Strings.OfficeOM.L_CustomXmlError = "Erro no XML personalizado."; +Strings.OfficeOM.L_SettingsAreStale = "As configurações não puderam ser salvas porque não são atuais."; +Strings.OfficeOM.L_TooManyOptionalFunction = "várias funções opcionais na lista de parâmetros"; +Strings.OfficeOM.L_MissingRequiredArguments = "alguns argumentos necessários ausentes"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Parâmetros de coordenadas não podem ser usados com a Tabela de tipo de coerção quando a tabela contém células mescladas."; +Strings.OfficeOM.L_HostError = "Erro de host"; +Strings.OfficeOM.L_OutOfRange = "Fora do Intervalo"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Não é possível criar uma ligação com a seleção atual e o tipo de ligação especificada."; +Strings.OfficeOM.L_TooManyOptionalObjects = "vários objetos opcionais na lista de parâmetros"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "O conteúdo selecionado precisa estar em formato de tabela. Formate os dados como uma tabela e tente novamente."; +Strings.OfficeOM.L_APINotSupported = "API sem Suporte"; +Strings.OfficeOM.L_SliceSizeNotSupported = "O tamanho da fatia especificado não tem suporte."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Falha ao remover o manipulador de eventos."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Não há suporte para várias seleções não contíguas."; +Strings.OfficeOM.L_DataReadError = "Erro de leitura de dados"; +Strings.OfficeOM.L_InternalErrorDescription = "Ocorreu um erro interno."; +Strings.OfficeOM.L_InvalidDataFormat = "O formato do objeto de dados especificado é inválido."; +Strings.OfficeOM.L_RequestTimeout = "A chamada demorou muito tempo para executar."; +Strings.OfficeOM.L_DataStale = "Dados Não Atuais"; +Strings.OfficeOM.L_GetSelectionNotSupported = "A seleção atual não tem suporte."; +Strings.OfficeOM.L_MemoryLimit = "Limite de Memória Excedido"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Observação: é recomendável que o número de células em uma tabela não ultrapasse 20.000 células."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Um ou mais parâmetros tableOptions tem valores que não são permitidos. Verifique outra vez os valores e tente novamente."; +Strings.OfficeOM.L_PermissionDenied = "Permissão negada"; +Strings.OfficeOM.L_InvalidDataObject = "Objeto de dados inválido"; +Strings.OfficeOM.L_UserNotSignedIn = "Nenhum usuário está conectado ao Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Não é possível ligar à seleção atual."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "As colunas especificadas são inválidas."; +Strings.OfficeOM.L_BadSelectorString = "A cadeia de caracteres passada para o seletor está formatada incorretamente ou não tem suporte."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Os valores rowCount e columnCount especificados são inválidos."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "O tipo OsfControl não tem suporte."; +Strings.OfficeOM.L_InvalidValue = "Valor Inválido"; +Strings.OfficeOM.L_DataNotMatchSelection = "O objeto de dados fornecido não é compatível com a forma ou as dimensões da seleção atual."; +Strings.OfficeOM.L_InternalError = "Erro interno"; +Strings.OfficeOM.L_NotSupported = "Função {0} não é suportada."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "O nó especificado não foi encontrado."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "O tipo de coerção especificado não é compatível com este tipo de associação."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Um problema de rede impediu a recuperação do arquivo."; +Strings.OfficeOM.L_TooManyArguments = "muitos argumentos"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Operação sem suporte neste tipo de associação."; +Strings.OfficeOM.L_InValidOptionalArgument = "argumento opcional inválido"; +Strings.OfficeOM.L_FileTypeNotSupported = "O tipo de arquivo especificado não tem suporte."; +Strings.OfficeOM.L_GetDataParametersConflict = "Os parâmetros especificados estão em conflito."; +Strings.OfficeOM.L_CallbackNotAFunction = "O retorno de chamada deve ser do tipo função, era do tipo {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/office_strings.js new file mode 100644 index 000000000..d05456803 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="O tipo de vinculação especificada não é compatível com o item nomeado fornecido.";Strings.OfficeOM.L_EventHandlerNotExist="O manipulador de eventos especificado não foi encontrado para esta associação.";Strings.OfficeOM.L_UnknownBindingType="Não há suporte para o tipo de vinculação.";Strings.OfficeOM.L_InvalidNode="Nó Inválido";Strings.OfficeOM.L_NotImplemented="A função {0} não está implementada.";Strings.OfficeOM.L_NoCapability="Você não tem permissões suficientes para esta ação.";Strings.OfficeOM.L_SettingsCannotSave="Não foi possível salvar as configurações.";Strings.OfficeOM.L_DataWriteReminder="Lembrete de Gravação de Dados";Strings.OfficeOM.L_InvalidBinding="Associação Inválida";Strings.OfficeOM.L_InvalidSetColumns="As colunas especificadas são inválidas.";Strings.OfficeOM.L_BindingCreationError="Erro de criação de ligação";Strings.OfficeOM.L_FormatValueOutOfRange="O valor está fora do intervalo permitido.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="A seleção atual não tem suporte para o tipo de coerção especificado.";Strings.OfficeOM.L_InvalidBindingError="Erro de Associação Inválida";Strings.OfficeOM.L_InvalidGetStartRowColumn="Os valores startRow ou startColumn especificados são inválidos.";Strings.OfficeOM.L_InvalidSetRows="As linhas especificadas são inválidas.";Strings.OfficeOM.L_NetworkProblem="Problema de Rede";Strings.OfficeOM.L_CannotWriteToSelection="Não é possível gravar na seleção atual.";Strings.OfficeOM.L_MissingParameter="Parâmetro Ausente";Strings.OfficeOM.L_IndexOutOfRange="Índice fora do intervalo.";Strings.OfficeOM.L_SettingsStaleError="Erro de configurações obsoletos";Strings.OfficeOM.L_CannotNavigateTo="O objeto está localizado em um local onde a navegação não é suportada.";Strings.OfficeOM.L_ReadSettingsError="Erro de leitura de configurações";Strings.OfficeOM.L_InvalidGetColumns="As colunas especificadas são inválidas.";Strings.OfficeOM.L_CoercionTypeNotSupported="O tipo de coerção especificado não tem suporte.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="O aplicativo {0} não existe. Microsoft.Office.WebExtension.Initialize(reason) não é chamado.";Strings.OfficeOM.L_OverwriteWorksheetData="A operação definida falhou porque o objeto de dados fornecido irá sobrescrever ou deslocar os dados.";Strings.OfficeOM.L_RowIndexOutOfRange="O valor de índice de linha está fora do intervalo permitido. Use um valor (0 ou superior) que seja menor do que o número de linhas.";Strings.OfficeOM.L_InvalidReadForBlankRow="A linha especificada está em branco.";Strings.OfficeOM.L_ColIndexOutOfRange="O valor de índice de coluna está fora do intervalo permitido. Use um valor (0 ou superior) que seja menor do que o número de colunas.";Strings.OfficeOM.L_UnsupportedEnumeration="Enumeração sem Suporte";Strings.OfficeOM.L_InvalidParameters="A função {0} possui parâmetros inválidos.";Strings.OfficeOM.L_SetDataParametersConflict="Os parâmetros especificados estão em conflito.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Chame closeAsync no arquivo atual antes de recuperar outro.";Strings.OfficeOM.L_DataNotMatchCoercionType="O tipo do objeto de dados especificado não é compatível com a seleção atual.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="A enumeração não tem suporte no aplicativo host atual.";Strings.OfficeOM.L_InvalidCoercion="Tipo inválido de coerção";Strings.OfficeOM.L_NotSupportedEventType="Não há suporte para o tipo de evento especificado {0}.";Strings.OfficeOM.L_UnsupportedDataObject="Não há suporte para o tipo de objeto de dados fornecido.";Strings.OfficeOM.L_GetDataIsTooLarge="O conjunto de dados solicitado é muito grande.";Strings.OfficeOM.L_AppNameNotExist="O AppName para {0} não existe.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Faça uma seleção.";Strings.OfficeOM.L_MultipleNamedItemFound="Foram encontrados vários objetos com o mesmo nome.";Strings.OfficeOM.L_InvalidCellsValue="Um ou mais parâmetros de célula têm valores que não são permitidos. Verifique outra vez os valores e tente novamente.";Strings.OfficeOM.L_DataNotMatchBindingType="O objeto de dados especificado não é compatível com o tipo de ligação.";Strings.OfficeOM.L_InvalidFormatValue="Um ou mais parâmetros de formato têm valores que não são permitidos. Verifique outra vez os valores e tente novamente.";Strings.OfficeOM.L_NotSupportedBindingType="Não há suporte para o tipo de ligação especificado {0}.";Strings.OfficeOM.L_InitializeNotReady="O Office.js ainda não está totalmente carregado. Tente novamente mais tarde ou verifique se você adicionou seu código de inicialização na função Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Lembrete de Formatação";Strings.OfficeOM.L_ShuttingDown="Falha na operação porque os dados não são atuais no servidor.";Strings.OfficeOM.L_OperationNotSupported="A operação não é suportada.";Strings.OfficeOM.L_DocumentReadOnly="A operação solicitada não é permitida no modo de documento atual.";Strings.OfficeOM.L_NamedItemNotFound="O item nomeado não existe.";Strings.OfficeOM.L_InvalidApiCallInContext="Chamada de API inválida no contexto atual.";Strings.OfficeOM.L_InvalidGetRows="As linhas especificadas são inválidas.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Observação: é recomendável que os conjuntos de formatação definidos por uma chamada de API de formatação não ultrapassem 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Aguarde até que a chamada anterior for concluída.";Strings.OfficeOM.L_SetDataIsTooLarge="O objeto de dados especificado é muito grande.";Strings.OfficeOM.L_DataWriteError="Erro de gravação de dados";Strings.OfficeOM.L_InvalidBindingOperation="Operação de Associação Inválida";Strings.OfficeOM.L_APICallFailed="Falha na Chamada à API";Strings.OfficeOM.L_SpecifiedIdNotExist="A ID especificada não existe.";Strings.OfficeOM.L_FunctionCallFailed="Falha na chamada de função {0}, código de erro: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="O objeto de dados fornecido não corresponde ao tamanho da seleção atual.";Strings.OfficeOM.L_SaveSettingsError="Salvar erro de configurações";Strings.OfficeOM.L_RequestTokenUnavailable="Esta API foi limitada para reduzir a frequência de chamada.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Os valores startRow ou startColumn especificados são inválidos.";Strings.OfficeOM.L_InvalidFormat="Erro de formato inválido";Strings.OfficeOM.L_BindingNotExist="A ligação especificada não existe.";Strings.OfficeOM.L_SettingNameNotExist="O nome de configuração especificado não existe.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Falha ao adicionar o manipulador de eventos.";Strings.OfficeOM.L_BrowserAPINotSupported="Este navegador não oferece suporte para a API solicitada.";Strings.OfficeOM.L_InvalidAPICall="Chamada de API inválida";Strings.OfficeOM.L_EventRegistrationError="Erro de registro de eventos";Strings.OfficeOM.L_ElementMissing="Não foi possível formatar a célula da tabela, pois faltam alguns valores de parâmetro. Verifique outra vez os parâmetros e tente novamente.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Parâmetros de coordenadas não podem ser usados com a Tabela de tipo de coerção quando a tabela contém células mescladas.";Strings.OfficeOM.L_NavOutOfBound="A operação falhou porque o índice está fora do intervalo.";Strings.OfficeOM.L_RedundantCallbackSpecification="O retorno de chamada não pode ser especificado na lista de argumentos e no objeto opcional.";Strings.OfficeOM.L_CustomXmlError="Erro no XML personalizado.";Strings.OfficeOM.L_SettingsAreStale="As configurações não puderam ser salvas porque não são atuais.";Strings.OfficeOM.L_TooManyOptionalFunction="várias funções opcionais na lista de parâmetros";Strings.OfficeOM.L_MissingRequiredArguments="alguns argumentos necessários ausentes";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Parâmetros de coordenadas não podem ser usados com a Tabela de tipo de coerção quando a tabela contém células mescladas.";Strings.OfficeOM.L_HostError="Erro de host";Strings.OfficeOM.L_OutOfRange="Fora do Intervalo";Strings.OfficeOM.L_InvalidSelectionForBindingType="Não é possível criar uma ligação com a seleção atual e o tipo de ligação especificada.";Strings.OfficeOM.L_TooManyOptionalObjects="vários objetos opcionais na lista de parâmetros";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="O conteúdo selecionado precisa estar em formato de tabela. Formate os dados como uma tabela e tente novamente.";Strings.OfficeOM.L_APINotSupported="API sem Suporte";Strings.OfficeOM.L_SliceSizeNotSupported="O tamanho da fatia especificado não tem suporte.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Falha ao remover o manipulador de eventos.";Strings.OfficeOM.L_BindingToMultipleSelection="Não há suporte para várias seleções não contíguas.";Strings.OfficeOM.L_DataReadError="Erro de leitura de dados";Strings.OfficeOM.L_InternalErrorDescription="Ocorreu um erro interno.";Strings.OfficeOM.L_InvalidDataFormat="O formato do objeto de dados especificado é inválido.";Strings.OfficeOM.L_RequestTimeout="A chamada demorou muito tempo para executar.";Strings.OfficeOM.L_DataStale="Dados Não Atuais";Strings.OfficeOM.L_GetSelectionNotSupported="A seleção atual não tem suporte.";Strings.OfficeOM.L_MemoryLimit="Limite de Memória Excedido";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Observação: é recomendável que o número de células em uma tabela não ultrapasse 20.000 células.";Strings.OfficeOM.L_InvalidTableOptionValue="Um ou mais parâmetros tableOptions tem valores que não são permitidos. Verifique outra vez os valores e tente novamente.";Strings.OfficeOM.L_PermissionDenied="Permissão negada";Strings.OfficeOM.L_InvalidDataObject="Objeto de dados inválido";Strings.OfficeOM.L_UserNotSignedIn="Nenhum usuário está conectado ao Office.";Strings.OfficeOM.L_SelectionCannotBound="Não é possível ligar à seleção atual.";Strings.OfficeOM.L_InvalidColumnsForBinding="As colunas especificadas são inválidas.";Strings.OfficeOM.L_BadSelectorString="A cadeia de caracteres passada para o seletor está formatada incorretamente ou não tem suporte.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Os valores rowCount e columnCount especificados são inválidos.";Strings.OfficeOM.L_OsfControlTypeNotSupported="O tipo OsfControl não tem suporte.";Strings.OfficeOM.L_InvalidValue="Valor Inválido";Strings.OfficeOM.L_DataNotMatchSelection="O objeto de dados fornecido não é compatível com a forma ou as dimensões da seleção atual.";Strings.OfficeOM.L_InternalError="Erro interno";Strings.OfficeOM.L_NotSupported="Função {0} não é suportada.";Strings.OfficeOM.L_CustomXmlNodeNotFound="O nó especificado não foi encontrado.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="O tipo de coerção especificado não é compatível com este tipo de associação.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Um problema de rede impediu a recuperação do arquivo.";Strings.OfficeOM.L_TooManyArguments="muitos argumentos";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operação sem suporte neste tipo de associação.";Strings.OfficeOM.L_InValidOptionalArgument="argumento opcional inválido";Strings.OfficeOM.L_FileTypeNotSupported="O tipo de arquivo especificado não tem suporte.";Strings.OfficeOM.L_GetDataParametersConflict="Os parâmetros especificados estão em conflito.";Strings.OfficeOM.L_CallbackNotAFunction="O retorno de chamada deve ser do tipo função, era do tipo {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/outlook_strings.debug.js new file mode 100644 index 000000000..a0bd15a2c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "O anexo não pode ser excluído, pois não foi possível encontrar o anexo com o índice de anexo."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "A solicitação excede o limite de tamanho de 1 MB. Modifique sua solicitação EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "A permissão elevada é necessária para chamar o método: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Erro de Anexo"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "A data de término ocorre antes da data de início."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Um ou mais dos nomes de exibição fornecidos são muito longos."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "O número total de destinatários no campo não pode exceder {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "A limpeza de HTML falhou."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Erro de Gravação de Dados"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "A permissão elevada é necessária para acessar membros protegidos da API JavaScript para Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Anexos não podem ser adicionados, pois a mensagem já possui o número máximo de anexos"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Erro de protocolo interno: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "O usuário removeu o anexo antes de o carregamento ser concluído."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Não foi encontrado um deslocamento para este carimbo de data/hora."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Não foi possível adicionar o anexo, pois ele é muito grande."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "A hora de término não pode ser anterior à hora de início."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Os parâmetros definidos não correspondem ao formato esperado."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "O anexo não pode ser adicionado ao item."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Não foram fornecidos destinatários válidos."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "A ID do anexo era inválida."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Anexos não podem ser adicionados enquanto o encaminhamento ou resposta completa estiver sendo recuperada do servidor."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Um ou mais endereços de email fornecidos são muito longos."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "O caminho do anexo era inválido."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "O anexo não pode ser excluído do item."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Houve um erro de formato interno."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "A entrada não é resolvida como uma data válida."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "O usuário alterou a posição do cursor durante a inserção dos dados." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/outlook_strings.js new file mode 100644 index 000000000..a168c114c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-br/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="O anexo não pode ser excluído, pois não foi possível encontrar o anexo com o índice de anexo.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="A solicitação excede o limite de tamanho de 1 MB. Modifique sua solicitação EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="A permissão elevada é necessária para chamar o método: '{0}'.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Erro de Anexo";_u.ExtensibilityStrings.l_InvalidEventDates_Text="A data de término ocorre antes da data de início.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Um ou mais dos nomes de exibição fornecidos são muito longos.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="O número total de destinatários no campo não pode exceder {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="A limpeza de HTML falhou.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Erro de Gravação de Dados";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="A permissão elevada é necessária para acessar membros protegidos da API JavaScript para Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Anexos não podem ser adicionados, pois a mensagem já possui o número máximo de anexos";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Erro de protocolo interno: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="O usuário removeu o anexo antes de o carregamento ser concluído.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Não foi encontrado um deslocamento para este carimbo de data/hora.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Não foi possível adicionar o anexo, pois ele é muito grande.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="A hora de término não pode ser anterior à hora de início.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Os parâmetros definidos não correspondem ao formato esperado.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="O anexo não pode ser adicionado ao item.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Não foram fornecidos destinatários válidos.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="A ID do anexo era inválida.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Anexos não podem ser adicionados enquanto o encaminhamento ou resposta completa estiver sendo recuperada do servidor.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Um ou mais endereços de email fornecidos são muito longos.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="O caminho do anexo era inválido.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="O anexo não pode ser excluído do item.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Houve um erro de formato interno.";_u.ExtensibilityStrings.l_InvalidDate_Text="A entrada não é resolvida como uma data válida.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="O usuário alterou a posição do cursor durante a inserção dos dados." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/office_strings.debug.js new file mode 100644 index 000000000..2d3ffe157 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "O tipo de vínculo especificado não é compatível com item nomeado fornecido."; +Strings.OfficeOM.L_EventHandlerNotExist = "O processador de eventos especificado não foi encontrado para este enlace."; +Strings.OfficeOM.L_UnknownBindingType = "O tipo de vínculo não é suportado."; +Strings.OfficeOM.L_InvalidNode = "Nó Inválido"; +Strings.OfficeOM.L_NotImplemented = "A função {0} não está implementada."; +Strings.OfficeOM.L_NoCapability = "Não possui permissões suficientes para efetuar esta ação."; +Strings.OfficeOM.L_SettingsCannotSave = "Não foi possível guardar as definições."; +Strings.OfficeOM.L_DataWriteReminder = "Lembrete de Escrita de Dados"; +Strings.OfficeOM.L_InvalidBinding = "Vínculo Inválido"; +Strings.OfficeOM.L_InvalidSetColumns = "As colunas especificadas são inválidas."; +Strings.OfficeOM.L_BindingCreationError = "Erro de Criação de Vínculo"; +Strings.OfficeOM.L_FormatValueOutOfRange = "O valor está fora do intervalo permitido."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "A seleção atual não é compatível com tipo de coerção especificado."; +Strings.OfficeOM.L_InvalidBindingError = "Erro de Vínculo Inválido"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Os valores de startRow or startColumn especificados são inválidos."; +Strings.OfficeOM.L_InvalidSetRows = "As linhas especificadas são inválidas."; +Strings.OfficeOM.L_NetworkProblem = "Problema de Rede"; +Strings.OfficeOM.L_CannotWriteToSelection = "Não é possível escrever para a seleção atual."; +Strings.OfficeOM.L_MissingParameter = "Parâmetro em Falta"; +Strings.OfficeOM.L_IndexOutOfRange = "O índice está fora do intervalo."; +Strings.OfficeOM.L_SettingsStaleError = "Erro Obsoleto de Definições"; +Strings.OfficeOM.L_CannotNavigateTo = "O objeto está localizado num lugar onde a navegação não é suportada."; +Strings.OfficeOM.L_ReadSettingsError = "Erro ao Ler Definições"; +Strings.OfficeOM.L_InvalidGetColumns = "As colunas especificadas são inválidas."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "O tipo de coerção especificado não é suportado."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "A aplicação {0} não existe. O Microsoft.Office.WebExtension.Initialize(reason) não foi chamado."; +Strings.OfficeOM.L_OverwriteWorksheetData = "A operação definida falhou porque o objeto de dados fornecido irá substituir ou alterar dados."; +Strings.OfficeOM.L_RowIndexOutOfRange = "O valor do índice de linhas encontra-se fora do intervalo permitido. Utilize um valor (0 ou superior) que seja inferior ao número de linhas."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "A linha especificada está em branco."; +Strings.OfficeOM.L_ColIndexOutOfRange = "O valor do índice de colunas encontra-se fora do intervalo permitido. Utilize um valor (0 ou superior) que seja inferior ao número de colunas."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Enumeração Não Suportada"; +Strings.OfficeOM.L_InvalidParameters = "A função {0} tem parâmetros inválidos."; +Strings.OfficeOM.L_SetDataParametersConflict = "Os parâmetros especificados estão em conflito."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Ligar ao closeAsync no Ficheiro atual antes de obter outro."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "O tipo do objeto de dados especificado não é compatível com a seleção atual."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "A enumeração não é suportada na aplicação do anfitrião atual."; +Strings.OfficeOM.L_InvalidCoercion = "Tipo de Coerção Inválido"; +Strings.OfficeOM.L_NotSupportedEventType = "O tipo de evento especificado {0} não é suportado."; +Strings.OfficeOM.L_UnsupportedDataObject = "O objeto de dados fornecido não é suportado."; +Strings.OfficeOM.L_GetDataIsTooLarge = "O conjunto de dados pedido é grande demais."; +Strings.OfficeOM.L_AppNameNotExist = "O NomeDeAplicação para {0} não existe."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Faça uma seleção."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Foram encontrados vários objetos com o mesmo nome."; +Strings.OfficeOM.L_InvalidCellsValue = "Um ou mais parâmetros das células possuem valores que não são permitidos. Verifique os valores e tente novamente."; +Strings.OfficeOM.L_DataNotMatchBindingType = "O objeto de dados especificado não é compatível com o tipo de vínculo."; +Strings.OfficeOM.L_InvalidFormatValue = "Um ou mais parâmetros de formatação possuem valores que não são permitidos. Verifique os valores e tente novamente."; +Strings.OfficeOM.L_NotSupportedBindingType = "O tipo de enlace especificado {0} não é suportado."; +Strings.OfficeOM.L_InitializeNotReady = "O Office.js ainda não foi totalmente carregado. Tente novamente mais tarde ou certifique-se de que adiciona o seu código de inicialização na função Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Lembrete de Formatação"; +Strings.OfficeOM.L_ShuttingDown = "A operação falhou porque os dados no servidor estão obsoletos."; +Strings.OfficeOM.L_OperationNotSupported = "A operação não é suportada."; +Strings.OfficeOM.L_DocumentReadOnly = "A operação solicitada não é permitida no modo de documento atual."; +Strings.OfficeOM.L_NamedItemNotFound = "O item com nome não existe."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Chamada de API inválida no contexto atual."; +Strings.OfficeOM.L_InvalidGetRows = "As linhas especificadas são inválidas."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Nota: sugerimos que os conjuntos de formatação definidos por uma chamada de API de Formatação sejam inferiores a 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Aguarde até a chamada anterior ser concluída."; +Strings.OfficeOM.L_SetDataIsTooLarge = "O objeto de dados especificado é grande demais."; +Strings.OfficeOM.L_DataWriteError = "Erro de Escrita de Dados"; +Strings.OfficeOM.L_InvalidBindingOperation = "Operação de Vínculo Inválido"; +Strings.OfficeOM.L_APICallFailed = "Falha na Chamada à API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "O ID especificado não existe."; +Strings.OfficeOM.L_FunctionCallFailed = "Chamada de função {0} falhou, código de erro: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "O objeto de dados fornecido não corresponde ao tamanho da seleção atual."; +Strings.OfficeOM.L_SaveSettingsError = "Erro ao Guardar Definições"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Esta API foi limitada para diminuir a frequência de chamadas."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Os valores de startRow or startColumn especificados são inválidos."; +Strings.OfficeOM.L_InvalidFormat = "Erro de Formato Inválido"; +Strings.OfficeOM.L_BindingNotExist = "O vínculo especificado não existe."; +Strings.OfficeOM.L_SettingNameNotExist = "O nome da definição especificada não existe."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Não foi possível adicionar o processador de eventos."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Este browser não suporta a API pedida."; +Strings.OfficeOM.L_InvalidAPICall = "Chamada de API Inválida"; +Strings.OfficeOM.L_EventRegistrationError = "Erro de Registo de Evento"; +Strings.OfficeOM.L_ElementMissing = "Não conseguimos formatar a célula da tabela porque alguns valores de parâmetro estão em falta. Verifique os parâmetros e tente novamente."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Os parâmetros coordenados não podem ser usados com Tabelas de tipo coerção quando a tabela contém células unidas."; +Strings.OfficeOM.L_NavOutOfBound = "A operação falhou porque o índice está fora do intervalo."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "A chamada de retorno não pode ser especificada simultaneamente na lista de argumentos e no objeto opcional."; +Strings.OfficeOM.L_CustomXmlError = "Erro de XML Personalizado."; +Strings.OfficeOM.L_SettingsAreStale = "Não foi possível guardar as definições por estarem obsoletas."; +Strings.OfficeOM.L_TooManyOptionalFunction = "várias funções opcionais na lista de parâmetros"; +Strings.OfficeOM.L_MissingRequiredArguments = "faltam alguns argumentos necessários"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Os parâmetros coordenados não podem ser usados com Tabelas de tipo coerção quando a tabela contém células unidas."; +Strings.OfficeOM.L_HostError = "Erro de Anfitrião"; +Strings.OfficeOM.L_OutOfRange = "Fora do Intervalo"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Não é possível criar um vínculo com a seleção atual e o tipo de vínculo especificado."; +Strings.OfficeOM.L_TooManyOptionalObjects = "vários objetos opcionais na lista de parâmetros"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "O conteúdo selecionado tem de estar em formato de tabela. Formate os dados como uma tabela e tente novamente."; +Strings.OfficeOM.L_APINotSupported = "API Não Suportada"; +Strings.OfficeOM.L_SliceSizeNotSupported = "O tamanho de setor especificado não é suportado."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Não foi possível remover o processador de eventos."; +Strings.OfficeOM.L_BindingToMultipleSelection = "As seleções não contíguas não são suportadas."; +Strings.OfficeOM.L_DataReadError = "Erro de Leitura de Dados"; +Strings.OfficeOM.L_InternalErrorDescription = "Ocorreu um erro interno."; +Strings.OfficeOM.L_InvalidDataFormat = "O formato do objeto de dados especificado é inválido."; +Strings.OfficeOM.L_RequestTimeout = "A chamada demorou demasiado tempo a ser executada."; +Strings.OfficeOM.L_DataStale = "Dados Obsoletos"; +Strings.OfficeOM.L_GetSelectionNotSupported = "A seleção atual não é suportada."; +Strings.OfficeOM.L_MemoryLimit = "Limite de Memória Excedido"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Nota: sugerimos que o número de células numa tabela seja inferior a 20.000 células."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Um ou mais parâmetros tableOptions possuem valores que não são permitidos. Verifique os valores e tente novamente."; +Strings.OfficeOM.L_PermissionDenied = "Permissão Recusada"; +Strings.OfficeOM.L_InvalidDataObject = "Objeto de Dados Inválido"; +Strings.OfficeOM.L_UserNotSignedIn = "Nenhum utilizador tem sessão iniciada no Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Não é possível vincular à seleção atual."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "As colunas especificadas são inválidas."; +Strings.OfficeOM.L_BadSelectorString = "A cadeia transmitida para o seletor está formatada de forma incorreta ou não é suportada."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Os valores de rowCount e columnCount especificados são inválidos."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Tipo de OsfControl não suportado."; +Strings.OfficeOM.L_InvalidValue = "Valor Inválido"; +Strings.OfficeOM.L_DataNotMatchSelection = "O objeto de dados fornecido não é compatível com a forma ou dimensões da seleção atual."; +Strings.OfficeOM.L_InternalError = "Erro Interno"; +Strings.OfficeOM.L_NotSupported = "A função {0} não é suportada."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "O nó especificado não foi encontrado."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "O tipo de coerção especificado não é compatível com o este tipo de vínculo."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Um problema de rede impediu a obtenção do ficheiro."; +Strings.OfficeOM.L_TooManyArguments = "demasiados argumentos"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "A operação não é suportada neste tipo de vínculo."; +Strings.OfficeOM.L_InValidOptionalArgument = "argumento opcional inválido"; +Strings.OfficeOM.L_FileTypeNotSupported = "O tipo de ficheiro especificado não é suportado."; +Strings.OfficeOM.L_GetDataParametersConflict = "Os parâmetros especificados estão em conflito."; +Strings.OfficeOM.L_CallbackNotAFunction = "A chamada de retorno tem de ser do tipo função e era do tipo {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/office_strings.js new file mode 100644 index 000000000..05556a760 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="O tipo de vínculo especificado não é compatível com item nomeado fornecido.";Strings.OfficeOM.L_EventHandlerNotExist="O processador de eventos especificado não foi encontrado para este enlace.";Strings.OfficeOM.L_UnknownBindingType="O tipo de vínculo não é suportado.";Strings.OfficeOM.L_InvalidNode="Nó Inválido";Strings.OfficeOM.L_NotImplemented="A função {0} não está implementada.";Strings.OfficeOM.L_NoCapability="Não possui permissões suficientes para efetuar esta ação.";Strings.OfficeOM.L_SettingsCannotSave="Não foi possível guardar as definições.";Strings.OfficeOM.L_DataWriteReminder="Lembrete de Escrita de Dados";Strings.OfficeOM.L_InvalidBinding="Vínculo Inválido";Strings.OfficeOM.L_InvalidSetColumns="As colunas especificadas são inválidas.";Strings.OfficeOM.L_BindingCreationError="Erro de Criação de Vínculo";Strings.OfficeOM.L_FormatValueOutOfRange="O valor está fora do intervalo permitido.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="A seleção atual não é compatível com tipo de coerção especificado.";Strings.OfficeOM.L_InvalidBindingError="Erro de Vínculo Inválido";Strings.OfficeOM.L_InvalidGetStartRowColumn="Os valores de startRow or startColumn especificados são inválidos.";Strings.OfficeOM.L_InvalidSetRows="As linhas especificadas são inválidas.";Strings.OfficeOM.L_NetworkProblem="Problema de Rede";Strings.OfficeOM.L_CannotWriteToSelection="Não é possível escrever para a seleção atual.";Strings.OfficeOM.L_MissingParameter="Parâmetro em Falta";Strings.OfficeOM.L_IndexOutOfRange="O índice está fora do intervalo.";Strings.OfficeOM.L_SettingsStaleError="Erro Obsoleto de Definições";Strings.OfficeOM.L_CannotNavigateTo="O objeto está localizado num lugar onde a navegação não é suportada.";Strings.OfficeOM.L_ReadSettingsError="Erro ao Ler Definições";Strings.OfficeOM.L_InvalidGetColumns="As colunas especificadas são inválidas.";Strings.OfficeOM.L_CoercionTypeNotSupported="O tipo de coerção especificado não é suportado.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="A aplicação {0} não existe. O Microsoft.Office.WebExtension.Initialize(reason) não foi chamado.";Strings.OfficeOM.L_OverwriteWorksheetData="A operação definida falhou porque o objeto de dados fornecido irá substituir ou alterar dados.";Strings.OfficeOM.L_RowIndexOutOfRange="O valor do índice de linhas encontra-se fora do intervalo permitido. Utilize um valor (0 ou superior) que seja inferior ao número de linhas.";Strings.OfficeOM.L_InvalidReadForBlankRow="A linha especificada está em branco.";Strings.OfficeOM.L_ColIndexOutOfRange="O valor do índice de colunas encontra-se fora do intervalo permitido. Utilize um valor (0 ou superior) que seja inferior ao número de colunas.";Strings.OfficeOM.L_UnsupportedEnumeration="Enumeração Não Suportada";Strings.OfficeOM.L_InvalidParameters="A função {0} tem parâmetros inválidos.";Strings.OfficeOM.L_SetDataParametersConflict="Os parâmetros especificados estão em conflito.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Ligar ao closeAsync no Ficheiro atual antes de obter outro.";Strings.OfficeOM.L_DataNotMatchCoercionType="O tipo do objeto de dados especificado não é compatível com a seleção atual.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="A enumeração não é suportada na aplicação do anfitrião atual.";Strings.OfficeOM.L_InvalidCoercion="Tipo de Coerção Inválido";Strings.OfficeOM.L_NotSupportedEventType="O tipo de evento especificado {0} não é suportado.";Strings.OfficeOM.L_UnsupportedDataObject="O objeto de dados fornecido não é suportado.";Strings.OfficeOM.L_GetDataIsTooLarge="O conjunto de dados pedido é grande demais.";Strings.OfficeOM.L_AppNameNotExist="O NomeDeAplicação para {0} não existe.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Faça uma seleção.";Strings.OfficeOM.L_MultipleNamedItemFound="Foram encontrados vários objetos com o mesmo nome.";Strings.OfficeOM.L_InvalidCellsValue="Um ou mais parâmetros das células possuem valores que não são permitidos. Verifique os valores e tente novamente.";Strings.OfficeOM.L_DataNotMatchBindingType="O objeto de dados especificado não é compatível com o tipo de vínculo.";Strings.OfficeOM.L_InvalidFormatValue="Um ou mais parâmetros de formatação possuem valores que não são permitidos. Verifique os valores e tente novamente.";Strings.OfficeOM.L_NotSupportedBindingType="O tipo de enlace especificado {0} não é suportado.";Strings.OfficeOM.L_InitializeNotReady="O Office.js ainda não foi totalmente carregado. Tente novamente mais tarde ou certifique-se de que adiciona o seu código de inicialização na função Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Lembrete de Formatação";Strings.OfficeOM.L_ShuttingDown="A operação falhou porque os dados no servidor estão obsoletos.";Strings.OfficeOM.L_OperationNotSupported="A operação não é suportada.";Strings.OfficeOM.L_DocumentReadOnly="A operação solicitada não é permitida no modo de documento atual.";Strings.OfficeOM.L_NamedItemNotFound="O item com nome não existe.";Strings.OfficeOM.L_InvalidApiCallInContext="Chamada de API inválida no contexto atual.";Strings.OfficeOM.L_InvalidGetRows="As linhas especificadas são inválidas.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Nota: sugerimos que os conjuntos de formatação definidos por uma chamada de API de Formatação sejam inferiores a 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Aguarde até a chamada anterior ser concluída.";Strings.OfficeOM.L_SetDataIsTooLarge="O objeto de dados especificado é grande demais.";Strings.OfficeOM.L_DataWriteError="Erro de Escrita de Dados";Strings.OfficeOM.L_InvalidBindingOperation="Operação de Vínculo Inválido";Strings.OfficeOM.L_APICallFailed="Falha na Chamada à API";Strings.OfficeOM.L_SpecifiedIdNotExist="O ID especificado não existe.";Strings.OfficeOM.L_FunctionCallFailed="Chamada de função {0} falhou, código de erro: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="O objeto de dados fornecido não corresponde ao tamanho da seleção atual.";Strings.OfficeOM.L_SaveSettingsError="Erro ao Guardar Definições";Strings.OfficeOM.L_RequestTokenUnavailable="Esta API foi limitada para diminuir a frequência de chamadas.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Os valores de startRow or startColumn especificados são inválidos.";Strings.OfficeOM.L_InvalidFormat="Erro de Formato Inválido";Strings.OfficeOM.L_BindingNotExist="O vínculo especificado não existe.";Strings.OfficeOM.L_SettingNameNotExist="O nome da definição especificada não existe.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Não foi possível adicionar o processador de eventos.";Strings.OfficeOM.L_BrowserAPINotSupported="Este browser não suporta a API pedida.";Strings.OfficeOM.L_InvalidAPICall="Chamada de API Inválida";Strings.OfficeOM.L_EventRegistrationError="Erro de Registo de Evento";Strings.OfficeOM.L_ElementMissing="Não conseguimos formatar a célula da tabela porque alguns valores de parâmetro estão em falta. Verifique os parâmetros e tente novamente.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Os parâmetros coordenados não podem ser usados com Tabelas de tipo coerção quando a tabela contém células unidas.";Strings.OfficeOM.L_NavOutOfBound="A operação falhou porque o índice está fora do intervalo.";Strings.OfficeOM.L_RedundantCallbackSpecification="A chamada de retorno não pode ser especificada simultaneamente na lista de argumentos e no objeto opcional.";Strings.OfficeOM.L_CustomXmlError="Erro de XML Personalizado.";Strings.OfficeOM.L_SettingsAreStale="Não foi possível guardar as definições por estarem obsoletas.";Strings.OfficeOM.L_TooManyOptionalFunction="várias funções opcionais na lista de parâmetros";Strings.OfficeOM.L_MissingRequiredArguments="faltam alguns argumentos necessários";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Os parâmetros coordenados não podem ser usados com Tabelas de tipo coerção quando a tabela contém células unidas.";Strings.OfficeOM.L_HostError="Erro de Anfitrião";Strings.OfficeOM.L_OutOfRange="Fora do Intervalo";Strings.OfficeOM.L_InvalidSelectionForBindingType="Não é possível criar um vínculo com a seleção atual e o tipo de vínculo especificado.";Strings.OfficeOM.L_TooManyOptionalObjects="vários objetos opcionais na lista de parâmetros";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="O conteúdo selecionado tem de estar em formato de tabela. Formate os dados como uma tabela e tente novamente.";Strings.OfficeOM.L_APINotSupported="API Não Suportada";Strings.OfficeOM.L_SliceSizeNotSupported="O tamanho de setor especificado não é suportado.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Não foi possível remover o processador de eventos.";Strings.OfficeOM.L_BindingToMultipleSelection="As seleções não contíguas não são suportadas.";Strings.OfficeOM.L_DataReadError="Erro de Leitura de Dados";Strings.OfficeOM.L_InternalErrorDescription="Ocorreu um erro interno.";Strings.OfficeOM.L_InvalidDataFormat="O formato do objeto de dados especificado é inválido.";Strings.OfficeOM.L_RequestTimeout="A chamada demorou demasiado tempo a ser executada.";Strings.OfficeOM.L_DataStale="Dados Obsoletos";Strings.OfficeOM.L_GetSelectionNotSupported="A seleção atual não é suportada.";Strings.OfficeOM.L_MemoryLimit="Limite de Memória Excedido";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Nota: sugerimos que o número de células numa tabela seja inferior a 20.000 células.";Strings.OfficeOM.L_InvalidTableOptionValue="Um ou mais parâmetros tableOptions possuem valores que não são permitidos. Verifique os valores e tente novamente.";Strings.OfficeOM.L_PermissionDenied="Permissão Recusada";Strings.OfficeOM.L_InvalidDataObject="Objeto de Dados Inválido";Strings.OfficeOM.L_UserNotSignedIn="Nenhum utilizador tem sessão iniciada no Office.";Strings.OfficeOM.L_SelectionCannotBound="Não é possível vincular à seleção atual.";Strings.OfficeOM.L_InvalidColumnsForBinding="As colunas especificadas são inválidas.";Strings.OfficeOM.L_BadSelectorString="A cadeia transmitida para o seletor está formatada de forma incorreta ou não é suportada.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Os valores de rowCount e columnCount especificados são inválidos.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Tipo de OsfControl não suportado.";Strings.OfficeOM.L_InvalidValue="Valor Inválido";Strings.OfficeOM.L_DataNotMatchSelection="O objeto de dados fornecido não é compatível com a forma ou dimensões da seleção atual.";Strings.OfficeOM.L_InternalError="Erro Interno";Strings.OfficeOM.L_NotSupported="A função {0} não é suportada.";Strings.OfficeOM.L_CustomXmlNodeNotFound="O nó especificado não foi encontrado.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="O tipo de coerção especificado não é compatível com o este tipo de vínculo.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Um problema de rede impediu a obtenção do ficheiro.";Strings.OfficeOM.L_TooManyArguments="demasiados argumentos";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="A operação não é suportada neste tipo de vínculo.";Strings.OfficeOM.L_InValidOptionalArgument="argumento opcional inválido";Strings.OfficeOM.L_FileTypeNotSupported="O tipo de ficheiro especificado não é suportado.";Strings.OfficeOM.L_GetDataParametersConflict="Os parâmetros especificados estão em conflito.";Strings.OfficeOM.L_CallbackNotAFunction="A chamada de retorno tem de ser do tipo função e era do tipo {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/outlook_strings.debug.js new file mode 100644 index 000000000..b469961ee --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "O anexo não pode ser eliminado porque não foi possível encontrar o anexo com o índice de anexos."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "O pedido excede o limite de tamanho de 1 MB. Modifique o seu pedido EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = 'São necessárias permissões elevadas para chamar o método: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Erro de Anexo"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "A data de fim ocorre antes da data de início."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Um ou mais dos nomes a apresentar fornecidos são demasiado longos."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "O número total de destinatários no campo não pode ser superior a {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "A limpeza do HTML falhou."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Erro de Escrita de Dados"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "São necessárias permissões elevadas para aceder a membros protegidos da API de Java para Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Não é possível adicionar anexos porque a mensagem já possui o número máximo de anexos"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = 'Erro de protocolo interno: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "O utilizador removeu o anexo antes de o carregamento ser concluído."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Não foi possível encontrar um desfasamento para este carimbo de data/hora."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Não é possível adicionar o anexo porque é demasiado grande."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "A hora de fim não pode ser anterior à hora de início."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Os parâmetros fornecidos não correspondem ao formato esperado."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Não é possível adicionar o anexo ao item."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Não foram fornecidos destinatários válidos."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "O ID do anexo era inválido."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Não é possível adicionar anexos enquanto a resposta ou reencaminhamento estiver a ser obtido do servidor."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Um ou mais dos endereços de e-mail fornecidos são demasiado longos."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "O caminho do anexo era inválido."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "O anexo não pode ser eliminado do item."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Houve um erro de formato interno."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Os dados introduzidos não resolvem para uma data válida."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "O utilizador alterou a posição do cursor enquanto os dados estavam a ser inseridos." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/outlook_strings.js new file mode 100644 index 000000000..a58cdb4f5 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/pt-pt/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="O anexo não pode ser eliminado porque não foi possível encontrar o anexo com o índice de anexos.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="O pedido excede o limite de tamanho de 1 MB. Modifique o seu pedido EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text='São necessárias permissões elevadas para chamar o método: "{0}".';_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Erro de Anexo";_u.ExtensibilityStrings.l_InvalidEventDates_Text="A data de fim ocorre antes da data de início.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Um ou mais dos nomes a apresentar fornecidos são demasiado longos.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="O número total de destinatários no campo não pode ser superior a {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="A limpeza do HTML falhou.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Erro de Escrita de Dados";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="São necessárias permissões elevadas para aceder a membros protegidos da API de Java para Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Não é possível adicionar anexos porque a mensagem já possui o número máximo de anexos";_u.ExtensibilityStrings.l_InternalProtocolError_Text='Erro de protocolo interno: "{0}".';_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="O utilizador removeu o anexo antes de o carregamento ser concluído.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Não foi possível encontrar um desfasamento para este carimbo de data/hora.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Não é possível adicionar o anexo porque é demasiado grande.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="A hora de fim não pode ser anterior à hora de início.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Os parâmetros fornecidos não correspondem ao formato esperado.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Não é possível adicionar o anexo ao item.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Não foram fornecidos destinatários válidos.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="O ID do anexo era inválido.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Não é possível adicionar anexos enquanto a resposta ou reencaminhamento estiver a ser obtido do servidor.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Um ou mais dos endereços de e-mail fornecidos são demasiado longos.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="O caminho do anexo era inválido.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="O anexo não pode ser eliminado do item.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Houve um erro de formato interno.";_u.ExtensibilityStrings.l_InvalidDate_Text="Os dados introduzidos não resolvem para uma data válida.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="O utilizador alterou a posição do cursor enquanto os dados estavam a ser inseridos." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/office_strings.debug.js new file mode 100644 index 000000000..9236d065e --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Tipul specificat de legare nu este compatibil cu elementul denumit furnizat."; +Strings.OfficeOM.L_EventHandlerNotExist = "Rutina de tratare a evenimentului specificat nu a fost găsită pentru această legare."; +Strings.OfficeOM.L_UnknownBindingType = "Tipul de legare nu este acceptat."; +Strings.OfficeOM.L_InvalidNode = "Nod nevalid"; +Strings.OfficeOM.L_NotImplemented = "Funcția {0} nu este implementată."; +Strings.OfficeOM.L_NoCapability = "Nu aveți suficiente permisiuni pentru această acțiune."; +Strings.OfficeOM.L_SettingsCannotSave = "Setările nu s-au putut salva."; +Strings.OfficeOM.L_DataWriteReminder = "Memento de scriere a datelor"; +Strings.OfficeOM.L_InvalidBinding = "Legare nevalidă"; +Strings.OfficeOM.L_InvalidSetColumns = "Coloanele specificate nu sunt valide."; +Strings.OfficeOM.L_BindingCreationError = "Eroare de creare a legării"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Valoarea este în afara intervalului permis."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Selecția curentă nu este compatibilă cu tipul de impunere specificat."; +Strings.OfficeOM.L_InvalidBindingError = "Eroare de legare nevalidă"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Valorile startRow sau startColumn specificate nu sunt valide."; +Strings.OfficeOM.L_InvalidSetRows = "Rândurile specificate nu sunt valide."; +Strings.OfficeOM.L_NetworkProblem = "Problemă de rețea"; +Strings.OfficeOM.L_CannotWriteToSelection = "Nu se poate scrie în selecția curentă."; +Strings.OfficeOM.L_MissingParameter = "Parametru lipsă"; +Strings.OfficeOM.L_IndexOutOfRange = "Index în afara intervalului."; +Strings.OfficeOM.L_SettingsStaleError = "Eroare de setări învechite"; +Strings.OfficeOM.L_CannotNavigateTo = "Obiectul este situat într-un loc unde nu este acceptată navigarea."; +Strings.OfficeOM.L_ReadSettingsError = "Eroare de citire a setărilor"; +Strings.OfficeOM.L_InvalidGetColumns = "Coloanele specificate nu sunt valide."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Tipul de impunere specificat nu este acceptat."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Aplicația {0} nu există. Nu s-a apelat Microsoft.Office.WebExtension.initialize(motiv)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Operația de setare nu a reușit pentru că obiectul de date furnizat va suprascrie sau va schimba datele."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Valoarea de index a rândului este în afara intervalului permis. Utilizați o valoare (0 sau mai mare) care este mai mică decât numărul de rânduri."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Rândul specificat este necompletat."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Valoarea de index a coloanei este în afara intervalului permis. Utilizați o valoare (0 sau mai mare) care este mai mică decât numărul de coloane."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Enumerare neacceptată"; +Strings.OfficeOM.L_InvalidParameters = "Funcția {0} are parametri nevalizi."; +Strings.OfficeOM.L_SetDataParametersConflict = "Parametrii specificați sunt în conflict."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Apelați closeAsync pentru fișierul curent înainte de a regăsi altul."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Tipul de obiect de date specificat nu este compatibil cu selecția curentă."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Enumerarea nu este acceptată în aplicația gazdă curentă."; +Strings.OfficeOM.L_InvalidCoercion = "Tipul de coerciție nu este valid"; +Strings.OfficeOM.L_NotSupportedEventType = "Tipul de eveniment {0} specificat nu este acceptat."; +Strings.OfficeOM.L_UnsupportedDataObject = "Tipul obiectului de date furnizat nu este acceptat."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Setul de date solicitat este prea mare."; +Strings.OfficeOM.L_AppNameNotExist = "Nu există AppName pentru {0}."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Vă rugăm să faceți o selecție."; +Strings.OfficeOM.L_MultipleNamedItemFound = "S-au găsit mai multe obiecte cu același nume."; +Strings.OfficeOM.L_InvalidCellsValue = "Unul sau mai mulți dintre parametrii de celule au valori nepermise. Reverificați valorile și încercați din nou."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Obiectul de date specificat nu este compatibil cu tipul de legare."; +Strings.OfficeOM.L_InvalidFormatValue = "Unul sau mai mulți dintre parametrii de format au valori nepermise. Reverificați valorile și încercați din nou."; +Strings.OfficeOM.L_NotSupportedBindingType = "Tipul de legare {0} specificat nu este acceptat."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js încă nu s-a încărcat complet. Încercați din nou mai târziu sau asigurați-vă că adăugați codul de inițializare în funcția Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Se formatează memento-ul"; +Strings.OfficeOM.L_ShuttingDown = "Operația nu a reușit pentru că datele de pe server nu sunt actuale."; +Strings.OfficeOM.L_OperationNotSupported = "Operație neacceptată."; +Strings.OfficeOM.L_DocumentReadOnly = "Operațiunea solicitată nu este permisă pe modul curent al documentului."; +Strings.OfficeOM.L_NamedItemNotFound = "Elementul denumit nu există."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Apel API nevalid în contextul curent."; +Strings.OfficeOM.L_InvalidGetRows = "Rândurile specificate nu sunt valide."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Notă: se sugerează ca seturile de formatări setate de o apelare de Formatare API să fie mai puține de 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Așteptați finalizarea apelului anterior."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Obiectul de date specificat este prea mare."; +Strings.OfficeOM.L_DataWriteError = "Eroare de scriere a datelor"; +Strings.OfficeOM.L_InvalidBindingOperation = "Operația de legare nu este validă"; +Strings.OfficeOM.L_APICallFailed = "Apel API nereușit"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "ID-ul specificat nu există."; +Strings.OfficeOM.L_FunctionCallFailed = "Apelul {0} la funcție nu a reușit, cod de eroare: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Obiectul de date furnizat nu corespunde dimensiunii selecției curente."; +Strings.OfficeOM.L_SaveSettingsError = "Eroare de salvare a setărilor"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Acest API a fost reglat pentru a încetini frecvența de apel."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Valorile startRow sau startColumn specificate nu sunt valide."; +Strings.OfficeOM.L_InvalidFormat = "Eroare de format nevalid"; +Strings.OfficeOM.L_BindingNotExist = "Legarea specificată nu există."; +Strings.OfficeOM.L_SettingNameNotExist = "Numele de setare specificat nu există."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Nu s-a reușit adăugarea rutinei de tratare a evenimentului."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Acest browser nu acceptă API solicitat."; +Strings.OfficeOM.L_InvalidAPICall = "Apel API nevalid"; +Strings.OfficeOM.L_EventRegistrationError = "Eroare de înregistrare eveniment"; +Strings.OfficeOM.L_ElementMissing = "Nu am putut formata celula de tabel pentru că lipsesc unele valori de parametri. Reverificați parametrii și încercați din nou."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Parametrii de coordonate nu se pot utiliza cu tipul de coerciție tabel când tabelul conține celule îmbinate."; +Strings.OfficeOM.L_NavOutOfBound = "Operațiunea nu a reușit pentru că indexul este în afara intervalului."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Apelul invers nu poate fi specificat în lista de argumente și în obiectul opțional."; +Strings.OfficeOM.L_CustomXmlError = "Eroare XML particularizat."; +Strings.OfficeOM.L_SettingsAreStale = "Setările nu au putut fi salvate pentru că nu sunt actuale."; +Strings.OfficeOM.L_TooManyOptionalFunction = "mai multe funcții opționale în lista parametrilor"; +Strings.OfficeOM.L_MissingRequiredArguments = "unele argumente necesare lipsesc"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Parametrii de coordonate nu se pot utiliza cu tipul de coerciție tabel când tabelul conține celule îmbinate."; +Strings.OfficeOM.L_HostError = "Eroare gazdă"; +Strings.OfficeOM.L_OutOfRange = "În afara intervalului"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "O legare nu poate fi creată cu selecția curentă și tipul de legare specificat."; +Strings.OfficeOM.L_TooManyOptionalObjects = "mai multe obiecte opționale în lista parametrilor"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Conținutul selectat trebuie să fie într-un format de tabel. Formatați datele ca tabel și încercați din nou."; +Strings.OfficeOM.L_APINotSupported = "API neacceptat"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Dimensiunea specificată a sectorului nu este acceptată."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Nu s-a reușit eliminarea rutinei de tratare a evenimentului."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Selecțiile neadiacente nu sunt acceptate."; +Strings.OfficeOM.L_DataReadError = "Eroare de citire a datelor"; +Strings.OfficeOM.L_InternalErrorDescription = "Eroare internă."; +Strings.OfficeOM.L_InvalidDataFormat = "Formatul obiectului de date specificat nu este valid."; +Strings.OfficeOM.L_RequestTimeout = "Executarea apelului a durat prea mult timp."; +Strings.OfficeOM.L_DataStale = "Date neactuale"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Selecția curentă nu este acceptată."; +Strings.OfficeOM.L_MemoryLimit = "Limită de memorie depășită"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Notă: se sugerează ca numărul de celule dintr-un tabel să fie sub 20.000 de celule."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Unul sau mai mulți dintre parametrii tableOptions au valori nepermise. Reverificați valorile și încercați din nou."; +Strings.OfficeOM.L_PermissionDenied = "Permisiunea refuzată."; +Strings.OfficeOM.L_InvalidDataObject = "Obiect de date nevalid"; +Strings.OfficeOM.L_UserNotSignedIn = "Niciun utilizator nu este conectat la Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Nu se poate face legarea la selecția curentă."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Coloanele specificate nu sunt valide."; +Strings.OfficeOM.L_BadSelectorString = "Șirul care a trecut în selector este formatat necorespunzător sau nu este acceptat."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Valorile rowCount sau columnCount specificate nu sunt valide."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Tipul OsfControl nu este acceptat."; +Strings.OfficeOM.L_InvalidValue = "Valoare nevalidă"; +Strings.OfficeOM.L_DataNotMatchSelection = "Obiectul de date furnizat nu este compatibil cu forma sau dimensiunile selecției curente."; +Strings.OfficeOM.L_InternalError = "Eroare internă"; +Strings.OfficeOM.L_NotSupported = "Funcția {0} nu este acceptată."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Nodul specificat nu a fost găsit."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Tipul de impunere specificat nu este compatibil cu acest tip de legare."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "O problemă de rețea a împiedicat regăsirea fișierului."; +Strings.OfficeOM.L_TooManyArguments = "prea multe argumente"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Operațiunea nu este acceptată în acest tip de legare."; +Strings.OfficeOM.L_InValidOptionalArgument = "argument opțional incorect"; +Strings.OfficeOM.L_FileTypeNotSupported = "Tipul de fișier specificat nu este acceptat."; +Strings.OfficeOM.L_GetDataParametersConflict = "Parametrii specificați sunt în conflict."; +Strings.OfficeOM.L_CallbackNotAFunction = "Apelul invers trebuie să fie de tipul funcție, a fost de tipul {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/office_strings.js new file mode 100644 index 000000000..47288784a --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Tipul specificat de legare nu este compatibil cu elementul denumit furnizat.";Strings.OfficeOM.L_EventHandlerNotExist="Rutina de tratare a evenimentului specificat nu a fost găsită pentru această legare.";Strings.OfficeOM.L_UnknownBindingType="Tipul de legare nu este acceptat.";Strings.OfficeOM.L_InvalidNode="Nod nevalid";Strings.OfficeOM.L_NotImplemented="Funcția {0} nu este implementată.";Strings.OfficeOM.L_NoCapability="Nu aveți suficiente permisiuni pentru această acțiune.";Strings.OfficeOM.L_SettingsCannotSave="Setările nu s-au putut salva.";Strings.OfficeOM.L_DataWriteReminder="Memento de scriere a datelor";Strings.OfficeOM.L_InvalidBinding="Legare nevalidă";Strings.OfficeOM.L_InvalidSetColumns="Coloanele specificate nu sunt valide.";Strings.OfficeOM.L_BindingCreationError="Eroare de creare a legării";Strings.OfficeOM.L_FormatValueOutOfRange="Valoarea este în afara intervalului permis.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Selecția curentă nu este compatibilă cu tipul de impunere specificat.";Strings.OfficeOM.L_InvalidBindingError="Eroare de legare nevalidă";Strings.OfficeOM.L_InvalidGetStartRowColumn="Valorile startRow sau startColumn specificate nu sunt valide.";Strings.OfficeOM.L_InvalidSetRows="Rândurile specificate nu sunt valide.";Strings.OfficeOM.L_NetworkProblem="Problemă de rețea";Strings.OfficeOM.L_CannotWriteToSelection="Nu se poate scrie în selecția curentă.";Strings.OfficeOM.L_MissingParameter="Parametru lipsă";Strings.OfficeOM.L_IndexOutOfRange="Index în afara intervalului.";Strings.OfficeOM.L_SettingsStaleError="Eroare de setări învechite";Strings.OfficeOM.L_CannotNavigateTo="Obiectul este situat într-un loc unde nu este acceptată navigarea.";Strings.OfficeOM.L_ReadSettingsError="Eroare de citire a setărilor";Strings.OfficeOM.L_InvalidGetColumns="Coloanele specificate nu sunt valide.";Strings.OfficeOM.L_CoercionTypeNotSupported="Tipul de impunere specificat nu este acceptat.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Aplicația {0} nu există. Nu s-a apelat Microsoft.Office.WebExtension.initialize(motiv).";Strings.OfficeOM.L_OverwriteWorksheetData="Operația de setare nu a reușit pentru că obiectul de date furnizat va suprascrie sau va schimba datele.";Strings.OfficeOM.L_RowIndexOutOfRange="Valoarea de index a rândului este în afara intervalului permis. Utilizați o valoare (0 sau mai mare) care este mai mică decât numărul de rânduri.";Strings.OfficeOM.L_InvalidReadForBlankRow="Rândul specificat este necompletat.";Strings.OfficeOM.L_ColIndexOutOfRange="Valoarea de index a coloanei este în afara intervalului permis. Utilizați o valoare (0 sau mai mare) care este mai mică decât numărul de coloane.";Strings.OfficeOM.L_UnsupportedEnumeration="Enumerare neacceptată";Strings.OfficeOM.L_InvalidParameters="Funcția {0} are parametri nevalizi.";Strings.OfficeOM.L_SetDataParametersConflict="Parametrii specificați sunt în conflict.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Apelați closeAsync pentru fișierul curent înainte de a regăsi altul.";Strings.OfficeOM.L_DataNotMatchCoercionType="Tipul de obiect de date specificat nu este compatibil cu selecția curentă.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Enumerarea nu este acceptată în aplicația gazdă curentă.";Strings.OfficeOM.L_InvalidCoercion="Tipul de coerciție nu este valid";Strings.OfficeOM.L_NotSupportedEventType="Tipul de eveniment {0} specificat nu este acceptat.";Strings.OfficeOM.L_UnsupportedDataObject="Tipul obiectului de date furnizat nu este acceptat.";Strings.OfficeOM.L_GetDataIsTooLarge="Setul de date solicitat este prea mare.";Strings.OfficeOM.L_AppNameNotExist="Nu există AppName pentru {0}.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Vă rugăm să faceți o selecție.";Strings.OfficeOM.L_MultipleNamedItemFound="S-au găsit mai multe obiecte cu același nume.";Strings.OfficeOM.L_InvalidCellsValue="Unul sau mai mulți dintre parametrii de celule au valori nepermise. Reverificați valorile și încercați din nou.";Strings.OfficeOM.L_DataNotMatchBindingType="Obiectul de date specificat nu este compatibil cu tipul de legare.";Strings.OfficeOM.L_InvalidFormatValue="Unul sau mai mulți dintre parametrii de format au valori nepermise. Reverificați valorile și încercați din nou.";Strings.OfficeOM.L_NotSupportedBindingType="Tipul de legare {0} specificat nu este acceptat.";Strings.OfficeOM.L_InitializeNotReady="Office.js încă nu s-a încărcat complet. Încercați din nou mai târziu sau asigurați-vă că adăugați codul de inițializare în funcția Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Se formatează memento-ul";Strings.OfficeOM.L_ShuttingDown="Operația nu a reușit pentru că datele de pe server nu sunt actuale.";Strings.OfficeOM.L_OperationNotSupported="Operație neacceptată.";Strings.OfficeOM.L_DocumentReadOnly="Operațiunea solicitată nu este permisă pe modul curent al documentului.";Strings.OfficeOM.L_NamedItemNotFound="Elementul denumit nu există.";Strings.OfficeOM.L_InvalidApiCallInContext="Apel API nevalid în contextul curent.";Strings.OfficeOM.L_InvalidGetRows="Rândurile specificate nu sunt valide.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Notă: se sugerează ca seturile de formatări setate de o apelare de Formatare API să fie mai puține de 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Așteptați finalizarea apelului anterior.";Strings.OfficeOM.L_SetDataIsTooLarge="Obiectul de date specificat este prea mare.";Strings.OfficeOM.L_DataWriteError="Eroare de scriere a datelor";Strings.OfficeOM.L_InvalidBindingOperation="Operația de legare nu este validă";Strings.OfficeOM.L_APICallFailed="Apel API nereușit";Strings.OfficeOM.L_SpecifiedIdNotExist="ID-ul specificat nu există.";Strings.OfficeOM.L_FunctionCallFailed="Apelul {0} la funcție nu a reușit, cod de eroare: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Obiectul de date furnizat nu corespunde dimensiunii selecției curente.";Strings.OfficeOM.L_SaveSettingsError="Eroare de salvare a setărilor";Strings.OfficeOM.L_RequestTokenUnavailable="Acest API a fost reglat pentru a încetini frecvența de apel.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Valorile startRow sau startColumn specificate nu sunt valide.";Strings.OfficeOM.L_InvalidFormat="Eroare de format nevalid";Strings.OfficeOM.L_BindingNotExist="Legarea specificată nu există.";Strings.OfficeOM.L_SettingNameNotExist="Numele de setare specificat nu există.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Nu s-a reușit adăugarea rutinei de tratare a evenimentului.";Strings.OfficeOM.L_BrowserAPINotSupported="Acest browser nu acceptă API solicitat.";Strings.OfficeOM.L_InvalidAPICall="Apel API nevalid";Strings.OfficeOM.L_EventRegistrationError="Eroare de înregistrare eveniment";Strings.OfficeOM.L_ElementMissing="Nu am putut formata celula de tabel pentru că lipsesc unele valori de parametri. Reverificați parametrii și încercați din nou.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Parametrii de coordonate nu se pot utiliza cu tipul de coerciție tabel când tabelul conține celule îmbinate.";Strings.OfficeOM.L_NavOutOfBound="Operațiunea nu a reușit pentru că indexul este în afara intervalului.";Strings.OfficeOM.L_RedundantCallbackSpecification="Apelul invers nu poate fi specificat în lista de argumente și în obiectul opțional.";Strings.OfficeOM.L_CustomXmlError="Eroare XML particularizat.";Strings.OfficeOM.L_SettingsAreStale="Setările nu au putut fi salvate pentru că nu sunt actuale.";Strings.OfficeOM.L_TooManyOptionalFunction="mai multe funcții opționale în lista parametrilor";Strings.OfficeOM.L_MissingRequiredArguments="unele argumente necesare lipsesc";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Parametrii de coordonate nu se pot utiliza cu tipul de coerciție tabel când tabelul conține celule îmbinate.";Strings.OfficeOM.L_HostError="Eroare gazdă";Strings.OfficeOM.L_OutOfRange="În afara intervalului";Strings.OfficeOM.L_InvalidSelectionForBindingType="O legare nu poate fi creată cu selecția curentă și tipul de legare specificat.";Strings.OfficeOM.L_TooManyOptionalObjects="mai multe obiecte opționale în lista parametrilor";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Conținutul selectat trebuie să fie într-un format de tabel. Formatați datele ca tabel și încercați din nou.";Strings.OfficeOM.L_APINotSupported="API neacceptat";Strings.OfficeOM.L_SliceSizeNotSupported="Dimensiunea specificată a sectorului nu este acceptată.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Nu s-a reușit eliminarea rutinei de tratare a evenimentului.";Strings.OfficeOM.L_BindingToMultipleSelection="Selecțiile neadiacente nu sunt acceptate.";Strings.OfficeOM.L_DataReadError="Eroare de citire a datelor";Strings.OfficeOM.L_InternalErrorDescription="Eroare internă.";Strings.OfficeOM.L_InvalidDataFormat="Formatul obiectului de date specificat nu este valid.";Strings.OfficeOM.L_RequestTimeout="Executarea apelului a durat prea mult timp.";Strings.OfficeOM.L_DataStale="Date neactuale";Strings.OfficeOM.L_GetSelectionNotSupported="Selecția curentă nu este acceptată.";Strings.OfficeOM.L_MemoryLimit="Limită de memorie depășită";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Notă: se sugerează ca numărul de celule dintr-un tabel să fie sub 20.000 de celule.";Strings.OfficeOM.L_InvalidTableOptionValue="Unul sau mai mulți dintre parametrii tableOptions au valori nepermise. Reverificați valorile și încercați din nou.";Strings.OfficeOM.L_PermissionDenied="Permisiunea refuzată.";Strings.OfficeOM.L_InvalidDataObject="Obiect de date nevalid";Strings.OfficeOM.L_UserNotSignedIn="Niciun utilizator nu este conectat la Office.";Strings.OfficeOM.L_SelectionCannotBound="Nu se poate face legarea la selecția curentă.";Strings.OfficeOM.L_InvalidColumnsForBinding="Coloanele specificate nu sunt valide.";Strings.OfficeOM.L_BadSelectorString="Șirul care a trecut în selector este formatat necorespunzător sau nu este acceptat.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Valorile rowCount sau columnCount specificate nu sunt valide.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Tipul OsfControl nu este acceptat.";Strings.OfficeOM.L_InvalidValue="Valoare nevalidă";Strings.OfficeOM.L_DataNotMatchSelection="Obiectul de date furnizat nu este compatibil cu forma sau dimensiunile selecției curente.";Strings.OfficeOM.L_InternalError="Eroare internă";Strings.OfficeOM.L_NotSupported="Funcția {0} nu este acceptată.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Nodul specificat nu a fost găsit.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Tipul de impunere specificat nu este compatibil cu acest tip de legare.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="O problemă de rețea a împiedicat regăsirea fișierului.";Strings.OfficeOM.L_TooManyArguments="prea multe argumente";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operațiunea nu este acceptată în acest tip de legare.";Strings.OfficeOM.L_InValidOptionalArgument="argument opțional incorect";Strings.OfficeOM.L_FileTypeNotSupported="Tipul de fișier specificat nu este acceptat.";Strings.OfficeOM.L_GetDataParametersConflict="Parametrii specificați sunt în conflict.";Strings.OfficeOM.L_CallbackNotAFunction="Apelul invers trebuie să fie de tipul funcție, a fost de tipul {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/outlook_strings.debug.js new file mode 100644 index 000000000..7b3115e92 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Atașarea nu poate fi ștearsă pentru că atașarea cu index de atașare nu poate fi găsită."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Cererea depășește limita de 1 MB. Modificați cererea EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Sunt necesare permisiuni cu drepturi sporite pentru a accesa metoda: „{0}”"; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Eroare de atașare"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Data de sfârșit are loc înainte de data de început."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Unul sau mai multe nume de afișat furnizate sunt prea lungi."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Numărul total de destinatari din câmp nu poate depăși {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Sterilizarea HTML nu a reușit."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Eroare de scriere a datelor"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Sunt necesare permisiuni cu drepturi sporite pentru a accesa membrii protejați ai JavaScript API for Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Atașările nu pot fi adăugate pentru că mesajul are deja numărul maxim de atașări"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Eroare internă de protocol: „{0}”."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Utilizatorul a eliminat atașarea înainte de terminarea încărcării."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Nu s-a găsit un decalaj pentru această marcă de timp."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Atașarea nu poate fi adăugată pentru că este prea mare."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Ora de sfârșit nu poate fi înaintea orei de începere."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Parametrii furnizați nu corespund formatului așteptat."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Atașarea nu poate fi adăugată la element."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Nu a fost furnizat niciun destinatar valid."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ID-ul atașării a fost nevalid."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Atașările nu pot fi adăugate în timp ce răspunsul sau redirecționarea completă sunt în curs de regăsire de la server."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Una sau mai multe adrese de e-mail furnizate sunt prea lungi."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Calea atașării a fost nevalidă."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Atașarea nu poate fi ștearsă din element."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "A apărut o eroare internă de format."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Intrarea nu are ca rezultat o dată corectă."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Utilizatorul a modificat poziția cursorului în timp ce erau inserate datele." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/outlook_strings.js new file mode 100644 index 000000000..e1f8d9bad --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ro-ro/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Atașarea nu poate fi ștearsă pentru că atașarea cu index de atașare nu poate fi găsită.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Cererea depășește limita de 1 MB. Modificați cererea EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Sunt necesare permisiuni cu drepturi sporite pentru a accesa metoda: „{0}”";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Eroare de atașare";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Data de sfârșit are loc înainte de data de început.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Unul sau mai multe nume de afișat furnizate sunt prea lungi.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Numărul total de destinatari din câmp nu poate depăși {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Sterilizarea HTML nu a reușit.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Eroare de scriere a datelor";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Sunt necesare permisiuni cu drepturi sporite pentru a accesa membrii protejați ai JavaScript API for Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Atașările nu pot fi adăugate pentru că mesajul are deja numărul maxim de atașări";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Eroare internă de protocol: „{0}”.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Utilizatorul a eliminat atașarea înainte de terminarea încărcării.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Nu s-a găsit un decalaj pentru această marcă de timp.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Atașarea nu poate fi adăugată pentru că este prea mare.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Ora de sfârșit nu poate fi înaintea orei de începere.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Parametrii furnizați nu corespund formatului așteptat.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Atașarea nu poate fi adăugată la element.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Nu a fost furnizat niciun destinatar valid.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ID-ul atașării a fost nevalid.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Atașările nu pot fi adăugate în timp ce răspunsul sau redirecționarea completă sunt în curs de regăsire de la server.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Una sau mai multe adrese de e-mail furnizate sunt prea lungi.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Calea atașării a fost nevalidă.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Atașarea nu poate fi ștearsă din element.";_u.ExtensibilityStrings.l_InternalFormatError_Text="A apărut o eroare internă de format.";_u.ExtensibilityStrings.l_InvalidDate_Text="Intrarea nu are ca rezultat o dată corectă.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Utilizatorul a modificat poziția cursorului în timp ce erau inserate datele." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/office_strings.debug.js new file mode 100644 index 000000000..b766d2f72 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Указанный тип привязки несовместим с заданным именованным элементом."; +Strings.OfficeOM.L_EventHandlerNotExist = "Указанный обработчик событий не найден для этой привязки."; +Strings.OfficeOM.L_UnknownBindingType = "Тип привязки не поддерживается."; +Strings.OfficeOM.L_InvalidNode = "Недопустимый узел"; +Strings.OfficeOM.L_NotImplemented = "Функция {0} не реализована."; +Strings.OfficeOM.L_NoCapability = "У вас недостаточно разрешений для выполнения этого действия."; +Strings.OfficeOM.L_SettingsCannotSave = "Не удалось сохранить параметры."; +Strings.OfficeOM.L_DataWriteReminder = "Напоминание о записи данных"; +Strings.OfficeOM.L_InvalidBinding = "Недопустимая привязка"; +Strings.OfficeOM.L_InvalidSetColumns = "Указанные столбцы недопустимы."; +Strings.OfficeOM.L_BindingCreationError = "Ошибка при создании привязки"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Значение находится вне допустимого диапазона."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Выделенный фрагмент несовместим с указанным типом приведения."; +Strings.OfficeOM.L_InvalidBindingError = "Ошибка: недопустимая привязка"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Указано недопустимое значение параметра startRow или startColumn."; +Strings.OfficeOM.L_InvalidSetRows = "Указанные строки недопустимы."; +Strings.OfficeOM.L_NetworkProblem = "Ошибка сети"; +Strings.OfficeOM.L_CannotWriteToSelection = "Не удается записать данные в текущий выделенный фрагмент."; +Strings.OfficeOM.L_MissingParameter = "Отсутствует параметр."; +Strings.OfficeOM.L_IndexOutOfRange = "Индекс находится вне диапазона."; +Strings.OfficeOM.L_SettingsStaleError = "Ошибка из-за устаревших параметров"; +Strings.OfficeOM.L_CannotNavigateTo = "Объект находится в расположении, где не поддерживается навигация."; +Strings.OfficeOM.L_ReadSettingsError = "Ошибка чтения параметров"; +Strings.OfficeOM.L_InvalidGetColumns = "Указанные столбцы недопустимы."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Указанный тип приведения не поддерживается."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Приложение {0} не существует. Microsoft.Office.WebExtension.Initialize(Reason) не вызывается."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Не удалось выполнить операцию задания, так заданный объект данных перезапишет или переместит данные."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Значение индекса строки находится вне допустимого диапазона. Используйте значение (0 или больше), которое меньше числа строк."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Указанная строка пуста."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Значение индекса столбца находится вне допустимого диапазона. Используйте значение (0 или больше), которое меньше числа столбцов."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Неподдерживаемое перечисление"; +Strings.OfficeOM.L_InvalidParameters = "У функции {0} недопустимые параметры."; +Strings.OfficeOM.L_SetDataParametersConflict = "Указанные параметры конфликтуют."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Вызовите closeAsync для текущего файла перед извлечением другого."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Тип указанного объекта данных несовместим с выделенным фрагментом."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Перечисление не поддерживается в текущем хост-приложении."; +Strings.OfficeOM.L_InvalidCoercion = "Недопустимый тип приведения"; +Strings.OfficeOM.L_NotSupportedEventType = "Указанный тип события {0} не поддерживается."; +Strings.OfficeOM.L_UnsupportedDataObject = "Заданный объект данных не поддерживается."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Запрошенный набор данных слишком велик."; +Strings.OfficeOM.L_AppNameNotExist = "AppName для {0} не существует."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Сделайте выбор."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Найдено несколько объектов с одинаковыми именами."; +Strings.OfficeOM.L_InvalidCellsValue = "Один или несколько параметров ячеек имеют недопустимые значения. Проверьте параметры и повторите попытку."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Указанный объект данных несовместим с типом привязки."; +Strings.OfficeOM.L_InvalidFormatValue = "Один или несколько параметров формата имеют недопустимые значения. Проверьте параметры и повторите попытку."; +Strings.OfficeOM.L_NotSupportedBindingType = "Указанный тип привязки {0} не поддерживается."; +Strings.OfficeOM.L_InitializeNotReady = "Файл Office.js еще не загружен. Повторите попытку позже или добавьте код инициализации в функцию Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Напоминание о форматировании"; +Strings.OfficeOM.L_ShuttingDown = "Не удалось выполнить операцию, так как данные на сервере устарели."; +Strings.OfficeOM.L_OperationNotSupported = "Эта операция не поддерживается."; +Strings.OfficeOM.L_DocumentReadOnly = "Запрошенная операция не допускается в текущем режиме документов."; +Strings.OfficeOM.L_NamedItemNotFound = "Именованный элемент не существует."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Недопустимый вызов API в текущем контексте."; +Strings.OfficeOM.L_InvalidGetRows = "Указанные строки недопустимы."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Примечание: рекомендуемое количество наборов форматирования, созданных с помощью API форматирования, — менее 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Дождитесь завершения предыдущего вызова."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Размер указанного объекта данных превышает допустимый."; +Strings.OfficeOM.L_DataWriteError = "Ошибка записи данных"; +Strings.OfficeOM.L_InvalidBindingOperation = "Недопустимая операция привязки"; +Strings.OfficeOM.L_APICallFailed = "Сбой вызова API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Указанный идентификатор не существует."; +Strings.OfficeOM.L_FunctionCallFailed = "Ошибка вызова функции {0}, код ошибки: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Заданный объект данных не соответствует размеру выделенного фрагмента."; +Strings.OfficeOM.L_SaveSettingsError = "Ошибка сохранения параметров"; +Strings.OfficeOM.L_RequestTokenUnavailable = "API отрегулирован для снижения частоты вызовов."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Указано недопустимое значение параметра startRow или startColumn."; +Strings.OfficeOM.L_InvalidFormat = "Ошибка недопустимого формата"; +Strings.OfficeOM.L_BindingNotExist = "Указанная привязка не существует."; +Strings.OfficeOM.L_SettingNameNotExist = "Указанное имя параметра не существует."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Не удалось добавить обработчик событий."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Браузер не поддерживает запрошенный API."; +Strings.OfficeOM.L_InvalidAPICall = "Недопустимый вызов API"; +Strings.OfficeOM.L_EventRegistrationError = "Ошибка регистрации события"; +Strings.OfficeOM.L_ElementMissing = "Не удалось отформатировать ячейку таблицы, так как отсутствуют некоторые значения параметров. Проверьте параметры и повторите попытку."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = 'Использование параметров координации с типом приведения "Таблица" не допускается, если таблица содержит объединенные ячейки.'; +Strings.OfficeOM.L_NavOutOfBound = "Операция завершилась с ошибкой, так как индекс находится вне допустимого диапазона."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Процедуру обратного вызова невозможно указать одновременно в списке аргументов и в необязательном объекте."; +Strings.OfficeOM.L_CustomXmlError = "Ошибка настраиваемого XML-документа."; +Strings.OfficeOM.L_SettingsAreStale = "Не удалось сохранить параметры, так как они устарели."; +Strings.OfficeOM.L_TooManyOptionalFunction = "множество дополнительных функций в списке параметров"; +Strings.OfficeOM.L_MissingRequiredArguments = "отсутствуют некоторые обязательные аргументы"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = 'Использование параметров координации с типом приведения "Таблица" не допускается, если таблица содержит объединенные ячейки.'; +Strings.OfficeOM.L_HostError = "Ошибка узла"; +Strings.OfficeOM.L_OutOfRange = "Значение вне диапазона"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Невозможно создать привязку для текущего выделенного фрагмента и указанного типа привязки."; +Strings.OfficeOM.L_TooManyOptionalObjects = "множество дополнительных объектов в списке параметров"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Выбранное содержимое должно быть представлено в формате таблицы. Отформатируйте данные как таблицу и повторите попытку."; +Strings.OfficeOM.L_APINotSupported = "API не поддерживается"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Размер указанного фрагмента не поддерживается."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Не удалось удалить обработчик событий."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Выделение несмежных фрагментов не поддерживается."; +Strings.OfficeOM.L_DataReadError = "Ошибка чтения данных"; +Strings.OfficeOM.L_InternalErrorDescription = "Произошла внутренняя ошибка."; +Strings.OfficeOM.L_InvalidDataFormat = "Формат указанного объекта данных недопустим."; +Strings.OfficeOM.L_RequestTimeout = "Выполнение вызова заняло слишком много времени."; +Strings.OfficeOM.L_DataStale = "Данные устарели"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Текущий выделенный фрагмент не поддерживается."; +Strings.OfficeOM.L_MemoryLimit = "Превышен лимит памяти"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Примечание: рекомендуемое количество ячеек в таблице — менее 20 000."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Один или несколько параметров таблицы имеют недопустимые значения. Проверьте параметры и повторите попытку."; +Strings.OfficeOM.L_PermissionDenied = "Отказано в разрешении"; +Strings.OfficeOM.L_InvalidDataObject = "Недопустимый объект данных"; +Strings.OfficeOM.L_UserNotSignedIn = "Никто из пользователей не вошел в Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Не удается выполнить привязку к выделенному фрагменту."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Указанные столбцы недопустимы."; +Strings.OfficeOM.L_BadSelectorString = "Строка, передаваемая в область выделения, неправильно отформатирована или не поддерживается."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Указано недопустимое значение параметра rowCount или columnCount."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Тип OsfControl не поддерживается."; +Strings.OfficeOM.L_InvalidValue = "Недопустимое значение"; +Strings.OfficeOM.L_DataNotMatchSelection = "Предоставленный объект данных несовместим с формой или измерениями текущего выделенного фрагмента."; +Strings.OfficeOM.L_InternalError = "Внутренняя ошибка"; +Strings.OfficeOM.L_NotSupported = "Функция {0} не поддерживается."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Указанный узел не найден."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Указанный тип приведения несовместим с этим типом привязки."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Не удалось извлечь файл из-за ошибки сети."; +Strings.OfficeOM.L_TooManyArguments = "слишком много аргументов"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Операция не поддерживается для этого типа привязки."; +Strings.OfficeOM.L_InValidOptionalArgument = "недопустимый необязательный аргумент"; +Strings.OfficeOM.L_FileTypeNotSupported = "Указанный тип файлов не поддерживается."; +Strings.OfficeOM.L_GetDataParametersConflict = "Указанные параметры конфликтуют."; +Strings.OfficeOM.L_CallbackNotAFunction = 'Необходимый тип обратного вызова — "Функция", но был тип {0}.' diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/office_strings.js new file mode 100644 index 000000000..bfba9f21d --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Указанный тип привязки несовместим с заданным именованным элементом.";Strings.OfficeOM.L_EventHandlerNotExist="Указанный обработчик событий не найден для этой привязки.";Strings.OfficeOM.L_UnknownBindingType="Тип привязки не поддерживается.";Strings.OfficeOM.L_InvalidNode="Недопустимый узел";Strings.OfficeOM.L_NotImplemented="Функция {0} не реализована.";Strings.OfficeOM.L_NoCapability="У вас недостаточно разрешений для выполнения этого действия.";Strings.OfficeOM.L_SettingsCannotSave="Не удалось сохранить параметры.";Strings.OfficeOM.L_DataWriteReminder="Напоминание о записи данных";Strings.OfficeOM.L_InvalidBinding="Недопустимая привязка";Strings.OfficeOM.L_InvalidSetColumns="Указанные столбцы недопустимы.";Strings.OfficeOM.L_BindingCreationError="Ошибка при создании привязки";Strings.OfficeOM.L_FormatValueOutOfRange="Значение находится вне допустимого диапазона.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Выделенный фрагмент несовместим с указанным типом приведения.";Strings.OfficeOM.L_InvalidBindingError="Ошибка: недопустимая привязка";Strings.OfficeOM.L_InvalidGetStartRowColumn="Указано недопустимое значение параметра startRow или startColumn.";Strings.OfficeOM.L_InvalidSetRows="Указанные строки недопустимы.";Strings.OfficeOM.L_NetworkProblem="Ошибка сети";Strings.OfficeOM.L_CannotWriteToSelection="Не удается записать данные в текущий выделенный фрагмент.";Strings.OfficeOM.L_MissingParameter="Отсутствует параметр.";Strings.OfficeOM.L_IndexOutOfRange="Индекс находится вне диапазона.";Strings.OfficeOM.L_SettingsStaleError="Ошибка из-за устаревших параметров";Strings.OfficeOM.L_CannotNavigateTo="Объект находится в расположении, где не поддерживается навигация.";Strings.OfficeOM.L_ReadSettingsError="Ошибка чтения параметров";Strings.OfficeOM.L_InvalidGetColumns="Указанные столбцы недопустимы.";Strings.OfficeOM.L_CoercionTypeNotSupported="Указанный тип приведения не поддерживается.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Приложение {0} не существует. Microsoft.Office.WebExtension.Initialize(Reason) не вызывается.";Strings.OfficeOM.L_OverwriteWorksheetData="Не удалось выполнить операцию задания, так заданный объект данных перезапишет или переместит данные.";Strings.OfficeOM.L_RowIndexOutOfRange="Значение индекса строки находится вне допустимого диапазона. Используйте значение (0 или больше), которое меньше числа строк.";Strings.OfficeOM.L_InvalidReadForBlankRow="Указанная строка пуста.";Strings.OfficeOM.L_ColIndexOutOfRange="Значение индекса столбца находится вне допустимого диапазона. Используйте значение (0 или больше), которое меньше числа столбцов.";Strings.OfficeOM.L_UnsupportedEnumeration="Неподдерживаемое перечисление";Strings.OfficeOM.L_InvalidParameters="У функции {0} недопустимые параметры.";Strings.OfficeOM.L_SetDataParametersConflict="Указанные параметры конфликтуют.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Вызовите closeAsync для текущего файла перед извлечением другого.";Strings.OfficeOM.L_DataNotMatchCoercionType="Тип указанного объекта данных несовместим с выделенным фрагментом.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Перечисление не поддерживается в текущем хост-приложении.";Strings.OfficeOM.L_InvalidCoercion="Недопустимый тип приведения";Strings.OfficeOM.L_NotSupportedEventType="Указанный тип события {0} не поддерживается.";Strings.OfficeOM.L_UnsupportedDataObject="Заданный объект данных не поддерживается.";Strings.OfficeOM.L_GetDataIsTooLarge="Запрошенный набор данных слишком велик.";Strings.OfficeOM.L_AppNameNotExist="AppName для {0} не существует.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Сделайте выбор.";Strings.OfficeOM.L_MultipleNamedItemFound="Найдено несколько объектов с одинаковыми именами.";Strings.OfficeOM.L_InvalidCellsValue="Один или несколько параметров ячеек имеют недопустимые значения. Проверьте параметры и повторите попытку.";Strings.OfficeOM.L_DataNotMatchBindingType="Указанный объект данных несовместим с типом привязки.";Strings.OfficeOM.L_InvalidFormatValue="Один или несколько параметров формата имеют недопустимые значения. Проверьте параметры и повторите попытку.";Strings.OfficeOM.L_NotSupportedBindingType="Указанный тип привязки {0} не поддерживается.";Strings.OfficeOM.L_InitializeNotReady="Файл Office.js еще не загружен. Повторите попытку позже или добавьте код инициализации в функцию Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Напоминание о форматировании";Strings.OfficeOM.L_ShuttingDown="Не удалось выполнить операцию, так как данные на сервере устарели.";Strings.OfficeOM.L_OperationNotSupported="Эта операция не поддерживается.";Strings.OfficeOM.L_DocumentReadOnly="Запрошенная операция не допускается в текущем режиме документов.";Strings.OfficeOM.L_NamedItemNotFound="Именованный элемент не существует.";Strings.OfficeOM.L_InvalidApiCallInContext="Недопустимый вызов API в текущем контексте.";Strings.OfficeOM.L_InvalidGetRows="Указанные строки недопустимы.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Примечание: рекомендуемое количество наборов форматирования, созданных с помощью API форматирования, — менее 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Дождитесь завершения предыдущего вызова.";Strings.OfficeOM.L_SetDataIsTooLarge="Размер указанного объекта данных превышает допустимый.";Strings.OfficeOM.L_DataWriteError="Ошибка записи данных";Strings.OfficeOM.L_InvalidBindingOperation="Недопустимая операция привязки";Strings.OfficeOM.L_APICallFailed="Сбой вызова API";Strings.OfficeOM.L_SpecifiedIdNotExist="Указанный идентификатор не существует.";Strings.OfficeOM.L_FunctionCallFailed="Ошибка вызова функции {0}, код ошибки: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Заданный объект данных не соответствует размеру выделенного фрагмента.";Strings.OfficeOM.L_SaveSettingsError="Ошибка сохранения параметров";Strings.OfficeOM.L_RequestTokenUnavailable="API отрегулирован для снижения частоты вызовов.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Указано недопустимое значение параметра startRow или startColumn.";Strings.OfficeOM.L_InvalidFormat="Ошибка недопустимого формата";Strings.OfficeOM.L_BindingNotExist="Указанная привязка не существует.";Strings.OfficeOM.L_SettingNameNotExist="Указанное имя параметра не существует.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Не удалось добавить обработчик событий.";Strings.OfficeOM.L_BrowserAPINotSupported="Браузер не поддерживает запрошенный API.";Strings.OfficeOM.L_InvalidAPICall="Недопустимый вызов API";Strings.OfficeOM.L_EventRegistrationError="Ошибка регистрации события";Strings.OfficeOM.L_ElementMissing="Не удалось отформатировать ячейку таблицы, так как отсутствуют некоторые значения параметров. Проверьте параметры и повторите попытку.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported='Использование параметров координации с типом приведения "Таблица" не допускается, если таблица содержит объединенные ячейки.';Strings.OfficeOM.L_NavOutOfBound="Операция завершилась с ошибкой, так как индекс находится вне допустимого диапазона.";Strings.OfficeOM.L_RedundantCallbackSpecification="Процедуру обратного вызова невозможно указать одновременно в списке аргументов и в необязательном объекте.";Strings.OfficeOM.L_CustomXmlError="Ошибка настраиваемого XML-документа.";Strings.OfficeOM.L_SettingsAreStale="Не удалось сохранить параметры, так как они устарели.";Strings.OfficeOM.L_TooManyOptionalFunction="множество дополнительных функций в списке параметров";Strings.OfficeOM.L_MissingRequiredArguments="отсутствуют некоторые обязательные аргументы";Strings.OfficeOM.L_NonUniformPartialGetNotSupported='Использование параметров координации с типом приведения "Таблица" не допускается, если таблица содержит объединенные ячейки.';Strings.OfficeOM.L_HostError="Ошибка узла";Strings.OfficeOM.L_OutOfRange="Значение вне диапазона";Strings.OfficeOM.L_InvalidSelectionForBindingType="Невозможно создать привязку для текущего выделенного фрагмента и указанного типа привязки.";Strings.OfficeOM.L_TooManyOptionalObjects="множество дополнительных объектов в списке параметров";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Выбранное содержимое должно быть представлено в формате таблицы. Отформатируйте данные как таблицу и повторите попытку.";Strings.OfficeOM.L_APINotSupported="API не поддерживается";Strings.OfficeOM.L_SliceSizeNotSupported="Размер указанного фрагмента не поддерживается.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Не удалось удалить обработчик событий.";Strings.OfficeOM.L_BindingToMultipleSelection="Выделение несмежных фрагментов не поддерживается.";Strings.OfficeOM.L_DataReadError="Ошибка чтения данных";Strings.OfficeOM.L_InternalErrorDescription="Произошла внутренняя ошибка.";Strings.OfficeOM.L_InvalidDataFormat="Формат указанного объекта данных недопустим.";Strings.OfficeOM.L_RequestTimeout="Выполнение вызова заняло слишком много времени.";Strings.OfficeOM.L_DataStale="Данные устарели";Strings.OfficeOM.L_GetSelectionNotSupported="Текущий выделенный фрагмент не поддерживается.";Strings.OfficeOM.L_MemoryLimit="Превышен лимит памяти";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Примечание: рекомендуемое количество ячеек в таблице — менее 20 000.";Strings.OfficeOM.L_InvalidTableOptionValue="Один или несколько параметров таблицы имеют недопустимые значения. Проверьте параметры и повторите попытку.";Strings.OfficeOM.L_PermissionDenied="Отказано в разрешении";Strings.OfficeOM.L_InvalidDataObject="Недопустимый объект данных";Strings.OfficeOM.L_UserNotSignedIn="Никто из пользователей не вошел в Office.";Strings.OfficeOM.L_SelectionCannotBound="Не удается выполнить привязку к выделенному фрагменту.";Strings.OfficeOM.L_InvalidColumnsForBinding="Указанные столбцы недопустимы.";Strings.OfficeOM.L_BadSelectorString="Строка, передаваемая в область выделения, неправильно отформатирована или не поддерживается.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Указано недопустимое значение параметра rowCount или columnCount.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Тип OsfControl не поддерживается.";Strings.OfficeOM.L_InvalidValue="Недопустимое значение";Strings.OfficeOM.L_DataNotMatchSelection="Предоставленный объект данных несовместим с формой или измерениями текущего выделенного фрагмента.";Strings.OfficeOM.L_InternalError="Внутренняя ошибка";Strings.OfficeOM.L_NotSupported="Функция {0} не поддерживается.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Указанный узел не найден.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Указанный тип приведения несовместим с этим типом привязки.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Не удалось извлечь файл из-за ошибки сети.";Strings.OfficeOM.L_TooManyArguments="слишком много аргументов";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Операция не поддерживается для этого типа привязки.";Strings.OfficeOM.L_InValidOptionalArgument="недопустимый необязательный аргумент";Strings.OfficeOM.L_FileTypeNotSupported="Указанный тип файлов не поддерживается.";Strings.OfficeOM.L_GetDataParametersConflict="Указанные параметры конфликтуют.";Strings.OfficeOM.L_CallbackNotAFunction='Необходимый тип обратного вызова — "Функция", но был тип {0}.' \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/outlook_strings.debug.js new file mode 100644 index 000000000..0c0ae3a43 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Вложение с таким индексом не найдено, поэтому его невозможно удалить."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Запрос превысил ограничение по размеру в 1 МБ. Измените ваш запрос EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = 'Для вызова метода "{0}" требуются повышенные привилегии.'; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Ошибка вложения"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Дата окончания предшествует дате начала."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Одно или несколько указанных отображаемых имен имеют слишком большую длину."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Общее число получателей в поле не может превышать {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Не удалось выполнить очистку HTML."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Ошибка записи данных"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Для доступа к защищенным членам JavaScript API для Office требуются повышенные привилегии."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Невозможно добавить вложения, так как уже достигнуто их максимальное число для сообщения."; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = 'Внутренняя ошибка протокола: "{0}".'; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Пользователь удалил вложение до того, как оно было добавлено."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Не удается найти смещение для данной метки времени."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Невозможно добавить это вложение из-за слишком большого размера."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Время окончания не может предшествовать времени начала."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Заданные параметры не соответствуют ожидаемому формату."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Не удается добавить это вложение к элементу."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Не указаны допустимые получатели."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Недопустимый идентификатор вложения."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Невозможно добавить вложения, пока идет получение полного ответа или переадресованного сообщения с сервера."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Один или несколько указанных адресов электронной почты имеют слишком большую длину."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Недопустимый путь вложения."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Не удается удалить вложение из элемента."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Произошла внутренняя ошибка форматирования."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Введенные данные не содержат распознаваемую дату."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Пользователь изменил положение курсора во время добавления данных." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/outlook_strings.js new file mode 100644 index 000000000..866a80aaf --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/ru-ru/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Вложение с таким индексом не найдено, поэтому его невозможно удалить.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Запрос превысил ограничение по размеру в 1 МБ. Измените ваш запрос EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text='Для вызова метода "{0}" требуются повышенные привилегии.';_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Ошибка вложения";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Дата окончания предшествует дате начала.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Одно или несколько указанных отображаемых имен имеют слишком большую длину.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Общее число получателей в поле не может превышать {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Не удалось выполнить очистку HTML.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Ошибка записи данных";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Для доступа к защищенным членам JavaScript API для Office требуются повышенные привилегии.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Невозможно добавить вложения, так как уже достигнуто их максимальное число для сообщения.";_u.ExtensibilityStrings.l_InternalProtocolError_Text='Внутренняя ошибка протокола: "{0}".';_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Пользователь удалил вложение до того, как оно было добавлено.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Не удается найти смещение для данной метки времени.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Невозможно добавить это вложение из-за слишком большого размера.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Время окончания не может предшествовать времени начала.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Заданные параметры не соответствуют ожидаемому формату.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Не удается добавить это вложение к элементу.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Не указаны допустимые получатели.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Недопустимый идентификатор вложения.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Невозможно добавить вложения, пока идет получение полного ответа или переадресованного сообщения с сервера.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Один или несколько указанных адресов электронной почты имеют слишком большую длину.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Недопустимый путь вложения.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Не удается удалить вложение из элемента.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Произошла внутренняя ошибка форматирования.";_u.ExtensibilityStrings.l_InvalidDate_Text="Введенные данные не содержат распознаваемую дату.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Пользователь изменил положение курсора во время добавления данных." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/office_strings.debug.js new file mode 100644 index 000000000..f2e1ab324 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Zadaný typ väzby nie je kompatibilný so zadanou pomenovanou položkou."; +Strings.OfficeOM.L_EventHandlerNotExist = "Zadaná obsluha udalostí sa pre túto väzbu nenašla."; +Strings.OfficeOM.L_UnknownBindingType = "Tento typ väzby nie je podporovaný."; +Strings.OfficeOM.L_InvalidNode = "Neplatný uzol"; +Strings.OfficeOM.L_NotImplemented = "Funkcia {0} nie je implementovaná."; +Strings.OfficeOM.L_NoCapability = "Nemáte dostatočné povolenia na vykonanie tejto akcie."; +Strings.OfficeOM.L_SettingsCannotSave = "Nastavenia sa nepodarilo uložiť."; +Strings.OfficeOM.L_DataWriteReminder = "Pripomenutie zapisovania údajov"; +Strings.OfficeOM.L_InvalidBinding = "Neplatná väzba"; +Strings.OfficeOM.L_InvalidSetColumns = "Uvedené stĺpce sú neplatné."; +Strings.OfficeOM.L_BindingCreationError = "Chyba pri vytváraní väzby"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Hodnota je mimo povoleného rozsahu."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Aktuálny výber nie je kompatibilný so zadaným typom koercie."; +Strings.OfficeOM.L_InvalidBindingError = "Chyba neplatnej väzby"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Zadané hodnoty začiatočného riadka alebo začiatočného stĺpca nie sú platné."; +Strings.OfficeOM.L_InvalidSetRows = "Uvedené riadky sú neplatné."; +Strings.OfficeOM.L_NetworkProblem = "Problém so sieťou"; +Strings.OfficeOM.L_CannotWriteToSelection = "Do aktuálneho výberu nie je možné vykonať zápis."; +Strings.OfficeOM.L_MissingParameter = "Chýbajúci parameter"; +Strings.OfficeOM.L_IndexOutOfRange = "Index mimo rozsahu."; +Strings.OfficeOM.L_SettingsStaleError = "Chyba zastaraných nastavení"; +Strings.OfficeOM.L_CannotNavigateTo = "Objekt sa nachádza na mieste, kde nie je podporovaná navigácia."; +Strings.OfficeOM.L_ReadSettingsError = "Chyba nastavení čítania"; +Strings.OfficeOM.L_InvalidGetColumns = "Uvedené stĺpce sú neplatné."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Zadaný typ koercie nie je podporovaný."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Aplikácia {0} neexistuje. Nevolá sa Microsoft.Office.WebExtension.initialize(reason)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Operácia nastavenia zlyhala, pretože poskytnutý dátový objekt prepíše alebo posunie údaje."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Hodnota indexu riadka je mimo povoleného rozsahu. Použite hodnotu (0 alebo vyššiu), ktorá je menšia ako počet riadkov."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Zadaný riadok je prázdny."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Hodnota indexu stĺpca je mimo povoleného rozsahu. Použite hodnotu (0 alebo vyššiu), ktorá je menšia ako počet stĺpcov."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Nepodporovaná enumerácia"; +Strings.OfficeOM.L_InvalidParameters = "Funkcia {0} má neplatné parametre."; +Strings.OfficeOM.L_SetDataParametersConflict = "Uvedené parametre sú v konflikte."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Pred získaním ďalšieho súboru zavolajte closeAsync v aktuálnom súbore."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Typ zadaného dátového objektu nie je kompatibilný s aktuálnym výberom."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Aktuálna hostiteľská aplikácia nepodporuje enumeráciu."; +Strings.OfficeOM.L_InvalidCoercion = "Neplatný typ koercie"; +Strings.OfficeOM.L_NotSupportedEventType = "Zadaný typ udalosti {0} nie je podporovaný."; +Strings.OfficeOM.L_UnsupportedDataObject = "Poskytnutý typ dátového objektu nie je podporovaný."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Požadovaná množina údajov je príliš veľká."; +Strings.OfficeOM.L_AppNameNotExist = "NázovAplikácie pre {0} neexistuje."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Vykonajte výber."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Našlo sa viacero objektov s rovnakým názvom."; +Strings.OfficeOM.L_InvalidCellsValue = "Minimálne jeden parameter bunky má hodnotu, ktorá nie je povolená. Ešte raz skontrolujte hodnoty a skúste to znova."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Zadaný dátový objekt nie je kompatibilný s typom väzby."; +Strings.OfficeOM.L_InvalidFormatValue = "Minimálne jeden parameter formátu má hodnotu, ktorá nie je povolená. Ešte raz skontrolujte hodnoty a skúste to znova."; +Strings.OfficeOM.L_NotSupportedBindingType = "Zadaný typ väzby {0} nie je podporovaný."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js sa ešte úplne nenačítal. Skúste to znovu neskôr alebo pridajte funkcii Office.initialize svoj inicializačný kód."; +Strings.OfficeOM.L_FormattingReminder = "Pripomenutie formátovania"; +Strings.OfficeOM.L_ShuttingDown = "Operácia zlyhala, pretože údaje na serveri nie sú aktuálne."; +Strings.OfficeOM.L_OperationNotSupported = "Operácia nie je podporovaná."; +Strings.OfficeOM.L_DocumentReadOnly = "Požadovaná operácia nie je v aktuálnom režime dokumentu povolená."; +Strings.OfficeOM.L_NamedItemNotFound = "Pomenovaná položka neexistuje."; +Strings.OfficeOM.L_InvalidApiCallInContext = "V aktuálnom kontexte je volanie API neplatné."; +Strings.OfficeOM.L_InvalidGetRows = "Uvedené riadky sú neplatné."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Poznámka: Odporúča sa mať menej ako 100 súprav formátovania nastavených volaním formátovania rozhrania API."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Počkajte, kým sa dokončí predchádzajúce volanie."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Zadaný dátový objekt je príliš veľký."; +Strings.OfficeOM.L_DataWriteError = "Chyba pri zápise údajov"; +Strings.OfficeOM.L_InvalidBindingOperation = "Neplatná operácia väzby"; +Strings.OfficeOM.L_APICallFailed = "Volanie API zlyhalo"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Zadaná identifikácia neexistuje."; +Strings.OfficeOM.L_FunctionCallFailed = "Volanie funkcie {0} zlyhalo, kód chyby: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Poskytnutý dátový objekt nezodpovedá veľkosti aktuálneho výberu."; +Strings.OfficeOM.L_SaveSettingsError = "Chyba nastavení ukladania"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Toto API bolo obmedzené, aby sa spomalila rýchlosť volania."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Zadané hodnoty začiatočného riadka alebo začiatočného stĺpca nie sú platné."; +Strings.OfficeOM.L_InvalidFormat = "Chyba neplatného formátu"; +Strings.OfficeOM.L_BindingNotExist = "Zadaná väzba neexistuje."; +Strings.OfficeOM.L_SettingNameNotExist = "Zadaný názov nastavenia neexistuje."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Obsluhu udalostí sa nepodarilo pridať."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Tento prehliadač nepodporuje požadované API."; +Strings.OfficeOM.L_InvalidAPICall = "Neplatné volanie API"; +Strings.OfficeOM.L_EventRegistrationError = "Chyba pri registrácii udalosti"; +Strings.OfficeOM.L_ElementMissing = "Nepodarilo sa nám naformátovať bunku tabuľky, pretože niektoré hodnoty parametra chýbajú. Ešte raz skontrolujte parametre a skúste to znova."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Parametre súradnice nie je možné použiť s typom koercie Tabuľka, keď tabuľka obsahuje zlúčené bunky."; +Strings.OfficeOM.L_NavOutOfBound = "Operácia zlyhala, pretože index je mimo rozsahu."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Spätné volanie nie je možné určiť ani v zozname argumentov ani vo voliteľnom objekte."; +Strings.OfficeOM.L_CustomXmlError = "Vlastná chyba XML."; +Strings.OfficeOM.L_SettingsAreStale = "Nastavenia sa nepodarilo uložiť, pretože nie sú aktuálne."; +Strings.OfficeOM.L_TooManyOptionalFunction = "viacero voliteľných funkcií v zozname parametrov"; +Strings.OfficeOM.L_MissingRequiredArguments = "chýba niekoľko požadovaných argumentov"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Parametre súradnice nie je možné použiť s typom koercie Tabuľka, keď tabuľka obsahuje zlúčené bunky."; +Strings.OfficeOM.L_HostError = "Chyba hostiteľa"; +Strings.OfficeOM.L_OutOfRange = "Mimo rozsahu"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Nie je možné vytvoriť väzbu s aktuálnym výberom a so zadaným typom väzby."; +Strings.OfficeOM.L_TooManyOptionalObjects = "viacero voliteľných objektov v zozname parametrov"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Zdieľaný obsah musí byť vo formáte tabuľky. Údaje naformátujte ako tabuľku a skúste to znova."; +Strings.OfficeOM.L_APINotSupported = "API nie je podporované"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Zadaná veľkosť výseku nie je podporovaná."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Obsluhu udalostí sa nepodarilo odstrániť."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Nesúvislý výber nie je podporovaný."; +Strings.OfficeOM.L_DataReadError = "Chyba pri čítaní údajov"; +Strings.OfficeOM.L_InternalErrorDescription = "Vyskytla sa interná chyba."; +Strings.OfficeOM.L_InvalidDataFormat = "Formát zadaného dátového objektu nie je platný."; +Strings.OfficeOM.L_RequestTimeout = "Volanie sa vykonáva príliš dlho."; +Strings.OfficeOM.L_DataStale = "Neaktuálne údaje"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Aktuálny výber nie je podporovaný."; +Strings.OfficeOM.L_MemoryLimit = "Prekročil sa limit pamäte"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Poznámka: V tabuľke sa odporúča mať menej ako 20 000 buniek."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Minimálne jeden parameter tableOptions má hodnotu, ktorá nie je povolená. Ešte raz skontrolujte hodnoty a skúste to znova."; +Strings.OfficeOM.L_PermissionDenied = "Povolenie odmietnuté"; +Strings.OfficeOM.L_InvalidDataObject = "Neplatný dátový objekt"; +Strings.OfficeOM.L_UserNotSignedIn = "V Office nie je prihlásený žiaden používateľ."; +Strings.OfficeOM.L_SelectionCannotBound = "S aktuálnym výberom nie je možné vytvoriť väzbu."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Uvedené stĺpce sú neplatné."; +Strings.OfficeOM.L_BadSelectorString = "Reťazec odovzdaný do selektora je nesprávne naformátovaný alebo nie je podporovaný."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Zadané hodnoty počtu riadkov alebo počtu stĺpcov nie sú platné."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Typ OsfControl nie je podporovaný."; +Strings.OfficeOM.L_InvalidValue = "Neplatná hodnota"; +Strings.OfficeOM.L_DataNotMatchSelection = "Poskytnutý dátový objekt nie je kompatibilný s tvarom alebo rozmermi aktuálneho výberu."; +Strings.OfficeOM.L_InternalError = "Vnútorná chyba"; +Strings.OfficeOM.L_NotSupported = "Funkcia {0} nie je podporovaná."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Zadaný uzol sa nenašiel."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Zadaný typ koercie nie je kompatibilný s týmto typom väzby."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Získaniu súboru zabránil problém so sieťou."; +Strings.OfficeOM.L_TooManyArguments = "priveľa argumentov"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Operácia nie je v tomto type väzby podporovaná."; +Strings.OfficeOM.L_InValidOptionalArgument = "neplatný voliteľný argument"; +Strings.OfficeOM.L_FileTypeNotSupported = "Zadaný typ súboru nie je podporovaný."; +Strings.OfficeOM.L_GetDataParametersConflict = "Uvedené parametre sú v konflikte."; +Strings.OfficeOM.L_CallbackNotAFunction = "Spätné volanie musí byť typom funkcie, bolo typom {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/office_strings.js new file mode 100644 index 000000000..604fd95d2 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Zadaný typ väzby nie je kompatibilný so zadanou pomenovanou položkou.";Strings.OfficeOM.L_EventHandlerNotExist="Zadaná obsluha udalostí sa pre túto väzbu nenašla.";Strings.OfficeOM.L_UnknownBindingType="Tento typ väzby nie je podporovaný.";Strings.OfficeOM.L_InvalidNode="Neplatný uzol";Strings.OfficeOM.L_NotImplemented="Funkcia {0} nie je implementovaná.";Strings.OfficeOM.L_NoCapability="Nemáte dostatočné povolenia na vykonanie tejto akcie.";Strings.OfficeOM.L_SettingsCannotSave="Nastavenia sa nepodarilo uložiť.";Strings.OfficeOM.L_DataWriteReminder="Pripomenutie zapisovania údajov";Strings.OfficeOM.L_InvalidBinding="Neplatná väzba";Strings.OfficeOM.L_InvalidSetColumns="Uvedené stĺpce sú neplatné.";Strings.OfficeOM.L_BindingCreationError="Chyba pri vytváraní väzby";Strings.OfficeOM.L_FormatValueOutOfRange="Hodnota je mimo povoleného rozsahu.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Aktuálny výber nie je kompatibilný so zadaným typom koercie.";Strings.OfficeOM.L_InvalidBindingError="Chyba neplatnej väzby";Strings.OfficeOM.L_InvalidGetStartRowColumn="Zadané hodnoty začiatočného riadka alebo začiatočného stĺpca nie sú platné.";Strings.OfficeOM.L_InvalidSetRows="Uvedené riadky sú neplatné.";Strings.OfficeOM.L_NetworkProblem="Problém so sieťou";Strings.OfficeOM.L_CannotWriteToSelection="Do aktuálneho výberu nie je možné vykonať zápis.";Strings.OfficeOM.L_MissingParameter="Chýbajúci parameter";Strings.OfficeOM.L_IndexOutOfRange="Index mimo rozsahu.";Strings.OfficeOM.L_SettingsStaleError="Chyba zastaraných nastavení";Strings.OfficeOM.L_CannotNavigateTo="Objekt sa nachádza na mieste, kde nie je podporovaná navigácia.";Strings.OfficeOM.L_ReadSettingsError="Chyba nastavení čítania";Strings.OfficeOM.L_InvalidGetColumns="Uvedené stĺpce sú neplatné.";Strings.OfficeOM.L_CoercionTypeNotSupported="Zadaný typ koercie nie je podporovaný.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Aplikácia {0} neexistuje. Nevolá sa Microsoft.Office.WebExtension.initialize(reason).";Strings.OfficeOM.L_OverwriteWorksheetData="Operácia nastavenia zlyhala, pretože poskytnutý dátový objekt prepíše alebo posunie údaje.";Strings.OfficeOM.L_RowIndexOutOfRange="Hodnota indexu riadka je mimo povoleného rozsahu. Použite hodnotu (0 alebo vyššiu), ktorá je menšia ako počet riadkov.";Strings.OfficeOM.L_InvalidReadForBlankRow="Zadaný riadok je prázdny.";Strings.OfficeOM.L_ColIndexOutOfRange="Hodnota indexu stĺpca je mimo povoleného rozsahu. Použite hodnotu (0 alebo vyššiu), ktorá je menšia ako počet stĺpcov.";Strings.OfficeOM.L_UnsupportedEnumeration="Nepodporovaná enumerácia";Strings.OfficeOM.L_InvalidParameters="Funkcia {0} má neplatné parametre.";Strings.OfficeOM.L_SetDataParametersConflict="Uvedené parametre sú v konflikte.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Pred získaním ďalšieho súboru zavolajte closeAsync v aktuálnom súbore.";Strings.OfficeOM.L_DataNotMatchCoercionType="Typ zadaného dátového objektu nie je kompatibilný s aktuálnym výberom.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Aktuálna hostiteľská aplikácia nepodporuje enumeráciu.";Strings.OfficeOM.L_InvalidCoercion="Neplatný typ koercie";Strings.OfficeOM.L_NotSupportedEventType="Zadaný typ udalosti {0} nie je podporovaný.";Strings.OfficeOM.L_UnsupportedDataObject="Poskytnutý typ dátového objektu nie je podporovaný.";Strings.OfficeOM.L_GetDataIsTooLarge="Požadovaná množina údajov je príliš veľká.";Strings.OfficeOM.L_AppNameNotExist="NázovAplikácie pre {0} neexistuje.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Vykonajte výber.";Strings.OfficeOM.L_MultipleNamedItemFound="Našlo sa viacero objektov s rovnakým názvom.";Strings.OfficeOM.L_InvalidCellsValue="Minimálne jeden parameter bunky má hodnotu, ktorá nie je povolená. Ešte raz skontrolujte hodnoty a skúste to znova.";Strings.OfficeOM.L_DataNotMatchBindingType="Zadaný dátový objekt nie je kompatibilný s typom väzby.";Strings.OfficeOM.L_InvalidFormatValue="Minimálne jeden parameter formátu má hodnotu, ktorá nie je povolená. Ešte raz skontrolujte hodnoty a skúste to znova.";Strings.OfficeOM.L_NotSupportedBindingType="Zadaný typ väzby {0} nie je podporovaný.";Strings.OfficeOM.L_InitializeNotReady="Office.js sa ešte úplne nenačítal. Skúste to znovu neskôr alebo pridajte funkcii Office.initialize svoj inicializačný kód.";Strings.OfficeOM.L_FormattingReminder="Pripomenutie formátovania";Strings.OfficeOM.L_ShuttingDown="Operácia zlyhala, pretože údaje na serveri nie sú aktuálne.";Strings.OfficeOM.L_OperationNotSupported="Operácia nie je podporovaná.";Strings.OfficeOM.L_DocumentReadOnly="Požadovaná operácia nie je v aktuálnom režime dokumentu povolená.";Strings.OfficeOM.L_NamedItemNotFound="Pomenovaná položka neexistuje.";Strings.OfficeOM.L_InvalidApiCallInContext="V aktuálnom kontexte je volanie API neplatné.";Strings.OfficeOM.L_InvalidGetRows="Uvedené riadky sú neplatné.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Poznámka: Odporúča sa mať menej ako 100 súprav formátovania nastavených volaním formátovania rozhrania API.";Strings.OfficeOM.L_TooManyIncompleteRequests="Počkajte, kým sa dokončí predchádzajúce volanie.";Strings.OfficeOM.L_SetDataIsTooLarge="Zadaný dátový objekt je príliš veľký.";Strings.OfficeOM.L_DataWriteError="Chyba pri zápise údajov";Strings.OfficeOM.L_InvalidBindingOperation="Neplatná operácia väzby";Strings.OfficeOM.L_APICallFailed="Volanie API zlyhalo";Strings.OfficeOM.L_SpecifiedIdNotExist="Zadaná identifikácia neexistuje.";Strings.OfficeOM.L_FunctionCallFailed="Volanie funkcie {0} zlyhalo, kód chyby: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Poskytnutý dátový objekt nezodpovedá veľkosti aktuálneho výberu.";Strings.OfficeOM.L_SaveSettingsError="Chyba nastavení ukladania";Strings.OfficeOM.L_RequestTokenUnavailable="Toto API bolo obmedzené, aby sa spomalila rýchlosť volania.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Zadané hodnoty začiatočného riadka alebo začiatočného stĺpca nie sú platné.";Strings.OfficeOM.L_InvalidFormat="Chyba neplatného formátu";Strings.OfficeOM.L_BindingNotExist="Zadaná väzba neexistuje.";Strings.OfficeOM.L_SettingNameNotExist="Zadaný názov nastavenia neexistuje.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Obsluhu udalostí sa nepodarilo pridať.";Strings.OfficeOM.L_BrowserAPINotSupported="Tento prehliadač nepodporuje požadované API.";Strings.OfficeOM.L_InvalidAPICall="Neplatné volanie API";Strings.OfficeOM.L_EventRegistrationError="Chyba pri registrácii udalosti";Strings.OfficeOM.L_ElementMissing="Nepodarilo sa nám naformátovať bunku tabuľky, pretože niektoré hodnoty parametra chýbajú. Ešte raz skontrolujte parametre a skúste to znova.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Parametre súradnice nie je možné použiť s typom koercie Tabuľka, keď tabuľka obsahuje zlúčené bunky.";Strings.OfficeOM.L_NavOutOfBound="Operácia zlyhala, pretože index je mimo rozsahu.";Strings.OfficeOM.L_RedundantCallbackSpecification="Spätné volanie nie je možné určiť ani v zozname argumentov ani vo voliteľnom objekte.";Strings.OfficeOM.L_CustomXmlError="Vlastná chyba XML.";Strings.OfficeOM.L_SettingsAreStale="Nastavenia sa nepodarilo uložiť, pretože nie sú aktuálne.";Strings.OfficeOM.L_TooManyOptionalFunction="viacero voliteľných funkcií v zozname parametrov";Strings.OfficeOM.L_MissingRequiredArguments="chýba niekoľko požadovaných argumentov";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Parametre súradnice nie je možné použiť s typom koercie Tabuľka, keď tabuľka obsahuje zlúčené bunky.";Strings.OfficeOM.L_HostError="Chyba hostiteľa";Strings.OfficeOM.L_OutOfRange="Mimo rozsahu";Strings.OfficeOM.L_InvalidSelectionForBindingType="Nie je možné vytvoriť väzbu s aktuálnym výberom a so zadaným typom väzby.";Strings.OfficeOM.L_TooManyOptionalObjects="viacero voliteľných objektov v zozname parametrov";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Zdieľaný obsah musí byť vo formáte tabuľky. Údaje naformátujte ako tabuľku a skúste to znova.";Strings.OfficeOM.L_APINotSupported="API nie je podporované";Strings.OfficeOM.L_SliceSizeNotSupported="Zadaná veľkosť výseku nie je podporovaná.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Obsluhu udalostí sa nepodarilo odstrániť.";Strings.OfficeOM.L_BindingToMultipleSelection="Nesúvislý výber nie je podporovaný.";Strings.OfficeOM.L_DataReadError="Chyba pri čítaní údajov";Strings.OfficeOM.L_InternalErrorDescription="Vyskytla sa interná chyba.";Strings.OfficeOM.L_InvalidDataFormat="Formát zadaného dátového objektu nie je platný.";Strings.OfficeOM.L_RequestTimeout="Volanie sa vykonáva príliš dlho.";Strings.OfficeOM.L_DataStale="Neaktuálne údaje";Strings.OfficeOM.L_GetSelectionNotSupported="Aktuálny výber nie je podporovaný.";Strings.OfficeOM.L_MemoryLimit="Prekročil sa limit pamäte";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Poznámka: V tabuľke sa odporúča mať menej ako 20 000 buniek.";Strings.OfficeOM.L_InvalidTableOptionValue="Minimálne jeden parameter tableOptions má hodnotu, ktorá nie je povolená. Ešte raz skontrolujte hodnoty a skúste to znova.";Strings.OfficeOM.L_PermissionDenied="Povolenie odmietnuté";Strings.OfficeOM.L_InvalidDataObject="Neplatný dátový objekt";Strings.OfficeOM.L_UserNotSignedIn="V Office nie je prihlásený žiaden používateľ.";Strings.OfficeOM.L_SelectionCannotBound="S aktuálnym výberom nie je možné vytvoriť väzbu.";Strings.OfficeOM.L_InvalidColumnsForBinding="Uvedené stĺpce sú neplatné.";Strings.OfficeOM.L_BadSelectorString="Reťazec odovzdaný do selektora je nesprávne naformátovaný alebo nie je podporovaný.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Zadané hodnoty počtu riadkov alebo počtu stĺpcov nie sú platné.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Typ OsfControl nie je podporovaný.";Strings.OfficeOM.L_InvalidValue="Neplatná hodnota";Strings.OfficeOM.L_DataNotMatchSelection="Poskytnutý dátový objekt nie je kompatibilný s tvarom alebo rozmermi aktuálneho výberu.";Strings.OfficeOM.L_InternalError="Vnútorná chyba";Strings.OfficeOM.L_NotSupported="Funkcia {0} nie je podporovaná.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Zadaný uzol sa nenašiel.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Zadaný typ koercie nie je kompatibilný s týmto typom väzby.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Získaniu súboru zabránil problém so sieťou.";Strings.OfficeOM.L_TooManyArguments="priveľa argumentov";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operácia nie je v tomto type väzby podporovaná.";Strings.OfficeOM.L_InValidOptionalArgument="neplatný voliteľný argument";Strings.OfficeOM.L_FileTypeNotSupported="Zadaný typ súboru nie je podporovaný.";Strings.OfficeOM.L_GetDataParametersConflict="Uvedené parametre sú v konflikte.";Strings.OfficeOM.L_CallbackNotAFunction="Spätné volanie musí byť typom funkcie, bolo typom {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/outlook_strings.debug.js new file mode 100644 index 000000000..d7620d9d8 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Príloha sa nedá odstrániť, pretože príloha s indexom prílohy sa nedá nájsť."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Požiadavka prekročila maximálnu veľkosť 1 MB. Upravte požiadavku EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Na volanie metódy {0} sa vyžaduje neobmedzené povolenie."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Chyba prílohy"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Dátum ukončenia sa vyskytuje pred dátumom začatia."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Minimálne jeden zadaný zobrazovaný názov je príliš dlhý."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Celkový počet príjemcov v poli nemôže presiahnuť {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "HTML čistenie zlyhalo."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Chyba pri zápise údajov"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Na prístup k chráneným členom rozhrania JavaScript API pre Office sa vyžaduje neobmedzené povolenie."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Prílohy sa nadajú pridať, pretože správa už obsahuje maximálny počet príloh"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Interná chyba protokolu: {0}."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Používateľ prílohu odstránil pred dokončením nahrávania."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Posun tejto časovej známky sa nepodarilo nájsť."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Príloha sa nedá pridať, pretože je príliš veľká."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Čas ukončenia nemôže byť pred časom začatia."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Zadané parametre nezodpovedajú očakávanému formátu."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Príloha sa k položke nedá pridať."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Neboli zadaní žiadni platní príjemcovia."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Identifikácia prílohy bola neplatná."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Prílohy sa nedajú pridať, keď sa celá odpoveď alebo preposlaná správa načítava zo servera."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Minimálne jedna zadaná e-mailová adresa je príliš dlhá."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Cesta k prílohe bola neplatná."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Príloha sa nedá z položky odstrániť."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Vyskytla sa interná chyba formátu."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Výsledkom vstupu nie je platný dátum."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Používateľ zmenil počas vkladania údajov pozíciu kurzora." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/outlook_strings.js new file mode 100644 index 000000000..e46095663 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sk-sk/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Príloha sa nedá odstrániť, pretože príloha s indexom prílohy sa nedá nájsť.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Požiadavka prekročila maximálnu veľkosť 1 MB. Upravte požiadavku EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Na volanie metódy {0} sa vyžaduje neobmedzené povolenie.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Chyba prílohy";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Dátum ukončenia sa vyskytuje pred dátumom začatia.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Minimálne jeden zadaný zobrazovaný názov je príliš dlhý.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Celkový počet príjemcov v poli nemôže presiahnuť {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="HTML čistenie zlyhalo.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Chyba pri zápise údajov";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Na prístup k chráneným členom rozhrania JavaScript API pre Office sa vyžaduje neobmedzené povolenie.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Prílohy sa nadajú pridať, pretože správa už obsahuje maximálny počet príloh";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Interná chyba protokolu: {0}.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Používateľ prílohu odstránil pred dokončením nahrávania.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Posun tejto časovej známky sa nepodarilo nájsť.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Príloha sa nedá pridať, pretože je príliš veľká.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Čas ukončenia nemôže byť pred časom začatia.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Zadané parametre nezodpovedajú očakávanému formátu.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Príloha sa k položke nedá pridať.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Neboli zadaní žiadni platní príjemcovia.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Identifikácia prílohy bola neplatná.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Prílohy sa nedajú pridať, keď sa celá odpoveď alebo preposlaná správa načítava zo servera.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Minimálne jedna zadaná e-mailová adresa je príliš dlhá.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Cesta k prílohe bola neplatná.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Príloha sa nedá z položky odstrániť.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Vyskytla sa interná chyba formátu.";_u.ExtensibilityStrings.l_InvalidDate_Text="Výsledkom vstupu nie je platný dátum.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Používateľ zmenil počas vkladania údajov pozíciu kurzora." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/office_strings.debug.js new file mode 100644 index 000000000..2f624a2b5 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Navedena vrsta vezave ni združljiva s podanim imenovanim elementom."; +Strings.OfficeOM.L_EventHandlerNotExist = "Navedene rutine za obravnavo dogodkov ni bilo mogoče najti za to vpenjanje."; +Strings.OfficeOM.L_UnknownBindingType = "Vrsta vpenjanja ni podprta."; +Strings.OfficeOM.L_InvalidNode = "Neveljavno vozlišče"; +Strings.OfficeOM.L_NotImplemented = "Funkcija {0} ni izvedena."; +Strings.OfficeOM.L_NoCapability = "Nimate ustreznih dovoljenj za izvedbo tega dejanja."; +Strings.OfficeOM.L_SettingsCannotSave = "Nastavitev ni bilo mogoče shraniti."; +Strings.OfficeOM.L_DataWriteReminder = "Opomnik za zapis podatkov"; +Strings.OfficeOM.L_InvalidBinding = "Neveljavna vezava"; +Strings.OfficeOM.L_InvalidSetColumns = "Navedeni stolpci niso veljavni."; +Strings.OfficeOM.L_BindingCreationError = "Napaka pri ustvarjanju vezave"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Vrednost je zunaj dovoljenega obsega."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Trenutna izbira ni združljiva z navedeno vrsto prisile."; +Strings.OfficeOM.L_InvalidBindingError = "Napaka neveljavne vezave"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Navedeni vrednosti »startRow« ali »startColumn« nista veljavni."; +Strings.OfficeOM.L_InvalidSetRows = "Navedene vrstice niso veljavne."; +Strings.OfficeOM.L_NetworkProblem = "Težava z omrežjem"; +Strings.OfficeOM.L_CannotWriteToSelection = "V trenutno izbiro ni mogoče pisati."; +Strings.OfficeOM.L_MissingParameter = "Manjkajoči parameter"; +Strings.OfficeOM.L_IndexOutOfRange = "Indeks je zunaj obsega."; +Strings.OfficeOM.L_SettingsStaleError = "Napaka zaradi zastarelih nastavitev"; +Strings.OfficeOM.L_CannotNavigateTo = "Predmet je na mestu, kjer krmarjenje ni podprto."; +Strings.OfficeOM.L_ReadSettingsError = "Napaka pri branju nastavitev"; +Strings.OfficeOM.L_InvalidGetColumns = "Navedeni stolpci niso veljavni."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Navedena vrsta prisile ni podprta."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Program {0} ne obstaja. Microsoft.Office.WebExtension.Inicializiraj(razlog) ni bil klican."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Nastavljena operacija ni uspela, ker bo posredovani podatkovni predmet prepisal ali premaknil podatke."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Vrednost indeksa vrstice je zunaj dovoljenega obsega. Uporabite vrednost (0 ali večjo), ki je manjša od števila vrstic."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Navedena vrstica je prazna."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Vrednost indeksa stolpca je zunaj dovoljenega obsega. Uporabite vrednost (0 ali večjo), ki je manjša od števila stolpcev."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Nepodprto naštevanje"; +Strings.OfficeOM.L_InvalidParameters = "Parametri funkcije {0} so neveljavni."; +Strings.OfficeOM.L_SetDataParametersConflict = "Navedeni parametri so v sporu."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Preden dobite drugo datoteko, pokličite closeAsync za trenutno datoteko."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Vrsta navedenega podatkovnega predmeta ni združljiva s trenutno izbiro."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Oštevilčenje ni podprto v trenutnem gostiteljskem programu."; +Strings.OfficeOM.L_InvalidCoercion = "Neveljavna vrsta pretvorbe"; +Strings.OfficeOM.L_NotSupportedEventType = "Navedena vrsta dogodka {0} ni podprta. "; +Strings.OfficeOM.L_UnsupportedDataObject = "Posredovana vrsta podatkovnega predmeta ni podprta."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Zahtevani nabor podatkov je prevelik."; +Strings.OfficeOM.L_AppNameNotExist = "Ime_programa za {0} ne obstaja."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Izberite želeno možnost."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Najdenih je bilo več predmetov z istim imenom."; +Strings.OfficeOM.L_InvalidCellsValue = "V enem parametru ali več parametrih »cells« so vrednosti, ki niso dovoljene. Znova preverite vrednosti in poskusite znova."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Navedeni podatkovni predmet ni združljiv z vrsto vezave."; +Strings.OfficeOM.L_InvalidFormatValue = "V enem parametru ali več parametrih »format« so vrednosti, ki niso dovoljene. Znova preverite vrednosti in poskusite znova."; +Strings.OfficeOM.L_NotSupportedBindingType = "Navedena vrsta vezave {0} ni podprta. "; +Strings.OfficeOM.L_InitializeNotReady = "Office.js se še ni v celoti naložil. Poskusite znova kasneje ali dodajte svojo inicializacijsko kodo funkciji »Office.initialize«."; +Strings.OfficeOM.L_FormattingReminder = "Opomnik za oblikovanje"; +Strings.OfficeOM.L_ShuttingDown = "Postopek ni uspel, ker podatki v strežniku niso ažurni."; +Strings.OfficeOM.L_OperationNotSupported = "Postopek ni podprt."; +Strings.OfficeOM.L_DocumentReadOnly = "Zahtevan postopek ni dovoljen v trenutnem načinu dokumenta."; +Strings.OfficeOM.L_NamedItemNotFound = "Imenovani element ne obstaja."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Neveljaven klic API v trenutnem kontekstu."; +Strings.OfficeOM.L_InvalidGetRows = "Navedene vrstice niso veljavne."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Opomba: za nabore oblikovanja, ki jih je nastavil klic vmesnika API za oblikovanje, priporočamo, da so pod 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Počakajte, da se prejšnji klic dokonča."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Navedeni podatkovni predmet je prevelik."; +Strings.OfficeOM.L_DataWriteError = "Napaka pri pisanju podatkov"; +Strings.OfficeOM.L_InvalidBindingOperation = "Neveljaven postopek vezave."; +Strings.OfficeOM.L_APICallFailed = "Klic API ni uspel"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Navedeni ID ne obstaja."; +Strings.OfficeOM.L_FunctionCallFailed = "Klic funkcije {0} ni uspel, koda napake: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Posredovani podatkovni predmet se ne ujema z velikostjo trenutne izbire."; +Strings.OfficeOM.L_SaveSettingsError = "Napaka pri shranjevanju nastavitev"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Ta API je bil zadušen zato, da je bila zmanjšana pogostost klicanja."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Navedeni vrednosti »startRow« ali »startColumn« nista veljavni."; +Strings.OfficeOM.L_InvalidFormat = "Neveljavna napaka pri oblikovanju"; +Strings.OfficeOM.L_BindingNotExist = "Navedena vrsta vezave ne obstaja."; +Strings.OfficeOM.L_SettingNameNotExist = "Navedeno ime nastavitve ne obstaja."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Rutine za obravnavo dogodkov ni bilo mogoče dodati."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Ta brskalnik ne podpira zahtevanega API-ja."; +Strings.OfficeOM.L_InvalidAPICall = "Neveljaven klic API"; +Strings.OfficeOM.L_EventRegistrationError = "Napaka pri prijavi na dogodek"; +Strings.OfficeOM.L_ElementMissing = "Celice tabele ni mogoče oblikovati, ker manjkajo nekatere vrednosti parametrov. Znova preverite parametre in poskusite znova."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Koordinatnih parametrov ni mogoče uporabiti s pretvorbeno tabelo, ko tabela vsebuje spojene celice."; +Strings.OfficeOM.L_NavOutOfBound = "Postopek ni uspel, ker je kazalo zunaj obsega."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Povratnega klica ni mogoče navesti hkrati v seznamu argumentov in v izbirnem predmetu."; +Strings.OfficeOM.L_CustomXmlError = "Napaka XML po meri."; +Strings.OfficeOM.L_SettingsAreStale = "Nastavitev ni mogoče shraniti, ker niso ažurne."; +Strings.OfficeOM.L_TooManyOptionalFunction = "na seznamu parametrov je več izbirnih funkcij"; +Strings.OfficeOM.L_MissingRequiredArguments = "Manjka nekaj zahtevanih argumentov"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Koordinatnih parametrov ni mogoče uporabiti s pretvorbeno tabelo, ko tabela vsebuje spojene celice."; +Strings.OfficeOM.L_HostError = "Napaka gostitelja"; +Strings.OfficeOM.L_OutOfRange = "Zunaj obsega"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Vezi ni mogoče ustvariti s trenutno izbiro in z navedeno vrsto vezave."; +Strings.OfficeOM.L_TooManyOptionalObjects = "na seznamu parametrov je več izbirnih predmetov"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Izbrana vsebina mora biti v obliki tabele. Oblikujte podatke v obliki tabele in poskusite znova."; +Strings.OfficeOM.L_APINotSupported = "Klic API ni podprt"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Izbrana velikost rezine ni podrta."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Rutine za obravnavo dogodkov ni bilo mogoče odstraniti."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Nestični izbori niso podprti."; +Strings.OfficeOM.L_DataReadError = "Napaka pri branju podatkov"; +Strings.OfficeOM.L_InternalErrorDescription = "Prišlo je do notranje napake."; +Strings.OfficeOM.L_InvalidDataFormat = "Oblika navedenega podatkovnega predmeta je neveljavna."; +Strings.OfficeOM.L_RequestTimeout = "Izvedba klica je trajala predolgo."; +Strings.OfficeOM.L_DataStale = "Podatki niso ažurni"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Trenutna izbira ni podprta."; +Strings.OfficeOM.L_MemoryLimit = "Presežena je omejitev pomnilnika"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Opomba: število celic v tabeli naj bo manjše od 20.000 celic."; +Strings.OfficeOM.L_InvalidTableOptionValue = "V enem parametru ali več parametrih »tableOptions« so vrednosti, ki niso dovoljene. Znova preverite vrednosti in poskusite znova."; +Strings.OfficeOM.L_PermissionDenied = "Dovoljenje je zavrnjeno"; +Strings.OfficeOM.L_InvalidDataObject = "Neveljaven podatkovni predmet"; +Strings.OfficeOM.L_UserNotSignedIn = "Noben uporabnik ni vpisan v Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Na trenutno izbiro ni mogoče vezati."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Navedeni stolpci niso veljavni."; +Strings.OfficeOM.L_BadSelectorString = "Niz, posredovan v izbirnik, ni pravilno oblikovana ali pa ni podprt."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Navedeni vrednosti »rowCount« ali »columnCount« nista veljavni."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Vrsta »OsfControl« ni podprta."; +Strings.OfficeOM.L_InvalidValue = "Neveljavna vrednost"; +Strings.OfficeOM.L_DataNotMatchSelection = "Posredovani podatkovni predmet ni združljiv z obliko ali dimenzijami trenutne izbire."; +Strings.OfficeOM.L_InternalError = "Notranja napaka"; +Strings.OfficeOM.L_NotSupported = "Funkcija {0} ni podprta."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Navedenega vozlišča ni bilo mogoče najti."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Navedena vrsta prisile ni združljiva s to vrsto vezave."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Datoteke ni mogoče dobiti zaradi napake omrežja."; +Strings.OfficeOM.L_TooManyArguments = "preveč argumentov"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Postopek ni podprt v tej vrsti vezave."; +Strings.OfficeOM.L_InValidOptionalArgument = "neveljaven izbirni argument"; +Strings.OfficeOM.L_FileTypeNotSupported = "Navedena vrsta datoteke ni podprta."; +Strings.OfficeOM.L_GetDataParametersConflict = "Navedeni parametri so v sporu."; +Strings.OfficeOM.L_CallbackNotAFunction = "Povratni klic mora biti vrste funkcija. Bil je vrste {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/office_strings.js new file mode 100644 index 000000000..0b73fe27c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Navedena vrsta vezave ni združljiva s podanim imenovanim elementom.";Strings.OfficeOM.L_EventHandlerNotExist="Navedene rutine za obravnavo dogodkov ni bilo mogoče najti za to vpenjanje.";Strings.OfficeOM.L_UnknownBindingType="Vrsta vpenjanja ni podprta.";Strings.OfficeOM.L_InvalidNode="Neveljavno vozlišče";Strings.OfficeOM.L_NotImplemented="Funkcija {0} ni izvedena.";Strings.OfficeOM.L_NoCapability="Nimate ustreznih dovoljenj za izvedbo tega dejanja.";Strings.OfficeOM.L_SettingsCannotSave="Nastavitev ni bilo mogoče shraniti.";Strings.OfficeOM.L_DataWriteReminder="Opomnik za zapis podatkov";Strings.OfficeOM.L_InvalidBinding="Neveljavna vezava";Strings.OfficeOM.L_InvalidSetColumns="Navedeni stolpci niso veljavni.";Strings.OfficeOM.L_BindingCreationError="Napaka pri ustvarjanju vezave";Strings.OfficeOM.L_FormatValueOutOfRange="Vrednost je zunaj dovoljenega obsega.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Trenutna izbira ni združljiva z navedeno vrsto prisile.";Strings.OfficeOM.L_InvalidBindingError="Napaka neveljavne vezave";Strings.OfficeOM.L_InvalidGetStartRowColumn="Navedeni vrednosti »startRow« ali »startColumn« nista veljavni.";Strings.OfficeOM.L_InvalidSetRows="Navedene vrstice niso veljavne.";Strings.OfficeOM.L_NetworkProblem="Težava z omrežjem";Strings.OfficeOM.L_CannotWriteToSelection="V trenutno izbiro ni mogoče pisati.";Strings.OfficeOM.L_MissingParameter="Manjkajoči parameter";Strings.OfficeOM.L_IndexOutOfRange="Indeks je zunaj obsega.";Strings.OfficeOM.L_SettingsStaleError="Napaka zaradi zastarelih nastavitev";Strings.OfficeOM.L_CannotNavigateTo="Predmet je na mestu, kjer krmarjenje ni podprto.";Strings.OfficeOM.L_ReadSettingsError="Napaka pri branju nastavitev";Strings.OfficeOM.L_InvalidGetColumns="Navedeni stolpci niso veljavni.";Strings.OfficeOM.L_CoercionTypeNotSupported="Navedena vrsta prisile ni podprta.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Program {0} ne obstaja. Microsoft.Office.WebExtension.Inicializiraj(razlog) ni bil klican.";Strings.OfficeOM.L_OverwriteWorksheetData="Nastavljena operacija ni uspela, ker bo posredovani podatkovni predmet prepisal ali premaknil podatke.";Strings.OfficeOM.L_RowIndexOutOfRange="Vrednost indeksa vrstice je zunaj dovoljenega obsega. Uporabite vrednost (0 ali večjo), ki je manjša od števila vrstic.";Strings.OfficeOM.L_InvalidReadForBlankRow="Navedena vrstica je prazna.";Strings.OfficeOM.L_ColIndexOutOfRange="Vrednost indeksa stolpca je zunaj dovoljenega obsega. Uporabite vrednost (0 ali večjo), ki je manjša od števila stolpcev.";Strings.OfficeOM.L_UnsupportedEnumeration="Nepodprto naštevanje";Strings.OfficeOM.L_InvalidParameters="Parametri funkcije {0} so neveljavni.";Strings.OfficeOM.L_SetDataParametersConflict="Navedeni parametri so v sporu.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Preden dobite drugo datoteko, pokličite closeAsync za trenutno datoteko.";Strings.OfficeOM.L_DataNotMatchCoercionType="Vrsta navedenega podatkovnega predmeta ni združljiva s trenutno izbiro.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Oštevilčenje ni podprto v trenutnem gostiteljskem programu.";Strings.OfficeOM.L_InvalidCoercion="Neveljavna vrsta pretvorbe";Strings.OfficeOM.L_NotSupportedEventType="Navedena vrsta dogodka {0} ni podprta. ";Strings.OfficeOM.L_UnsupportedDataObject="Posredovana vrsta podatkovnega predmeta ni podprta.";Strings.OfficeOM.L_GetDataIsTooLarge="Zahtevani nabor podatkov je prevelik.";Strings.OfficeOM.L_AppNameNotExist="Ime_programa za {0} ne obstaja.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Izberite želeno možnost.";Strings.OfficeOM.L_MultipleNamedItemFound="Najdenih je bilo več predmetov z istim imenom.";Strings.OfficeOM.L_InvalidCellsValue="V enem parametru ali več parametrih »cells« so vrednosti, ki niso dovoljene. Znova preverite vrednosti in poskusite znova.";Strings.OfficeOM.L_DataNotMatchBindingType="Navedeni podatkovni predmet ni združljiv z vrsto vezave.";Strings.OfficeOM.L_InvalidFormatValue="V enem parametru ali več parametrih »format« so vrednosti, ki niso dovoljene. Znova preverite vrednosti in poskusite znova.";Strings.OfficeOM.L_NotSupportedBindingType="Navedena vrsta vezave {0} ni podprta. ";Strings.OfficeOM.L_InitializeNotReady="Office.js se še ni v celoti naložil. Poskusite znova kasneje ali dodajte svojo inicializacijsko kodo funkciji »Office.initialize«.";Strings.OfficeOM.L_FormattingReminder="Opomnik za oblikovanje";Strings.OfficeOM.L_ShuttingDown="Postopek ni uspel, ker podatki v strežniku niso ažurni.";Strings.OfficeOM.L_OperationNotSupported="Postopek ni podprt.";Strings.OfficeOM.L_DocumentReadOnly="Zahtevan postopek ni dovoljen v trenutnem načinu dokumenta.";Strings.OfficeOM.L_NamedItemNotFound="Imenovani element ne obstaja.";Strings.OfficeOM.L_InvalidApiCallInContext="Neveljaven klic API v trenutnem kontekstu.";Strings.OfficeOM.L_InvalidGetRows="Navedene vrstice niso veljavne.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Opomba: za nabore oblikovanja, ki jih je nastavil klic vmesnika API za oblikovanje, priporočamo, da so pod 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Počakajte, da se prejšnji klic dokonča.";Strings.OfficeOM.L_SetDataIsTooLarge="Navedeni podatkovni predmet je prevelik.";Strings.OfficeOM.L_DataWriteError="Napaka pri pisanju podatkov";Strings.OfficeOM.L_InvalidBindingOperation="Neveljaven postopek vezave.";Strings.OfficeOM.L_APICallFailed="Klic API ni uspel";Strings.OfficeOM.L_SpecifiedIdNotExist="Navedeni ID ne obstaja.";Strings.OfficeOM.L_FunctionCallFailed="Klic funkcije {0} ni uspel, koda napake: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Posredovani podatkovni predmet se ne ujema z velikostjo trenutne izbire.";Strings.OfficeOM.L_SaveSettingsError="Napaka pri shranjevanju nastavitev";Strings.OfficeOM.L_RequestTokenUnavailable="Ta API je bil zadušen zato, da je bila zmanjšana pogostost klicanja.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Navedeni vrednosti »startRow« ali »startColumn« nista veljavni.";Strings.OfficeOM.L_InvalidFormat="Neveljavna napaka pri oblikovanju";Strings.OfficeOM.L_BindingNotExist="Navedena vrsta vezave ne obstaja.";Strings.OfficeOM.L_SettingNameNotExist="Navedeno ime nastavitve ne obstaja.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Rutine za obravnavo dogodkov ni bilo mogoče dodati.";Strings.OfficeOM.L_BrowserAPINotSupported="Ta brskalnik ne podpira zahtevanega API-ja.";Strings.OfficeOM.L_InvalidAPICall="Neveljaven klic API";Strings.OfficeOM.L_EventRegistrationError="Napaka pri prijavi na dogodek";Strings.OfficeOM.L_ElementMissing="Celice tabele ni mogoče oblikovati, ker manjkajo nekatere vrednosti parametrov. Znova preverite parametre in poskusite znova.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Koordinatnih parametrov ni mogoče uporabiti s pretvorbeno tabelo, ko tabela vsebuje spojene celice.";Strings.OfficeOM.L_NavOutOfBound="Postopek ni uspel, ker je kazalo zunaj obsega.";Strings.OfficeOM.L_RedundantCallbackSpecification="Povratnega klica ni mogoče navesti hkrati v seznamu argumentov in v izbirnem predmetu.";Strings.OfficeOM.L_CustomXmlError="Napaka XML po meri.";Strings.OfficeOM.L_SettingsAreStale="Nastavitev ni mogoče shraniti, ker niso ažurne.";Strings.OfficeOM.L_TooManyOptionalFunction="na seznamu parametrov je več izbirnih funkcij";Strings.OfficeOM.L_MissingRequiredArguments="Manjka nekaj zahtevanih argumentov";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Koordinatnih parametrov ni mogoče uporabiti s pretvorbeno tabelo, ko tabela vsebuje spojene celice.";Strings.OfficeOM.L_HostError="Napaka gostitelja";Strings.OfficeOM.L_OutOfRange="Zunaj obsega";Strings.OfficeOM.L_InvalidSelectionForBindingType="Vezi ni mogoče ustvariti s trenutno izbiro in z navedeno vrsto vezave.";Strings.OfficeOM.L_TooManyOptionalObjects="na seznamu parametrov je več izbirnih predmetov";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Izbrana vsebina mora biti v obliki tabele. Oblikujte podatke v obliki tabele in poskusite znova.";Strings.OfficeOM.L_APINotSupported="Klic API ni podprt";Strings.OfficeOM.L_SliceSizeNotSupported="Izbrana velikost rezine ni podrta.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Rutine za obravnavo dogodkov ni bilo mogoče odstraniti.";Strings.OfficeOM.L_BindingToMultipleSelection="Nestični izbori niso podprti.";Strings.OfficeOM.L_DataReadError="Napaka pri branju podatkov";Strings.OfficeOM.L_InternalErrorDescription="Prišlo je do notranje napake.";Strings.OfficeOM.L_InvalidDataFormat="Oblika navedenega podatkovnega predmeta je neveljavna.";Strings.OfficeOM.L_RequestTimeout="Izvedba klica je trajala predolgo.";Strings.OfficeOM.L_DataStale="Podatki niso ažurni";Strings.OfficeOM.L_GetSelectionNotSupported="Trenutna izbira ni podprta.";Strings.OfficeOM.L_MemoryLimit="Presežena je omejitev pomnilnika";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Opomba: število celic v tabeli naj bo manjše od 20.000 celic.";Strings.OfficeOM.L_InvalidTableOptionValue="V enem parametru ali več parametrih »tableOptions« so vrednosti, ki niso dovoljene. Znova preverite vrednosti in poskusite znova.";Strings.OfficeOM.L_PermissionDenied="Dovoljenje je zavrnjeno";Strings.OfficeOM.L_InvalidDataObject="Neveljaven podatkovni predmet";Strings.OfficeOM.L_UserNotSignedIn="Noben uporabnik ni vpisan v Office.";Strings.OfficeOM.L_SelectionCannotBound="Na trenutno izbiro ni mogoče vezati.";Strings.OfficeOM.L_InvalidColumnsForBinding="Navedeni stolpci niso veljavni.";Strings.OfficeOM.L_BadSelectorString="Niz, posredovan v izbirnik, ni pravilno oblikovana ali pa ni podprt.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Navedeni vrednosti »rowCount« ali »columnCount« nista veljavni.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Vrsta »OsfControl« ni podprta.";Strings.OfficeOM.L_InvalidValue="Neveljavna vrednost";Strings.OfficeOM.L_DataNotMatchSelection="Posredovani podatkovni predmet ni združljiv z obliko ali dimenzijami trenutne izbire.";Strings.OfficeOM.L_InternalError="Notranja napaka";Strings.OfficeOM.L_NotSupported="Funkcija {0} ni podprta.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Navedenega vozlišča ni bilo mogoče najti.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Navedena vrsta prisile ni združljiva s to vrsto vezave.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Datoteke ni mogoče dobiti zaradi napake omrežja.";Strings.OfficeOM.L_TooManyArguments="preveč argumentov";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Postopek ni podprt v tej vrsti vezave.";Strings.OfficeOM.L_InValidOptionalArgument="neveljaven izbirni argument";Strings.OfficeOM.L_FileTypeNotSupported="Navedena vrsta datoteke ni podprta.";Strings.OfficeOM.L_GetDataParametersConflict="Navedeni parametri so v sporu.";Strings.OfficeOM.L_CallbackNotAFunction="Povratni klic mora biti vrste funkcija. Bil je vrste {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/outlook_strings.debug.js new file mode 100644 index 000000000..2cea034f7 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Priloge ni mogoče izbrisati, ker ni mogoče najti priloge z indeksom priloge."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Zahteva presega omejitev velikosti 1 MB. Spremenite zahtevo EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Zahtevano je zvišano dovoljenje za klic načina: »{0}«."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Napaka s prilogo"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Končni datum nastopi pred začetnim datumom."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Eno ali več vnesenih prikazanih imen je predolgo."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Skupno število prejemnikov v polju ne sme biti večje od {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Kode HTML ni bilo mogoče sanirati."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Napaka pri pisanju podatkov"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Za dostop do zaščitenih članov API skripta JavaScript za Office je zahtevano zvišano dovoljenje."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Prilog ni mogoče dodati, ker sporočilo že ima največje dovoljeno število prilog"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Notranja napaka protokola: »{0}«."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Uporabnik je odstranil prilogo, preden je bil postopek prenosa dokončan."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Ni mogoče najti odmika za časovni žig."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Priloge ni mogoče dodati, ker je prevelika."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Čas konca ne more biti pred časom začetka."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Navedeni parametri se ne ujemajo s pričakovano obliko zapisa."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Elementu ni mogoče dodati priloge."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Ni navedenih veljavnih prejemnikov."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ID priloge ni veljaven."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Prilog ni mogoče dodati, če sta iz strežnika dobljena poln odgovor ali posredovano sporočilo."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Eno ali več vnesenih e-poštnih naslovov je predolgih."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Pot priloge ni veljavna."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Priloge ni mogoče izbrisati iz elementa."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Prišlo je do napake notranje oblike zapisa."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Vnosa ni mogoče razrešiti v veljaven datum."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Uporabnik je med postopkom vstavljanja podatkov spremenil položaj kazalca." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/outlook_strings.js new file mode 100644 index 000000000..bcea3d6a0 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sl-si/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Priloge ni mogoče izbrisati, ker ni mogoče najti priloge z indeksom priloge.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Zahteva presega omejitev velikosti 1 MB. Spremenite zahtevo EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Zahtevano je zvišano dovoljenje za klic načina: »{0}«.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Napaka s prilogo";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Končni datum nastopi pred začetnim datumom.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Eno ali več vnesenih prikazanih imen je predolgo.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Skupno število prejemnikov v polju ne sme biti večje od {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Kode HTML ni bilo mogoče sanirati.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Napaka pri pisanju podatkov";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Za dostop do zaščitenih članov API skripta JavaScript za Office je zahtevano zvišano dovoljenje.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Prilog ni mogoče dodati, ker sporočilo že ima največje dovoljeno število prilog";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Notranja napaka protokola: »{0}«.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Uporabnik je odstranil prilogo, preden je bil postopek prenosa dokončan.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Ni mogoče najti odmika za časovni žig.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Priloge ni mogoče dodati, ker je prevelika.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Čas konca ne more biti pred časom začetka.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Navedeni parametri se ne ujemajo s pričakovano obliko zapisa.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Elementu ni mogoče dodati priloge.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Ni navedenih veljavnih prejemnikov.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ID priloge ni veljaven.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Prilog ni mogoče dodati, če sta iz strežnika dobljena poln odgovor ali posredovano sporočilo.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Eno ali več vnesenih e-poštnih naslovov je predolgih.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Pot priloge ni veljavna.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Priloge ni mogoče izbrisati iz elementa.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Prišlo je do napake notranje oblike zapisa.";_u.ExtensibilityStrings.l_InvalidDate_Text="Vnosa ni mogoče razrešiti v veljaven datum.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Uporabnik je med postopkom vstavljanja podatkov spremenil položaj kazalca." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/office_strings.debug.js new file mode 100644 index 000000000..a06e1a321 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Navedeni tip povezivanja nije kompatibilan sa navedenom imenovanom stavkom."; +Strings.OfficeOM.L_EventHandlerNotExist = "_Ťhě şpëćîfîëđ ëvěňť hăńđľęř wąś ňöť fôµňď föř ţhíš bíńđîńg.džšćđČdžš_"; +Strings.OfficeOM.L_UnknownBindingType = "Tip povezivanja nije podržan."; +Strings.OfficeOM.L_InvalidNode = "Nevažeći čvor"; +Strings.OfficeOM.L_NotImplemented = "Funkcija {0} nije primenjena."; +Strings.OfficeOM.L_NoCapability = "Nemate dovoljno dozvola za ovu radnju."; +Strings.OfficeOM.L_SettingsCannotSave = "Nije bilo moguće sačuvati postavke."; +Strings.OfficeOM.L_DataWriteReminder = "_Đäţä Wřîťé Řěmîńďěŕdžš_"; +Strings.OfficeOM.L_InvalidBinding = "Nevažeće povezivanje"; +Strings.OfficeOM.L_InvalidSetColumns = "Navedene kolone su nevažeće."; +Strings.OfficeOM.L_BindingCreationError = "Greška u stvaranju povezivanja"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Vrednost je izvan dozvoljenog opsega."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Trenutna selekcija nije kompatibilna sa navedenim tipom promene."; +Strings.OfficeOM.L_InvalidBindingError = "Greška nevažećeg povezivanja"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Navedene vrednosti za početni red ili početnu kolonu nisu važeće."; +Strings.OfficeOM.L_InvalidSetRows = "Navedeni redovi su nevažeći."; +Strings.OfficeOM.L_NetworkProblem = "_Ňěţwôŕk Pŕőbłémdž_"; +Strings.OfficeOM.L_CannotWriteToSelection = "Upisivanje u trenutnu selekciju nije moguće."; +Strings.OfficeOM.L_MissingParameter = "Parametar nedostaje"; +Strings.OfficeOM.L_IndexOutOfRange = "Indeks je izvan opsega."; +Strings.OfficeOM.L_SettingsStaleError = "Greška usled zastarelih postavki"; +Strings.OfficeOM.L_CannotNavigateTo = "Objekat se nalazi na lokaciji na kojoj navigacija nije podržana."; +Strings.OfficeOM.L_ReadSettingsError = "Greška u postavkama čitanja"; +Strings.OfficeOM.L_InvalidGetColumns = "Navedene kolone su nevažeće."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Navedeni tip promene nije podržan."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Aplikacija {0} ne postoji. Microsoft.Office.WebExtension.initialize(razlog) nije pozvan."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Operacija postavljanja nije uspela zato što će navedeni objekat podataka zameniti ili premestiti podatke."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Vrednost indeksa reda je izvan dozvoljenog opsega. Koristite vrednost (0 ili veću) koja je manja od broja redova."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "_Ţhé şpęčífîěď ŕôw îš bľáńk.džšć_"; +Strings.OfficeOM.L_ColIndexOutOfRange = "Vrednost indeksa kolone je izvan dozvoljenog opsega. Koristite vrednost (0 ili veću) koja je manja od broja kolona."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Nepodržano nabrajanje"; +Strings.OfficeOM.L_InvalidParameters = "Funkcija {0} ima nevažeće parametre."; +Strings.OfficeOM.L_SetDataParametersConflict = "Navedeni parametri su neusaglašeni."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "_Čäĺľ çľóšëĄšýńč őń ţhë ćűŕŕéńť Fîľę bęfőřě řęťŕíěvíňg äńôţhęŕ.džšćđČdžšć_"; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Tip navedenog objekta podataka nije kompatibilan sa trenutnom selekcijom."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Nabrajanje nije podržano u trenutnoj aplikaciji hosta."; +Strings.OfficeOM.L_InvalidCoercion = "Nevažeći tip promene"; +Strings.OfficeOM.L_NotSupportedEventType = "Navedeni tip događaja {0} nije podržan."; +Strings.OfficeOM.L_UnsupportedDataObject = "Navedeni tip objekta podataka nije podržan."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Zahtevani skup podataka je prevelik."; +Strings.OfficeOM.L_AppNameNotExist = "AppName za {0} ne postoji."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Napravite selekciju."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Pronađeno je više objekata sa istim imenom."; +Strings.OfficeOM.L_InvalidCellsValue = "Neki parametri ćelije imaju vrednosti koje nisu dozvoljene. Proverite vrednosti još jednom i probajte ponovo."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Navedeni objekat podataka nije kompatibilan sa tipom povezivanja."; +Strings.OfficeOM.L_InvalidFormatValue = "Neki parametri formata imaju vrednosti koje nisu dozvoljene. Proverite vrednosti još jednom i probajte ponovo."; +Strings.OfficeOM.L_NotSupportedBindingType = "Navedeni tip povezivanja {0} nije podržan."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js još uvek nije potpuno učitan. Pokušajte ponovo kasnije ili postarajte se da dodate vaš kôd za pokretanje na vaš Office.initialize function."; +Strings.OfficeOM.L_FormattingReminder = "_Fôřmäţťîňg Ŕęmîńďéřdžš_"; +Strings.OfficeOM.L_ShuttingDown = "Operacija nije uspela zato što podaci na serveru nisu u toku."; +Strings.OfficeOM.L_OperationNotSupported = "Operacija nije podržana."; +Strings.OfficeOM.L_DocumentReadOnly = "Zahtevana operacija nije dozvoljena u trenutnom režimu dokumenta."; +Strings.OfficeOM.L_NamedItemNotFound = "Imenovana stavka ne postoji."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Nevažeći API poziv u trenutnom kontekstu."; +Strings.OfficeOM.L_InvalidGetRows = "Navedeni redovi su nevažeći."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "_Ňôţę: Ťhę fóŕmáťťíňg śěţś śęţ bý ą Föřmâťţîňg API ćâľľ íş śüggéşťěđ ťô bě běłów 100.džšćđČdžšćđČd_"; +Strings.OfficeOM.L_TooManyIncompleteRequests = "_Wâîť úńťîł ťhě pŕěvîöůş çăĺľ çômpľěťëş.džšćđČ_"; +Strings.OfficeOM.L_SetDataIsTooLarge = "Navedeni objekat podataka je prevelik."; +Strings.OfficeOM.L_DataWriteError = "Greška u pisanju podataka"; +Strings.OfficeOM.L_InvalidBindingOperation = "Operacija nevažećeg povezivanja"; +Strings.OfficeOM.L_APICallFailed = "_API Čäłĺ Fáîĺěďdž_"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Navedeni ID ne postoji."; +Strings.OfficeOM.L_FunctionCallFailed = "Poziv funkcije {0} nije uspeo, kod greške: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Navedeni objekat podataka ne podudara se sa veličinom trenutne selekcije."; +Strings.OfficeOM.L_SaveSettingsError = "Greška pri čuvanju postavki"; +Strings.OfficeOM.L_RequestTokenUnavailable = "_Ţhîś API häş běęń ťhŕôťţľęđ ţő şłöw ţhě čâłĺ fřéqµęńčý.džšćđČdžš_"; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Navedene vrednosti za početni red ili početnu kolonu nisu važeće."; +Strings.OfficeOM.L_InvalidFormat = "Greška nevažećeg formata"; +Strings.OfficeOM.L_BindingNotExist = "Navedeno povezivanje ne postoji."; +Strings.OfficeOM.L_SettingNameNotExist = "Navedeno ime postavke ne postoji."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Dodavanje rukovaoca događajem nije uspelo."; +Strings.OfficeOM.L_BrowserAPINotSupported = "_Ťhîš bŕőwşęř ďôëš ňôť śµppóřť ťhé řéqúěšţëđ API.džšćđČdž_"; +Strings.OfficeOM.L_InvalidAPICall = "Nevažeći API poziv"; +Strings.OfficeOM.L_EventRegistrationError = "Greška pri registraciji događaja"; +Strings.OfficeOM.L_ElementMissing = "Nismo mogli da oblikujemo ćeliju tabele zato što nedostaju neke vrednosti parametara. Proverite parametre još jednom i probajte ponovo."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Nije moguće koristiti parametre za koordinaciju sa tabelom tipa promene kada tabela sadrži objedinjene ćelije."; +Strings.OfficeOM.L_NavOutOfBound = "Operacija nije uspela zato što je indeks van opsega."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Povratni poziv ne može biti naveden i u listi argumenata i u opcionalnom objektu."; +Strings.OfficeOM.L_CustomXmlError = "Greška u prilagođenim XML."; +Strings.OfficeOM.L_SettingsAreStale = "Nije bilo moguće sačuvati postavke jer nisu u toku."; +Strings.OfficeOM.L_TooManyOptionalFunction = "višestruke opcionalne funkcije na listi parametara"; +Strings.OfficeOM.L_MissingRequiredArguments = "nedostaju neki neophodni argumenti"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Nije moguće koristiti parametre za koordinaciju sa tabelom tipa promene kada tabela sadrži objedinjene ćelije."; +Strings.OfficeOM.L_HostError = "Greška hosta"; +Strings.OfficeOM.L_OutOfRange = "Izvan opsega"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Nije moguće kreirati povezivanje sa trenutnom selekcijom i navedenim tipom povezivanja."; +Strings.OfficeOM.L_TooManyOptionalObjects = "višestruki opcionalni objekti na listi parametara"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Potrebo je da izabrani sadržaj bude u formatu tabele. Oblikujte podatke u vidu tabele i probajte ponovo."; +Strings.OfficeOM.L_APINotSupported = "_API Ńöť Šüppóřťëđdžš_"; +Strings.OfficeOM.L_SliceSizeNotSupported = "_Ťhë şpęćífíéđ šľîçę şíżé íş ňőť šűppôŕťëđ.džšćđČd_"; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Uklanjanje rukovaoca događajem nije uspelo."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Nekontinuirane selekcije nisu podržane."; +Strings.OfficeOM.L_DataReadError = "Greška u čitanju podataka"; +Strings.OfficeOM.L_InternalErrorDescription = "Došlo je do unutrašnje greške."; +Strings.OfficeOM.L_InvalidDataFormat = "Format navedenog objekta podataka nije važeći."; +Strings.OfficeOM.L_RequestTimeout = "_Ţhę ćáĺł ťôôk ťôô ľóňg ţö ęxęćűţé.džšćđ_"; +Strings.OfficeOM.L_DataStale = "Podaci nisu u toku"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Trenutna selekcija nije podržana."; +Strings.OfficeOM.L_MemoryLimit = "_Męmöřý Łîmîť Ęxçęěďěđdžš_"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "_Ńőţě: Ťhę ńűmbëŕ öf čěĺłś îň ă ťąbľë îš šüggëśţěđ ţő bë béĺőw 20,000 čëľĺš.džšćđČdžšćđČ_"; +Strings.OfficeOM.L_InvalidTableOptionValue = "Neki tableOptions parametri imaju vrednosti koje nisu dozvoljene. Proverite vrednosti još jednom i probajte ponovo."; +Strings.OfficeOM.L_PermissionDenied = "Dozvola je odbijena"; +Strings.OfficeOM.L_InvalidDataObject = "Nevažeći objekat podataka"; +Strings.OfficeOM.L_UserNotSignedIn = "_Ňö ůśęŕ îś šígńęď íňţó Óffíčé.džšćđ_"; +Strings.OfficeOM.L_SelectionCannotBound = "Nije moguće izvršiti povezivanje sa trenutnom selekcijom."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Navedene kolone su nevažeće."; +Strings.OfficeOM.L_BadSelectorString = "Niska koja je prosleđena u birač nije u ispravnom formatu ili nije podržan."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Navedene vrednosti za broj redova ili broj kolona nisu važeće."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "OsfControl tip nije podržan."; +Strings.OfficeOM.L_InvalidValue = "Nevažeća vrednost"; +Strings.OfficeOM.L_DataNotMatchSelection = "Navedeni objekat podataka nije kompatibilan sa oblikom ili dimenzijama trenutne selekcije."; +Strings.OfficeOM.L_InternalError = "Unutrašnja greška"; +Strings.OfficeOM.L_NotSupported = "Funkcija {0} nije podržana."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Nije pronađen navedeni čvor."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Navedeni tip promene nije kompatibilan sa ovim tipom povezivanja."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "_A ńěťwóŕk pŕőbłëm häš přěvëńţëđ řéţřîěväľ őf ťhé fîĺě.džšćđČdžš_"; +Strings.OfficeOM.L_TooManyArguments = "previše argumenata"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Operacija nije podržana na ovom tipu povezivanja."; +Strings.OfficeOM.L_InValidOptionalArgument = "nevažeći opcionalni argument"; +Strings.OfficeOM.L_FileTypeNotSupported = "Navedeni tip datoteke nije podržan."; +Strings.OfficeOM.L_GetDataParametersConflict = "Navedeni parametri su neusaglašeni."; +Strings.OfficeOM.L_CallbackNotAFunction = "Povratni poziv mora biti funkcija tipa, bila je tipa {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/office_strings.js new file mode 100644 index 000000000..7901e12e3 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Navedeni tip povezivanja nije kompatibilan sa navedenom imenovanom stavkom.";Strings.OfficeOM.L_EventHandlerNotExist="_Ťhě şpëćîfîëđ ëvěňť hăńđľęř wąś ňöť fôµňď föř ţhíš bíńđîńg.džšćđČdžš_";Strings.OfficeOM.L_UnknownBindingType="Tip povezivanja nije podržan.";Strings.OfficeOM.L_InvalidNode="Nevažeći čvor";Strings.OfficeOM.L_NotImplemented="Funkcija {0} nije primenjena.";Strings.OfficeOM.L_NoCapability="Nemate dovoljno dozvola za ovu radnju.";Strings.OfficeOM.L_SettingsCannotSave="Nije bilo moguće sačuvati postavke.";Strings.OfficeOM.L_DataWriteReminder="_Đäţä Wřîťé Řěmîńďěŕdžš_";Strings.OfficeOM.L_InvalidBinding="Nevažeće povezivanje";Strings.OfficeOM.L_InvalidSetColumns="Navedene kolone su nevažeće.";Strings.OfficeOM.L_BindingCreationError="Greška u stvaranju povezivanja";Strings.OfficeOM.L_FormatValueOutOfRange="Vrednost je izvan dozvoljenog opsega.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Trenutna selekcija nije kompatibilna sa navedenim tipom promene.";Strings.OfficeOM.L_InvalidBindingError="Greška nevažećeg povezivanja";Strings.OfficeOM.L_InvalidGetStartRowColumn="Navedene vrednosti za početni red ili početnu kolonu nisu važeće.";Strings.OfficeOM.L_InvalidSetRows="Navedeni redovi su nevažeći.";Strings.OfficeOM.L_NetworkProblem="_Ňěţwôŕk Pŕőbłémdž_";Strings.OfficeOM.L_CannotWriteToSelection="Upisivanje u trenutnu selekciju nije moguće.";Strings.OfficeOM.L_MissingParameter="Parametar nedostaje";Strings.OfficeOM.L_IndexOutOfRange="Indeks je izvan opsega.";Strings.OfficeOM.L_SettingsStaleError="Greška usled zastarelih postavki";Strings.OfficeOM.L_CannotNavigateTo="Objekat se nalazi na lokaciji na kojoj navigacija nije podržana.";Strings.OfficeOM.L_ReadSettingsError="Greška u postavkama čitanja";Strings.OfficeOM.L_InvalidGetColumns="Navedene kolone su nevažeće.";Strings.OfficeOM.L_CoercionTypeNotSupported="Navedeni tip promene nije podržan.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Aplikacija {0} ne postoji. Microsoft.Office.WebExtension.initialize(razlog) nije pozvan.";Strings.OfficeOM.L_OverwriteWorksheetData="Operacija postavljanja nije uspela zato što će navedeni objekat podataka zameniti ili premestiti podatke.";Strings.OfficeOM.L_RowIndexOutOfRange="Vrednost indeksa reda je izvan dozvoljenog opsega. Koristite vrednost (0 ili veću) koja je manja od broja redova.";Strings.OfficeOM.L_InvalidReadForBlankRow="_Ţhé şpęčífîěď ŕôw îš bľáńk.džšć_";Strings.OfficeOM.L_ColIndexOutOfRange="Vrednost indeksa kolone je izvan dozvoljenog opsega. Koristite vrednost (0 ili veću) koja je manja od broja kolona.";Strings.OfficeOM.L_UnsupportedEnumeration="Nepodržano nabrajanje";Strings.OfficeOM.L_InvalidParameters="Funkcija {0} ima nevažeće parametre.";Strings.OfficeOM.L_SetDataParametersConflict="Navedeni parametri su neusaglašeni.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="_Čäĺľ çľóšëĄšýńč őń ţhë ćűŕŕéńť Fîľę bęfőřě řęťŕíěvíňg äńôţhęŕ.džšćđČdžšć_";Strings.OfficeOM.L_DataNotMatchCoercionType="Tip navedenog objekta podataka nije kompatibilan sa trenutnom selekcijom.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Nabrajanje nije podržano u trenutnoj aplikaciji hosta.";Strings.OfficeOM.L_InvalidCoercion="Nevažeći tip promene";Strings.OfficeOM.L_NotSupportedEventType="Navedeni tip događaja {0} nije podržan.";Strings.OfficeOM.L_UnsupportedDataObject="Navedeni tip objekta podataka nije podržan.";Strings.OfficeOM.L_GetDataIsTooLarge="Zahtevani skup podataka je prevelik.";Strings.OfficeOM.L_AppNameNotExist="AppName za {0} ne postoji.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Napravite selekciju.";Strings.OfficeOM.L_MultipleNamedItemFound="Pronađeno je više objekata sa istim imenom.";Strings.OfficeOM.L_InvalidCellsValue="Neki parametri ćelije imaju vrednosti koje nisu dozvoljene. Proverite vrednosti još jednom i probajte ponovo.";Strings.OfficeOM.L_DataNotMatchBindingType="Navedeni objekat podataka nije kompatibilan sa tipom povezivanja.";Strings.OfficeOM.L_InvalidFormatValue="Neki parametri formata imaju vrednosti koje nisu dozvoljene. Proverite vrednosti još jednom i probajte ponovo.";Strings.OfficeOM.L_NotSupportedBindingType="Navedeni tip povezivanja {0} nije podržan.";Strings.OfficeOM.L_InitializeNotReady="Office.js još uvek nije potpuno učitan. Pokušajte ponovo kasnije ili postarajte se da dodate vaš kôd za pokretanje na vaš Office.initialize function.";Strings.OfficeOM.L_FormattingReminder="_Fôřmäţťîňg Ŕęmîńďéřdžš_";Strings.OfficeOM.L_ShuttingDown="Operacija nije uspela zato što podaci na serveru nisu u toku.";Strings.OfficeOM.L_OperationNotSupported="Operacija nije podržana.";Strings.OfficeOM.L_DocumentReadOnly="Zahtevana operacija nije dozvoljena u trenutnom režimu dokumenta.";Strings.OfficeOM.L_NamedItemNotFound="Imenovana stavka ne postoji.";Strings.OfficeOM.L_InvalidApiCallInContext="Nevažeći API poziv u trenutnom kontekstu.";Strings.OfficeOM.L_InvalidGetRows="Navedeni redovi su nevažeći.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="_Ňôţę: Ťhę fóŕmáťťíňg śěţś śęţ bý ą Föřmâťţîňg API ćâľľ íş śüggéşťěđ ťô bě běłów 100.džšćđČdžšćđČd_";Strings.OfficeOM.L_TooManyIncompleteRequests="_Wâîť úńťîł ťhě pŕěvîöůş çăĺľ çômpľěťëş.džšćđČ_";Strings.OfficeOM.L_SetDataIsTooLarge="Navedeni objekat podataka je prevelik.";Strings.OfficeOM.L_DataWriteError="Greška u pisanju podataka";Strings.OfficeOM.L_InvalidBindingOperation="Operacija nevažećeg povezivanja";Strings.OfficeOM.L_APICallFailed="_API Čäłĺ Fáîĺěďdž_";Strings.OfficeOM.L_SpecifiedIdNotExist="Navedeni ID ne postoji.";Strings.OfficeOM.L_FunctionCallFailed="Poziv funkcije {0} nije uspeo, kod greške: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Navedeni objekat podataka ne podudara se sa veličinom trenutne selekcije.";Strings.OfficeOM.L_SaveSettingsError="Greška pri čuvanju postavki";Strings.OfficeOM.L_RequestTokenUnavailable="_Ţhîś API häş běęń ťhŕôťţľęđ ţő şłöw ţhě čâłĺ fřéqµęńčý.džšćđČdžš_";Strings.OfficeOM.L_InvalidSetStartRowColumn="Navedene vrednosti za početni red ili početnu kolonu nisu važeće.";Strings.OfficeOM.L_InvalidFormat="Greška nevažećeg formata";Strings.OfficeOM.L_BindingNotExist="Navedeno povezivanje ne postoji.";Strings.OfficeOM.L_SettingNameNotExist="Navedeno ime postavke ne postoji.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Dodavanje rukovaoca događajem nije uspelo.";Strings.OfficeOM.L_BrowserAPINotSupported="_Ťhîš bŕőwşęř ďôëš ňôť śµppóřť ťhé řéqúěšţëđ API.džšćđČdž_";Strings.OfficeOM.L_InvalidAPICall="Nevažeći API poziv";Strings.OfficeOM.L_EventRegistrationError="Greška pri registraciji događaja";Strings.OfficeOM.L_ElementMissing="Nismo mogli da oblikujemo ćeliju tabele zato što nedostaju neke vrednosti parametara. Proverite parametre još jednom i probajte ponovo.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Nije moguće koristiti parametre za koordinaciju sa tabelom tipa promene kada tabela sadrži objedinjene ćelije.";Strings.OfficeOM.L_NavOutOfBound="Operacija nije uspela zato što je indeks van opsega.";Strings.OfficeOM.L_RedundantCallbackSpecification="Povratni poziv ne može biti naveden i u listi argumenata i u opcionalnom objektu.";Strings.OfficeOM.L_CustomXmlError="Greška u prilagođenim XML.";Strings.OfficeOM.L_SettingsAreStale="Nije bilo moguće sačuvati postavke jer nisu u toku.";Strings.OfficeOM.L_TooManyOptionalFunction="višestruke opcionalne funkcije na listi parametara";Strings.OfficeOM.L_MissingRequiredArguments="nedostaju neki neophodni argumenti";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Nije moguće koristiti parametre za koordinaciju sa tabelom tipa promene kada tabela sadrži objedinjene ćelije.";Strings.OfficeOM.L_HostError="Greška hosta";Strings.OfficeOM.L_OutOfRange="Izvan opsega";Strings.OfficeOM.L_InvalidSelectionForBindingType="Nije moguće kreirati povezivanje sa trenutnom selekcijom i navedenim tipom povezivanja.";Strings.OfficeOM.L_TooManyOptionalObjects="višestruki opcionalni objekti na listi parametara";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Potrebo je da izabrani sadržaj bude u formatu tabele. Oblikujte podatke u vidu tabele i probajte ponovo.";Strings.OfficeOM.L_APINotSupported="_API Ńöť Šüppóřťëđdžš_";Strings.OfficeOM.L_SliceSizeNotSupported="_Ťhë şpęćífíéđ šľîçę şíżé íş ňőť šűppôŕťëđ.džšćđČd_";Strings.OfficeOM.L_EventHandlerRemovalFailed="Uklanjanje rukovaoca događajem nije uspelo.";Strings.OfficeOM.L_BindingToMultipleSelection="Nekontinuirane selekcije nisu podržane.";Strings.OfficeOM.L_DataReadError="Greška u čitanju podataka";Strings.OfficeOM.L_InternalErrorDescription="Došlo je do unutrašnje greške.";Strings.OfficeOM.L_InvalidDataFormat="Format navedenog objekta podataka nije važeći.";Strings.OfficeOM.L_RequestTimeout="_Ţhę ćáĺł ťôôk ťôô ľóňg ţö ęxęćűţé.džšćđ_";Strings.OfficeOM.L_DataStale="Podaci nisu u toku";Strings.OfficeOM.L_GetSelectionNotSupported="Trenutna selekcija nije podržana.";Strings.OfficeOM.L_MemoryLimit="_Męmöřý Łîmîť Ęxçęěďěđdžš_";Strings.OfficeOM.L_CellDataAmountBeyondLimits="_Ńőţě: Ťhę ńűmbëŕ öf čěĺłś îň ă ťąbľë îš šüggëśţěđ ţő bë béĺőw 20,000 čëľĺš.džšćđČdžšćđČ_";Strings.OfficeOM.L_InvalidTableOptionValue="Neki tableOptions parametri imaju vrednosti koje nisu dozvoljene. Proverite vrednosti još jednom i probajte ponovo.";Strings.OfficeOM.L_PermissionDenied="Dozvola je odbijena";Strings.OfficeOM.L_InvalidDataObject="Nevažeći objekat podataka";Strings.OfficeOM.L_UserNotSignedIn="_Ňö ůśęŕ îś šígńęď íňţó Óffíčé.džšćđ_";Strings.OfficeOM.L_SelectionCannotBound="Nije moguće izvršiti povezivanje sa trenutnom selekcijom.";Strings.OfficeOM.L_InvalidColumnsForBinding="Navedene kolone su nevažeće.";Strings.OfficeOM.L_BadSelectorString="Niska koja je prosleđena u birač nije u ispravnom formatu ili nije podržan.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Navedene vrednosti za broj redova ili broj kolona nisu važeće.";Strings.OfficeOM.L_OsfControlTypeNotSupported="OsfControl tip nije podržan.";Strings.OfficeOM.L_InvalidValue="Nevažeća vrednost";Strings.OfficeOM.L_DataNotMatchSelection="Navedeni objekat podataka nije kompatibilan sa oblikom ili dimenzijama trenutne selekcije.";Strings.OfficeOM.L_InternalError="Unutrašnja greška";Strings.OfficeOM.L_NotSupported="Funkcija {0} nije podržana.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Nije pronađen navedeni čvor.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Navedeni tip promene nije kompatibilan sa ovim tipom povezivanja.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="_A ńěťwóŕk pŕőbłëm häš přěvëńţëđ řéţřîěväľ őf ťhé fîĺě.džšćđČdžš_";Strings.OfficeOM.L_TooManyArguments="previše argumenata";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operacija nije podržana na ovom tipu povezivanja.";Strings.OfficeOM.L_InValidOptionalArgument="nevažeći opcionalni argument";Strings.OfficeOM.L_FileTypeNotSupported="Navedeni tip datoteke nije podržan.";Strings.OfficeOM.L_GetDataParametersConflict="Navedeni parametri su neusaglašeni.";Strings.OfficeOM.L_CallbackNotAFunction="Povratni poziv mora biti funkcija tipa, bila je tipa {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/outlook_strings.debug.js new file mode 100644 index 000000000..df9f47f90 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Nije moguće izbrisati prilog zato što nije moguće naći prilog sa indeksom priloga."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Zahtev premašuje ograničenje veličine od 1 MB. Izmenite EWS zahtev."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Puna dozvola je potrebna za pozivanje ovog metoda: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Greška u prilogu"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Datum završetka je pre datuma početka."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Neka od datih imena za prikaz su predugačka."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Ukupan broj primalaca u polju ne sme da premaši {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "HTML čišćenje nije uspelo."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Greška u pisanju podataka"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Puna dozvola je potrebna za pristup zaštićenim članovima aplikacije JavaScript API za Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Nije moguće dodati priloge zato što poruka već ima maksimalan broj priloga"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Interna greška protokola: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Korisnik je uklonio prilog pre nego što je otpremanje dovršeno."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Nije moguće pronaći pomak za ovu vremensku oznaku."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Nije moguće dodati prilog zato što je prevelik."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Vreme završetka ne može biti pre vremena početka."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Dati parametri ne odgovaraju očekivanom formatu."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Nije moguće dodati prilog stavci."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Nisu dati važeći primaoci."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ID priloga je nevažeći."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Nije moguće dodati priloge dok se pun odgovor preuzima sa servera."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Neke od datih e-adresa su predugačke."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Putanja priloga je nevažeća."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Nije moguće izbrisati prilog iz stavke."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Došlo je do interne greške u formatiranju."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Unos se ne razrešava na važeći datum."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Korisnik je promenio poziciju kursora dok je trajalo umetanje podataka." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/outlook_strings.js new file mode 100644 index 000000000..b52631dd4 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sr-latn-cs/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Nije moguće izbrisati prilog zato što nije moguće naći prilog sa indeksom priloga.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Zahtev premašuje ograničenje veličine od 1 MB. Izmenite EWS zahtev.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Puna dozvola je potrebna za pozivanje ovog metoda: '{0}'.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Greška u prilogu";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Datum završetka je pre datuma početka.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Neka od datih imena za prikaz su predugačka.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Ukupan broj primalaca u polju ne sme da premaši {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="HTML čišćenje nije uspelo.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Greška u pisanju podataka";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Puna dozvola je potrebna za pristup zaštićenim članovima aplikacije JavaScript API za Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Nije moguće dodati priloge zato što poruka već ima maksimalan broj priloga";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Interna greška protokola: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Korisnik je uklonio prilog pre nego što je otpremanje dovršeno.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Nije moguće pronaći pomak za ovu vremensku oznaku.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Nije moguće dodati prilog zato što je prevelik.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Vreme završetka ne može biti pre vremena početka.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Dati parametri ne odgovaraju očekivanom formatu.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Nije moguće dodati prilog stavci.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Nisu dati važeći primaoci.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ID priloga je nevažeći.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Nije moguće dodati priloge dok se pun odgovor preuzima sa servera.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Neke od datih e-adresa su predugačke.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Putanja priloga je nevažeća.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Nije moguće izbrisati prilog iz stavke.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Došlo je do interne greške u formatiranju.";_u.ExtensibilityStrings.l_InvalidDate_Text="Unos se ne razrešava na važeći datum.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Korisnik je promenio poziciju kursora dok je trajalo umetanje podataka." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/office_strings.debug.js new file mode 100644 index 000000000..b6d798c23 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Den angivna bindningstypen är inte kompatibel med det angivna namngivna objektet."; +Strings.OfficeOM.L_EventHandlerNotExist = "Den angivna händelsehanteraren kan inte användas för den här bindningen."; +Strings.OfficeOM.L_UnknownBindingType = "Bindningstypen kan inte användas."; +Strings.OfficeOM.L_InvalidNode = "Ogiltig nod"; +Strings.OfficeOM.L_NotImplemented = "Funktionen {0} är inte implementerad."; +Strings.OfficeOM.L_NoCapability = "Du har inte tillräcklig behörighet för den här åtgärden."; +Strings.OfficeOM.L_SettingsCannotSave = "Inställningarna kunde inte sparas."; +Strings.OfficeOM.L_DataWriteReminder = "Påminnelse om dataskrivning"; +Strings.OfficeOM.L_InvalidBinding = "Ogiltig bindning"; +Strings.OfficeOM.L_InvalidSetColumns = "De angivna kolumnerna är ogiltiga."; +Strings.OfficeOM.L_BindingCreationError = "Fel inträffade när bindningen skapades"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Värdet ligger utanför det tillåtna intervallet."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Den aktuella markeringen är inte kompatibel med den angivna konverteringstypen."; +Strings.OfficeOM.L_InvalidBindingError = "Fel med ogiltig bindning"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "De angivna värdena för startRow eller startColumn är ogiltiga."; +Strings.OfficeOM.L_InvalidSetRows = "De angivna raderna är ogiltiga."; +Strings.OfficeOM.L_NetworkProblem = "Nätverksproblem"; +Strings.OfficeOM.L_CannotWriteToSelection = "Det går inte att skriva till den aktuella markeringen."; +Strings.OfficeOM.L_MissingParameter = "Parameter saknas"; +Strings.OfficeOM.L_IndexOutOfRange = "Index är utanför intervallet."; +Strings.OfficeOM.L_SettingsStaleError = "Fel med inaktuella inställningar"; +Strings.OfficeOM.L_CannotNavigateTo = "Objektet finns på en plats där navigering inte stöds."; +Strings.OfficeOM.L_ReadSettingsError = "Fel när inställningar lästes"; +Strings.OfficeOM.L_InvalidGetColumns = "De angivna kolumnerna är ogiltiga."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Den angivna konverteringstypen kan inte användas."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Programmet {0} finns inte. Microsoft.Office.WebExtension.initialize(reason) har inte anropats."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Den angivna åtgärden misslyckades eftersom det angivna dataobjektet skriver över eller flyttar data."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Värdet för radindex ligger utanför det tillåtna intervallet. Använd ett värde (0 eller högre) som är mindre än antalet rader."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Den angivna raden är tom."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Värdet för kolumnindex ligger utanför det tillåtna intervallet. Använd ett värde (0 eller högre) som är mindre än antalet kolumner."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Uppräkning stöds inte"; +Strings.OfficeOM.L_InvalidParameters = "Funktionen {0} har ogiltiga parametrar."; +Strings.OfficeOM.L_SetDataParametersConflict = "De angivna parametrarna är i konflikt."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Anropa closeAsync på den aktuella filen innan du hämtar en annan."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Det angivna dataobjektets typ är inte kompatibel med den aktuella markeringen."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Den här uppräkningen stöds inte i det aktuella värdprogrammet."; +Strings.OfficeOM.L_InvalidCoercion = "Ogiltig typkonvertering"; +Strings.OfficeOM.L_NotSupportedEventType = "Den angivna händelsetypen {0} kan inte användas."; +Strings.OfficeOM.L_UnsupportedDataObject = "Den angivna dataobjekttypen kan inte användas."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Den begärda datauppsättningen är för stor."; +Strings.OfficeOM.L_AppNameNotExist = "AppName för {0} finns inte."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Gör ett val."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Det finns flera objekt med samma namn."; +Strings.OfficeOM.L_InvalidCellsValue = "En eller flera av cellens parametrar har värden som inte är tillåtna. Kontrollera värdena och försök igen."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Det angivna dataobjektet är inte kompatibelt med bindningstypen."; +Strings.OfficeOM.L_InvalidFormatValue = "En eller flera av formatparametrarna har värden som inte är tillåtna. Kontrollera värdena och försök igen."; +Strings.OfficeOM.L_NotSupportedBindingType = "Den angivna bindningstypen {0} kan inte användas."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js har inte lästs in helt ännu. Försök igen senare eller lägg till din initieringskod för funktionen Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Formateringspåminnelse"; +Strings.OfficeOM.L_ShuttingDown = "Åtgärden misslyckades eftersom data är inaktuella på servern."; +Strings.OfficeOM.L_OperationNotSupported = "Åtgärden stöds inte."; +Strings.OfficeOM.L_DocumentReadOnly = "Den begärda åtgärden tillåts inte för det aktuella dokumentläget."; +Strings.OfficeOM.L_NamedItemNotFound = "Det namngivna objektet finns inte."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Ogiltigt API-anrop i den aktuella kontexten."; +Strings.OfficeOM.L_InvalidGetRows = "De angivna raderna är ogiltiga."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Obs! De formateringsuppsättningar som anges av ett anrop av formaterings-API:t bör vara under 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Vänta tills det föregående samtalet har avslutats."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Det angivna dataobjektet är för stort."; +Strings.OfficeOM.L_DataWriteError = "Dataskrivningsfel"; +Strings.OfficeOM.L_InvalidBindingOperation = "Ogiltig åtgärd för bindning"; +Strings.OfficeOM.L_APICallFailed = "API-anropet misslyckades"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Det angivna ID:t finns inte."; +Strings.OfficeOM.L_FunctionCallFailed = "Funktionsanropet {0} misslyckades, felkod: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Det angivna dataobjektet matchar inte storleken på den aktuella markeringen."; +Strings.OfficeOM.L_SaveSettingsError = "Fel när inställningar sparades"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Den här API:n har begränsats för att sänka samtalsfrekvensen."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "De angivna värdena för startRow eller startColumn är ogiltiga."; +Strings.OfficeOM.L_InvalidFormat = "Ogiltigt formatfel"; +Strings.OfficeOM.L_BindingNotExist = "Den angivna bindningen finns inte."; +Strings.OfficeOM.L_SettingNameNotExist = "Det angivna inställningsnamnet finns inte."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Det gick inte att lägga till händelsehanteraren."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Den begärda API:n stöds inte i den här webbläsaren."; +Strings.OfficeOM.L_InvalidAPICall = "Ogiltigt API-anrop"; +Strings.OfficeOM.L_EventRegistrationError = "Fel vid händelseregistrering"; +Strings.OfficeOM.L_ElementMissing = "Det gick inte att formatera tabellcellen eftersom vissa parametrar saknas. Kontrollera parametrarna och försök igen."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Koordinatparametrar kan inte användas med konverteringstypen Tabell när tabellen innehåller sammanfogade celler."; +Strings.OfficeOM.L_NavOutOfBound = "Åtgärden misslyckades eftersom indexet ligger utanför intervallet."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Motringning kan inte anges i både argumentlistan och valfria objekt."; +Strings.OfficeOM.L_CustomXmlError = "Anpassat XML-fel."; +Strings.OfficeOM.L_SettingsAreStale = "Det gick inte att spara inställningarna eftersom de är inaktuella."; +Strings.OfficeOM.L_TooManyOptionalFunction = "flera valfria funktioner i parameterlistan"; +Strings.OfficeOM.L_MissingRequiredArguments = "saknar vissa obligatoriska argument"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Koordinatparametrar kan inte användas med konverteringstypen Tabell när tabellen innehåller sammanfogade celler."; +Strings.OfficeOM.L_HostError = "Värdfel"; +Strings.OfficeOM.L_OutOfRange = "Utanför intervallet"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "En bindning kan inte skapas med den aktuella markeringen och den angivna bindningstypen."; +Strings.OfficeOM.L_TooManyOptionalObjects = "flera valfria objekt i parameterlistan"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Valt innehåll måste vara i tabellformat. Formatera data som en tabell och försök igen."; +Strings.OfficeOM.L_APINotSupported = "API:n stöds inte"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Den angivna segmentstorleken stöds inte."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Det gick inte att ta bort händelsehanteraren."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Icke sammanhängande markeringar kan inte användas."; +Strings.OfficeOM.L_DataReadError = "Dataläsningsfel"; +Strings.OfficeOM.L_InternalErrorDescription = "Ett internt fel har uppstått."; +Strings.OfficeOM.L_InvalidDataFormat = "Det angivna dataobjektets format är ogiltigt."; +Strings.OfficeOM.L_RequestTimeout = "Det tog för lång tid att köra samtalet."; +Strings.OfficeOM.L_DataStale = "Data är inte aktuella"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Den aktuella markeringen stöds inte."; +Strings.OfficeOM.L_MemoryLimit = "Minnesbegränsningen överskreds"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Obs! Det bör inte finnas fler än 20 000 celler i en tabell."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Ett eller flera av tabellAlternativens parameterar har värden som inte är tillåtna. Kontrollera värdena och försök igen."; +Strings.OfficeOM.L_PermissionDenied = "Åtkomst nekad"; +Strings.OfficeOM.L_InvalidDataObject = "Ogiltigt dataobjekt"; +Strings.OfficeOM.L_UserNotSignedIn = "Ingen användare är inloggad i Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Det går inte att binda till den aktuella markeringen."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "De angivna kolumnerna är ogiltiga."; +Strings.OfficeOM.L_BadSelectorString = "Strängen som skickades in i väljaren är felaktigt formaterad eller stöds inte."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "De angivna värdena för rowCount eller columnCount är ogiltiga."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "OsfControl-typen stöds inte."; +Strings.OfficeOM.L_InvalidValue = "Ogiltigt värde"; +Strings.OfficeOM.L_DataNotMatchSelection = "Det angivna dataobjektet är inte kompatibelt med den aktuella markeringens form och mått."; +Strings.OfficeOM.L_InternalError = "Internt fel"; +Strings.OfficeOM.L_NotSupported = "Funktionen {0} stöds inte."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Den angivna noden hittades inte."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Den angivna konverteringstypen är inte kompatibel med den här bindningstypen."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Ett nätverksproblem förhindrade hämtningen av filen."; +Strings.OfficeOM.L_TooManyArguments = "för många argument"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Åtgärden stöds inte för den här bindningstypen."; +Strings.OfficeOM.L_InValidOptionalArgument = "ogiltigt argument som tillval"; +Strings.OfficeOM.L_FileTypeNotSupported = "Den angivna filtypen stöds inte."; +Strings.OfficeOM.L_GetDataParametersConflict = "De angivna parametrarna är i konflikt."; +Strings.OfficeOM.L_CallbackNotAFunction = "Motringning måste vara av typen funktion, men var av typen {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/office_strings.js new file mode 100644 index 000000000..4fdbea275 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Den angivna bindningstypen är inte kompatibel med det angivna namngivna objektet.";Strings.OfficeOM.L_EventHandlerNotExist="Den angivna händelsehanteraren kan inte användas för den här bindningen.";Strings.OfficeOM.L_UnknownBindingType="Bindningstypen kan inte användas.";Strings.OfficeOM.L_InvalidNode="Ogiltig nod";Strings.OfficeOM.L_NotImplemented="Funktionen {0} är inte implementerad.";Strings.OfficeOM.L_NoCapability="Du har inte tillräcklig behörighet för den här åtgärden.";Strings.OfficeOM.L_SettingsCannotSave="Inställningarna kunde inte sparas.";Strings.OfficeOM.L_DataWriteReminder="Påminnelse om dataskrivning";Strings.OfficeOM.L_InvalidBinding="Ogiltig bindning";Strings.OfficeOM.L_InvalidSetColumns="De angivna kolumnerna är ogiltiga.";Strings.OfficeOM.L_BindingCreationError="Fel inträffade när bindningen skapades";Strings.OfficeOM.L_FormatValueOutOfRange="Värdet ligger utanför det tillåtna intervallet.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Den aktuella markeringen är inte kompatibel med den angivna konverteringstypen.";Strings.OfficeOM.L_InvalidBindingError="Fel med ogiltig bindning";Strings.OfficeOM.L_InvalidGetStartRowColumn="De angivna värdena för startRow eller startColumn är ogiltiga.";Strings.OfficeOM.L_InvalidSetRows="De angivna raderna är ogiltiga.";Strings.OfficeOM.L_NetworkProblem="Nätverksproblem";Strings.OfficeOM.L_CannotWriteToSelection="Det går inte att skriva till den aktuella markeringen.";Strings.OfficeOM.L_MissingParameter="Parameter saknas";Strings.OfficeOM.L_IndexOutOfRange="Index är utanför intervallet.";Strings.OfficeOM.L_SettingsStaleError="Fel med inaktuella inställningar";Strings.OfficeOM.L_CannotNavigateTo="Objektet finns på en plats där navigering inte stöds.";Strings.OfficeOM.L_ReadSettingsError="Fel när inställningar lästes";Strings.OfficeOM.L_InvalidGetColumns="De angivna kolumnerna är ogiltiga.";Strings.OfficeOM.L_CoercionTypeNotSupported="Den angivna konverteringstypen kan inte användas.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Programmet {0} finns inte. Microsoft.Office.WebExtension.initialize(reason) har inte anropats.";Strings.OfficeOM.L_OverwriteWorksheetData="Den angivna åtgärden misslyckades eftersom det angivna dataobjektet skriver över eller flyttar data.";Strings.OfficeOM.L_RowIndexOutOfRange="Värdet för radindex ligger utanför det tillåtna intervallet. Använd ett värde (0 eller högre) som är mindre än antalet rader.";Strings.OfficeOM.L_InvalidReadForBlankRow="Den angivna raden är tom.";Strings.OfficeOM.L_ColIndexOutOfRange="Värdet för kolumnindex ligger utanför det tillåtna intervallet. Använd ett värde (0 eller högre) som är mindre än antalet kolumner.";Strings.OfficeOM.L_UnsupportedEnumeration="Uppräkning stöds inte";Strings.OfficeOM.L_InvalidParameters="Funktionen {0} har ogiltiga parametrar.";Strings.OfficeOM.L_SetDataParametersConflict="De angivna parametrarna är i konflikt.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Anropa closeAsync på den aktuella filen innan du hämtar en annan.";Strings.OfficeOM.L_DataNotMatchCoercionType="Det angivna dataobjektets typ är inte kompatibel med den aktuella markeringen.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Den här uppräkningen stöds inte i det aktuella värdprogrammet.";Strings.OfficeOM.L_InvalidCoercion="Ogiltig typkonvertering";Strings.OfficeOM.L_NotSupportedEventType="Den angivna händelsetypen {0} kan inte användas.";Strings.OfficeOM.L_UnsupportedDataObject="Den angivna dataobjekttypen kan inte användas.";Strings.OfficeOM.L_GetDataIsTooLarge="Den begärda datauppsättningen är för stor.";Strings.OfficeOM.L_AppNameNotExist="AppName för {0} finns inte.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Gör ett val.";Strings.OfficeOM.L_MultipleNamedItemFound="Det finns flera objekt med samma namn.";Strings.OfficeOM.L_InvalidCellsValue="En eller flera av cellens parametrar har värden som inte är tillåtna. Kontrollera värdena och försök igen.";Strings.OfficeOM.L_DataNotMatchBindingType="Det angivna dataobjektet är inte kompatibelt med bindningstypen.";Strings.OfficeOM.L_InvalidFormatValue="En eller flera av formatparametrarna har värden som inte är tillåtna. Kontrollera värdena och försök igen.";Strings.OfficeOM.L_NotSupportedBindingType="Den angivna bindningstypen {0} kan inte användas.";Strings.OfficeOM.L_InitializeNotReady="Office.js har inte lästs in helt ännu. Försök igen senare eller lägg till din initieringskod för funktionen Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Formateringspåminnelse";Strings.OfficeOM.L_ShuttingDown="Åtgärden misslyckades eftersom data är inaktuella på servern.";Strings.OfficeOM.L_OperationNotSupported="Åtgärden stöds inte.";Strings.OfficeOM.L_DocumentReadOnly="Den begärda åtgärden tillåts inte för det aktuella dokumentläget.";Strings.OfficeOM.L_NamedItemNotFound="Det namngivna objektet finns inte.";Strings.OfficeOM.L_InvalidApiCallInContext="Ogiltigt API-anrop i den aktuella kontexten.";Strings.OfficeOM.L_InvalidGetRows="De angivna raderna är ogiltiga.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Obs! De formateringsuppsättningar som anges av ett anrop av formaterings-API:t bör vara under 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Vänta tills det föregående samtalet har avslutats.";Strings.OfficeOM.L_SetDataIsTooLarge="Det angivna dataobjektet är för stort.";Strings.OfficeOM.L_DataWriteError="Dataskrivningsfel";Strings.OfficeOM.L_InvalidBindingOperation="Ogiltig åtgärd för bindning";Strings.OfficeOM.L_APICallFailed="API-anropet misslyckades";Strings.OfficeOM.L_SpecifiedIdNotExist="Det angivna ID:t finns inte.";Strings.OfficeOM.L_FunctionCallFailed="Funktionsanropet {0} misslyckades, felkod: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Det angivna dataobjektet matchar inte storleken på den aktuella markeringen.";Strings.OfficeOM.L_SaveSettingsError="Fel när inställningar sparades";Strings.OfficeOM.L_RequestTokenUnavailable="Den här API:n har begränsats för att sänka samtalsfrekvensen.";Strings.OfficeOM.L_InvalidSetStartRowColumn="De angivna värdena för startRow eller startColumn är ogiltiga.";Strings.OfficeOM.L_InvalidFormat="Ogiltigt formatfel";Strings.OfficeOM.L_BindingNotExist="Den angivna bindningen finns inte.";Strings.OfficeOM.L_SettingNameNotExist="Det angivna inställningsnamnet finns inte.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Det gick inte att lägga till händelsehanteraren.";Strings.OfficeOM.L_BrowserAPINotSupported="Den begärda API:n stöds inte i den här webbläsaren.";Strings.OfficeOM.L_InvalidAPICall="Ogiltigt API-anrop";Strings.OfficeOM.L_EventRegistrationError="Fel vid händelseregistrering";Strings.OfficeOM.L_ElementMissing="Det gick inte att formatera tabellcellen eftersom vissa parametrar saknas. Kontrollera parametrarna och försök igen.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Koordinatparametrar kan inte användas med konverteringstypen Tabell när tabellen innehåller sammanfogade celler.";Strings.OfficeOM.L_NavOutOfBound="Åtgärden misslyckades eftersom indexet ligger utanför intervallet.";Strings.OfficeOM.L_RedundantCallbackSpecification="Motringning kan inte anges i både argumentlistan och valfria objekt.";Strings.OfficeOM.L_CustomXmlError="Anpassat XML-fel.";Strings.OfficeOM.L_SettingsAreStale="Det gick inte att spara inställningarna eftersom de är inaktuella.";Strings.OfficeOM.L_TooManyOptionalFunction="flera valfria funktioner i parameterlistan";Strings.OfficeOM.L_MissingRequiredArguments="saknar vissa obligatoriska argument";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Koordinatparametrar kan inte användas med konverteringstypen Tabell när tabellen innehåller sammanfogade celler.";Strings.OfficeOM.L_HostError="Värdfel";Strings.OfficeOM.L_OutOfRange="Utanför intervallet";Strings.OfficeOM.L_InvalidSelectionForBindingType="En bindning kan inte skapas med den aktuella markeringen och den angivna bindningstypen.";Strings.OfficeOM.L_TooManyOptionalObjects="flera valfria objekt i parameterlistan";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Valt innehåll måste vara i tabellformat. Formatera data som en tabell och försök igen.";Strings.OfficeOM.L_APINotSupported="API:n stöds inte";Strings.OfficeOM.L_SliceSizeNotSupported="Den angivna segmentstorleken stöds inte.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Det gick inte att ta bort händelsehanteraren.";Strings.OfficeOM.L_BindingToMultipleSelection="Icke sammanhängande markeringar kan inte användas.";Strings.OfficeOM.L_DataReadError="Dataläsningsfel";Strings.OfficeOM.L_InternalErrorDescription="Ett internt fel har uppstått.";Strings.OfficeOM.L_InvalidDataFormat="Det angivna dataobjektets format är ogiltigt.";Strings.OfficeOM.L_RequestTimeout="Det tog för lång tid att köra samtalet.";Strings.OfficeOM.L_DataStale="Data är inte aktuella";Strings.OfficeOM.L_GetSelectionNotSupported="Den aktuella markeringen stöds inte.";Strings.OfficeOM.L_MemoryLimit="Minnesbegränsningen överskreds";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Obs! Det bör inte finnas fler än 20 000 celler i en tabell.";Strings.OfficeOM.L_InvalidTableOptionValue="Ett eller flera av tabellAlternativens parameterar har värden som inte är tillåtna. Kontrollera värdena och försök igen.";Strings.OfficeOM.L_PermissionDenied="Åtkomst nekad";Strings.OfficeOM.L_InvalidDataObject="Ogiltigt dataobjekt";Strings.OfficeOM.L_UserNotSignedIn="Ingen användare är inloggad i Office.";Strings.OfficeOM.L_SelectionCannotBound="Det går inte att binda till den aktuella markeringen.";Strings.OfficeOM.L_InvalidColumnsForBinding="De angivna kolumnerna är ogiltiga.";Strings.OfficeOM.L_BadSelectorString="Strängen som skickades in i väljaren är felaktigt formaterad eller stöds inte.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="De angivna värdena för rowCount eller columnCount är ogiltiga.";Strings.OfficeOM.L_OsfControlTypeNotSupported="OsfControl-typen stöds inte.";Strings.OfficeOM.L_InvalidValue="Ogiltigt värde";Strings.OfficeOM.L_DataNotMatchSelection="Det angivna dataobjektet är inte kompatibelt med den aktuella markeringens form och mått.";Strings.OfficeOM.L_InternalError="Internt fel";Strings.OfficeOM.L_NotSupported="Funktionen {0} stöds inte.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Den angivna noden hittades inte.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Den angivna konverteringstypen är inte kompatibel med den här bindningstypen.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Ett nätverksproblem förhindrade hämtningen av filen.";Strings.OfficeOM.L_TooManyArguments="för många argument";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Åtgärden stöds inte för den här bindningstypen.";Strings.OfficeOM.L_InValidOptionalArgument="ogiltigt argument som tillval";Strings.OfficeOM.L_FileTypeNotSupported="Den angivna filtypen stöds inte.";Strings.OfficeOM.L_GetDataParametersConflict="De angivna parametrarna är i konflikt.";Strings.OfficeOM.L_CallbackNotAFunction="Motringning måste vara av typen funktion, men var av typen {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/outlook_strings.debug.js new file mode 100644 index 000000000..822e1a8db --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Det går inte att ta bort den bifogade filen, eftersom det inte går att hitta någon bifogad fil med det indexet."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Storleken på begäran överskrider gränsen på 1 MB. Ändra din EWS-begäran."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Förhöjd behörighet krävs för att anropa metoden: {0}."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Fel i bifogad fil"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Slutdatumet infaller före startdatumet."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Ett eller flera av de angivna visningsnamnen är för långa."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Det totala antalet mottagare i fältet får inte överstiga {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "HTML-rensningen misslyckades."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Dataskrivningsfel"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Förhöjd behörighet krävs för åtkomst till skyddade medlemmar av JavaScript API:n för Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Det går inte att bifoga filer, eftersom meddelandet redan har högsta möjliga antal bifogade filer"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Internt protokollfel: {0}."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Användaren tog bort den bifogade filen innan uppladdningen slutfördes."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Ingen förskjutning hittades för den här tidsstämpeln."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Det går inte att bifoga filen eftersom den är för stor."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Sluttiden kan inte vara före starttiden."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "De givna parametrarna matchar inte förväntat format."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Det går inte att bifoga filen till objektet."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Inga giltiga mottagare angavs."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ID:t för bifogad fil är ogiltigt."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Det går inte att bifoga filer under tiden som hela svaret eller vidarebefordran hämtas från servern."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "En eller flera av de angivna e-postadresserna är för långa."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Sökvägen för bifogad fil är ogiltig."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Det går inte att ta bort den bifogade filen från objektet."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Ett internt formatfel uppstod."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Indata omvandlas inte till ett giltigt datum."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Användaren ändrade markörens läge under tiden som data infogades." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/outlook_strings.js new file mode 100644 index 000000000..d42915130 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/sv-se/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Det går inte att ta bort den bifogade filen, eftersom det inte går att hitta någon bifogad fil med det indexet.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Storleken på begäran överskrider gränsen på 1 MB. Ändra din EWS-begäran.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Förhöjd behörighet krävs för att anropa metoden: {0}.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Fel i bifogad fil";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Slutdatumet infaller före startdatumet.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Ett eller flera av de angivna visningsnamnen är för långa.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Det totala antalet mottagare i fältet får inte överstiga {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="HTML-rensningen misslyckades.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Dataskrivningsfel";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Förhöjd behörighet krävs för åtkomst till skyddade medlemmar av JavaScript API:n för Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Det går inte att bifoga filer, eftersom meddelandet redan har högsta möjliga antal bifogade filer";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Internt protokollfel: {0}.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Användaren tog bort den bifogade filen innan uppladdningen slutfördes.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Ingen förskjutning hittades för den här tidsstämpeln.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Det går inte att bifoga filen eftersom den är för stor.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Sluttiden kan inte vara före starttiden.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="De givna parametrarna matchar inte förväntat format.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Det går inte att bifoga filen till objektet.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Inga giltiga mottagare angavs.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ID:t för bifogad fil är ogiltigt.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Det går inte att bifoga filer under tiden som hela svaret eller vidarebefordran hämtas från servern.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="En eller flera av de angivna e-postadresserna är för långa.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Sökvägen för bifogad fil är ogiltig.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Det går inte att ta bort den bifogade filen från objektet.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Ett internt formatfel uppstod.";_u.ExtensibilityStrings.l_InvalidDate_Text="Indata omvandlas inte till ett giltigt datum.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Användaren ändrade markörens läge under tiden som data infogades." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/office_strings.debug.js new file mode 100644 index 000000000..10a5d5aef --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "ชนิดการผูกที่ระบุเข้ากันไม่ได้กับรายการที่มีชื่อที่ให้มา"; +Strings.OfficeOM.L_EventHandlerNotExist = "ไม่พบตัวจัดการเหตุการณ์ที่ระบุสำหรับการผูกนี้"; +Strings.OfficeOM.L_UnknownBindingType = "ไม่สนับสนุนชนิดการผูกนี้"; +Strings.OfficeOM.L_InvalidNode = "โหนดไม่ถูกต้อง"; +Strings.OfficeOM.L_NotImplemented = "ฟังก์ชัน {0} ยังไม่ถูกนำมาใช้งาน"; +Strings.OfficeOM.L_NoCapability = "คุณไม่มีสิทธิ์เพียงพอสำหรับการกระทำนี้"; +Strings.OfficeOM.L_SettingsCannotSave = "ไม่สามารถบันทึกการตั้งค่าได้"; +Strings.OfficeOM.L_DataWriteReminder = "ตัวเตือนการเขียนข้อมูล"; +Strings.OfficeOM.L_InvalidBinding = "การผูกไม่ถูกต้อง"; +Strings.OfficeOM.L_InvalidSetColumns = "คอลัมน์ที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_BindingCreationError = "การสร้างการผูกผิดพลาด"; +Strings.OfficeOM.L_FormatValueOutOfRange = "ค่าอยู่นอกช่วงที่อนุญาต "; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "ส่วนที่เลือกปัจจุบันนี้เข้ากันไม่ได้กับชนิดการบังคับใช้ที่ระบุ"; +Strings.OfficeOM.L_InvalidBindingError = "ข้อผิดพลาดของการผูกที่ไม่ถูกต้อง"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "ค่าของ startRow หรือ startColumn ที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_InvalidSetRows = "แถวที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_NetworkProblem = "ปัญหาเครือข่าย"; +Strings.OfficeOM.L_CannotWriteToSelection = "ไม่สามารถเขียนไปยังส่วนที่เลือกในปัจจุบันได้"; +Strings.OfficeOM.L_MissingParameter = "พารามิเตอร์สูญหาย"; +Strings.OfficeOM.L_IndexOutOfRange = "ดัชนีไม่อยู่ในช่วง"; +Strings.OfficeOM.L_SettingsStaleError = "การตั้งค่าเดิมผิดพลาด"; +Strings.OfficeOM.L_CannotNavigateTo = "วัตถุอยู่ในตำแหน่งที่ไม่สนับสนุนการนำทาง"; +Strings.OfficeOM.L_ReadSettingsError = "การตั้งค่าการอ่านผิดพลาด"; +Strings.OfficeOM.L_InvalidGetColumns = "คอลัมน์ที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_CoercionTypeNotSupported = "ชนิดการบังคับใช้ที่ระบุไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "ไม่มีแอปพลิเคชัน {0} Microsoft.Office.WebExtension.initialize(reason) ไม่ถูกเรียก"; +Strings.OfficeOM.L_OverwriteWorksheetData = "การดำเนินการของชุดล้มเหลว เนื่องจากวัตถุข้อมูลที่ให้มาจะเขียนทับหรือเลื่อนข้อมูล"; +Strings.OfficeOM.L_RowIndexOutOfRange = "ค่าดัชนีแถวอยู่นอกช่วงที่อนุญาต ใช้ค่า (0 หรือมากกว่า) ที่มีค่าน้อยกว่าจำนวนแถว"; +Strings.OfficeOM.L_InvalidReadForBlankRow = "แถวที่ระบุว่างเปล่า"; +Strings.OfficeOM.L_ColIndexOutOfRange = "ค่าดัชนีคอลัมน์อยู่นอกช่วงที่อนุญาต ใช้ค่า (0 หรือมากกว่า) ที่มีค่าน้อยกว่าจำนวนคอลัมน์"; +Strings.OfficeOM.L_UnsupportedEnumeration = "การแจงนับที่ไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_InvalidParameters = "ฟังก์ชัน {0} มีพารามิเตอร์ที่ไม่ถูกต้อง"; +Strings.OfficeOM.L_SetDataParametersConflict = "พารามิเตอร์ที่ระบุขัดแย้งกัน"; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "เรียก closeAsync บนไฟล์ปัจจุบันก่อนที่จะเรียกใช้ไฟล์อื่น"; +Strings.OfficeOM.L_DataNotMatchCoercionType = "ชนิดวัตถุข้อมูลที่ระบุเข้ากันไม่ได้กับส่วนที่เลือกปัจจุบัน"; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "การแจงนับไม่ได้รับการสนับสนุนในแอปพลิเคชันที่เป็นโฮสต์ในปัจจุบัน"; +Strings.OfficeOM.L_InvalidCoercion = "ชนิดของการบังคับใช้ไม่ถูกต้อง"; +Strings.OfficeOM.L_NotSupportedEventType = "ไม่สนับสนุนชนิดเหตุการณ์ที่ระบุ {0}"; +Strings.OfficeOM.L_UnsupportedDataObject = "ชนิดวัตถุข้อมูลที่ให้มาไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_GetDataIsTooLarge = "ชุดข้อมูลที่ร้องขอมีขนาดใหญ่เกินไป"; +Strings.OfficeOM.L_AppNameNotExist = "ไม่มี AppName สำหรับ {0} อยู่"; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "โปรดเลือก"; +Strings.OfficeOM.L_MultipleNamedItemFound = "พบหลายวัตถุที่มีชื่อเดียวกัน"; +Strings.OfficeOM.L_InvalidCellsValue = "พารามิเตอร์ของเซลล์อย่างน้อยหนึ่งรายการมีค่าที่ไม่ได้รับอนุญาต ตรวจสอบค่าใหม่แล้วลองอีกครั้ง"; +Strings.OfficeOM.L_DataNotMatchBindingType = "วัตถุข้อมูลที่ระบุไม่เข้ากันกับชนิดการผูก"; +Strings.OfficeOM.L_InvalidFormatValue = "พารามิเตอร์ของรูปแบบอย่างน้อยหนึ่งรายการมีค่าที่ไม่ได้รับอนุญาต ตรวจสอบค่าใหม่แล้วลองอีกครั้ง"; +Strings.OfficeOM.L_NotSupportedBindingType = "ไม่สนับสนุนชนิดการผูกที่ระบุ {0}"; +Strings.OfficeOM.L_InitializeNotReady = "ยังไม่ได้โหลด Office.js แบบเต็ม โปรดลองอีกครั้งในภายหลัง หรือตรวจสอบให้แน่ใจว่าได้เพิ่มโค้ดการเตรียมใช้งานของคุณบนฟังก์ชัน Office.initialize "; +Strings.OfficeOM.L_FormattingReminder = "ตัวเตือนการจัดรูปแบบ"; +Strings.OfficeOM.L_ShuttingDown = "การดำเนินการล้มเหลวเพราะข้อมูลไม่เป็นข้อมูลปัจจุบันบนเซิร์ฟเวอร์"; +Strings.OfficeOM.L_OperationNotSupported = "ไม่สนับสนุนการดำเนินการนี้"; +Strings.OfficeOM.L_DocumentReadOnly = "ไม่อนุญาตการดำเนินการที่ร้องขอในโหมดเอกสารปัจจุบัน"; +Strings.OfficeOM.L_NamedItemNotFound = "ไม่มีรายการที่มีชื่ออยู่"; +Strings.OfficeOM.L_InvalidApiCallInContext = "การเรียก API ในบริบทปัจจุบันไม่ถูกต้อง"; +Strings.OfficeOM.L_InvalidGetRows = "แถวที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "หมายเหตุ: ชุดการจัดรูปแบบที่ถูกตั้งค่าโดยการเรียก API การจัดรูปแบบควรจะต่ำกว่า 100"; +Strings.OfficeOM.L_TooManyIncompleteRequests = "รอจนกว่าการเรียกก่อนหน้าจะเสร็จสมบูรณ์"; +Strings.OfficeOM.L_SetDataIsTooLarge = "วัตถุข้อมูลที่ระบุมีขนาดใหญ่เกินไป"; +Strings.OfficeOM.L_DataWriteError = "การเขียนข้อมูลผิดพลาด"; +Strings.OfficeOM.L_InvalidBindingOperation = "การดำเนินการผูกที่ไม่ถูกต้อง"; +Strings.OfficeOM.L_APICallFailed = "การเรียก API ล้มเหลว"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "ไม่มี ID ที่ระบุ"; +Strings.OfficeOM.L_FunctionCallFailed = "การเรียกฟังก์ชัน {0} ล้มเหลว รหัสข้อผิดพลาด: {1}"; +Strings.OfficeOM.L_DataNotMatchBindingSize = "วัตถุข้อมูลที่ให้มามีขนาดไม่ตรงกันกับส่วนที่เลือกปัจจุบัน"; +Strings.OfficeOM.L_SaveSettingsError = "การตั้งค่าการบันทึกผิดพลาด"; +Strings.OfficeOM.L_RequestTokenUnavailable = "API นี้ถูกควบคุมให้ใช้ปริมาณความถี่ในการเรียกช้าลง"; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "ค่าของ startRow หรือ startColumn ที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_InvalidFormat = "ข้อผิดพลาดรูปแบบไม่ถูกต้อง"; +Strings.OfficeOM.L_BindingNotExist = "การรวมที่ระบุไม่มีอยู่"; +Strings.OfficeOM.L_SettingNameNotExist = "ไม่มีชื่อการตั้งค่าที่ระบุ"; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "ไม่สามารถเพิ่มตัวจัดการเหตุการณ์ได้"; +Strings.OfficeOM.L_BrowserAPINotSupported = "เบราว์เซอร์นี้ไม่สนับสนุน API ที่ร้องขอ"; +Strings.OfficeOM.L_InvalidAPICall = "การเรียก API ไม่ถูกต้อง"; +Strings.OfficeOM.L_EventRegistrationError = "การลงทะเบียนเหตุการณ์ผิดพลาด"; +Strings.OfficeOM.L_ElementMissing = "เราไม่สามารถจัดรูปแบบเซลล์ตารางได้ เนื่องจากค่าพารามิเตอร์บางค่าหายไป ตรวจสอบพารามิเตอร์ใหม่แล้วลองอีกครั้ง"; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "ไม่สามารถใช้พารามิเตอร์พิกัดกับชนิดการบังคับใช้ตารางได้ เมื่อตารางนั้นมีเซลล์ที่ถูกผสาน"; +Strings.OfficeOM.L_NavOutOfBound = "การดำเนินการล้มเหลวเนื่องจากดัชนีอยู่นอกช่วง"; +Strings.OfficeOM.L_RedundantCallbackSpecification = "ไม่สามารถระบุการติดต่อกลับทั้งในรายการอาร์กิวเมนต์และในวัตถุทางเลือก"; +Strings.OfficeOM.L_CustomXmlError = "ข้อผิดพลาด XML แบบกำหนดเอง"; +Strings.OfficeOM.L_SettingsAreStale = "ไม่สามารถบันทึกการตั้งค่าได้เพราะไม่เป็นข้อมูลปัจจุบัน"; +Strings.OfficeOM.L_TooManyOptionalFunction = "ฟังก์ชันทางเลือกหลายฟังก์ชันในรายการพารามิเตอร์"; +Strings.OfficeOM.L_MissingRequiredArguments = "อาร์กิวเมนต์ที่จำเป็นบางอย่างหายไป"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "ไม่สามารถใช้พารามิเตอร์พิกัดกับชนิดการบังคับใช้ตารางได้ เมื่อตารางนั้นมีเซลล์ที่ถูกผสาน"; +Strings.OfficeOM.L_HostError = "โฮสต์ผิดพลาด"; +Strings.OfficeOM.L_OutOfRange = "ไม่อยู่ในช่วงที่กำหนด"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "ไม่สามารถสร้างการผูกกับการเลือกปัจจุบันและชนิดการผูกที่ระบุได้"; +Strings.OfficeOM.L_TooManyOptionalObjects = "วัตถุทางเลือกหลายวัตถุในรายการพารามิเตอร์"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "เนื้อหาที่เลือกต้องอยู่ในรูปแบบตาราง จัดรูปแบบข้อมูลเป็นตารางแล้วลองอีกครั้ง"; +Strings.OfficeOM.L_APINotSupported = "API ไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_SliceSizeNotSupported = "ขนาดของชิ้นที่ระบุไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "ไม่สามารถเอาตัวจัดการเหตุการณ์ออกได้"; +Strings.OfficeOM.L_BindingToMultipleSelection = "ไม่สนับสนุนส่วนที่เลือกแบบไม่ติดกัน"; +Strings.OfficeOM.L_DataReadError = "การอ่านข้อมูลผิดพลาด"; +Strings.OfficeOM.L_InternalErrorDescription = "มีข้อผิดพลาดภายในเกิดขึ้น"; +Strings.OfficeOM.L_InvalidDataFormat = "รูปแบบของวัตถุข้อมูลที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_RequestTimeout = "การเรียกใช้เวลานานเกินไปในการดำเนินการ"; +Strings.OfficeOM.L_DataStale = "ข้อมูลไม่เป็นปัจจุบัน"; +Strings.OfficeOM.L_GetSelectionNotSupported = "ส่วนที่เลือกในปัจจุบันไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_MemoryLimit = "เกินขีดจำกัดของหน่วยความจำ"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "หมายเหตุ: จำนวนของเซลล์ในตารางควรจะต่ำกว่า 20,000 เซลล์"; +Strings.OfficeOM.L_InvalidTableOptionValue = "พารามิเตอร์ของตัวเลือกตารางอย่างน้อยหนึ่งรายการมีค่าที่ไม่ได้รับอนุญาต ตรวจสอบค่าใหม่แล้วลองอีกครั้ง"; +Strings.OfficeOM.L_PermissionDenied = "สิทธิ์ถูกปฏิเสธ"; +Strings.OfficeOM.L_InvalidDataObject = "วัตถุข้อมูลไม่ถูกต้อง"; +Strings.OfficeOM.L_UserNotSignedIn = "ไม่มีผู้ใช้ลงชื่อเข้าใช้ Office"; +Strings.OfficeOM.L_SelectionCannotBound = "ไม่สามารถผูกกับส่วนที่เลือกปัจจุบัน"; +Strings.OfficeOM.L_InvalidColumnsForBinding = "คอลัมน์ที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_BadSelectorString = "สตริงที่ส่งผ่านไปยังตัวเลือกได้รับการจัดรูปแบบไม่ถูกต้อง หรือไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "ค่าของ rowCount หรือ columnCount ที่ระบุไม่ถูกต้อง"; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "ไม่สนับสนุนชนิดของ OsfControl"; +Strings.OfficeOM.L_InvalidValue = "ค่าไม่ถูกต้อง"; +Strings.OfficeOM.L_DataNotMatchSelection = "วัตถุข้อมูลที่ให้มาเข้ากันไม่ได้กับรูปร่างหรือมิติของการเลือกปัจจุบัน"; +Strings.OfficeOM.L_InternalError = "ข้อผิดพลาดภายใน"; +Strings.OfficeOM.L_NotSupported = "ไม่สนับสนุนฟังก์ชัน {0}"; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "ไม่พบโหนดที่ระบุ"; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "ชนิดการบังคับใช้ที่ระบุเข้ากันไม่ได้กับชนิดการผูกนี้"; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "ปัญหาเครือข่ายป้องกันไม่ให้เรียกใช้ไฟล์"; +Strings.OfficeOM.L_TooManyArguments = "มีอาร์กิวเมนต์มากเกินไป"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "ชนิดการผูกนี้ไม่สนับสนุนากรดำเนินการนี้"; +Strings.OfficeOM.L_InValidOptionalArgument = "อาร์กิวเมนต์ทางเลือกไม่ถูกต้อง"; +Strings.OfficeOM.L_FileTypeNotSupported = "ชนิดของไฟล์ที่ระบุไม่ได้รับการสนับสนุน"; +Strings.OfficeOM.L_GetDataParametersConflict = "พารามิเตอร์ที่ระบุขัดแย้งกัน"; +Strings.OfficeOM.L_CallbackNotAFunction = "การติดต่อกลับที่ต้องเป็นของฟังก์ชันชนิด กลับเป็นของ {0} ของชนิด" diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/office_strings.js new file mode 100644 index 000000000..2771c9150 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="ชนิดการผูกที่ระบุเข้ากันไม่ได้กับรายการที่มีชื่อที่ให้มา";Strings.OfficeOM.L_EventHandlerNotExist="ไม่พบตัวจัดการเหตุการณ์ที่ระบุสำหรับการผูกนี้";Strings.OfficeOM.L_UnknownBindingType="ไม่สนับสนุนชนิดการผูกนี้";Strings.OfficeOM.L_InvalidNode="โหนดไม่ถูกต้อง";Strings.OfficeOM.L_NotImplemented="ฟังก์ชัน {0} ยังไม่ถูกนำมาใช้งาน";Strings.OfficeOM.L_NoCapability="คุณไม่มีสิทธิ์เพียงพอสำหรับการกระทำนี้";Strings.OfficeOM.L_SettingsCannotSave="ไม่สามารถบันทึกการตั้งค่าได้";Strings.OfficeOM.L_DataWriteReminder="ตัวเตือนการเขียนข้อมูล";Strings.OfficeOM.L_InvalidBinding="การผูกไม่ถูกต้อง";Strings.OfficeOM.L_InvalidSetColumns="คอลัมน์ที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_BindingCreationError="การสร้างการผูกผิดพลาด";Strings.OfficeOM.L_FormatValueOutOfRange="ค่าอยู่นอกช่วงที่อนุญาต ";Strings.OfficeOM.L_SelectionNotSupportCoercionType="ส่วนที่เลือกปัจจุบันนี้เข้ากันไม่ได้กับชนิดการบังคับใช้ที่ระบุ";Strings.OfficeOM.L_InvalidBindingError="ข้อผิดพลาดของการผูกที่ไม่ถูกต้อง";Strings.OfficeOM.L_InvalidGetStartRowColumn="ค่าของ startRow หรือ startColumn ที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_InvalidSetRows="แถวที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_NetworkProblem="ปัญหาเครือข่าย";Strings.OfficeOM.L_CannotWriteToSelection="ไม่สามารถเขียนไปยังส่วนที่เลือกในปัจจุบันได้";Strings.OfficeOM.L_MissingParameter="พารามิเตอร์สูญหาย";Strings.OfficeOM.L_IndexOutOfRange="ดัชนีไม่อยู่ในช่วง";Strings.OfficeOM.L_SettingsStaleError="การตั้งค่าเดิมผิดพลาด";Strings.OfficeOM.L_CannotNavigateTo="วัตถุอยู่ในตำแหน่งที่ไม่สนับสนุนการนำทาง";Strings.OfficeOM.L_ReadSettingsError="การตั้งค่าการอ่านผิดพลาด";Strings.OfficeOM.L_InvalidGetColumns="คอลัมน์ที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_CoercionTypeNotSupported="ชนิดการบังคับใช้ที่ระบุไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="ไม่มีแอปพลิเคชัน {0} Microsoft.Office.WebExtension.initialize(reason) ไม่ถูกเรียก";Strings.OfficeOM.L_OverwriteWorksheetData="การดำเนินการของชุดล้มเหลว เนื่องจากวัตถุข้อมูลที่ให้มาจะเขียนทับหรือเลื่อนข้อมูล";Strings.OfficeOM.L_RowIndexOutOfRange="ค่าดัชนีแถวอยู่นอกช่วงที่อนุญาต ใช้ค่า (0 หรือมากกว่า) ที่มีค่าน้อยกว่าจำนวนแถว";Strings.OfficeOM.L_InvalidReadForBlankRow="แถวที่ระบุว่างเปล่า";Strings.OfficeOM.L_ColIndexOutOfRange="ค่าดัชนีคอลัมน์อยู่นอกช่วงที่อนุญาต ใช้ค่า (0 หรือมากกว่า) ที่มีค่าน้อยกว่าจำนวนคอลัมน์";Strings.OfficeOM.L_UnsupportedEnumeration="การแจงนับที่ไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_InvalidParameters="ฟังก์ชัน {0} มีพารามิเตอร์ที่ไม่ถูกต้อง";Strings.OfficeOM.L_SetDataParametersConflict="พารามิเตอร์ที่ระบุขัดแย้งกัน";Strings.OfficeOM.L_CloseFileBeforeRetrieve="เรียก closeAsync บนไฟล์ปัจจุบันก่อนที่จะเรียกใช้ไฟล์อื่น";Strings.OfficeOM.L_DataNotMatchCoercionType="ชนิดวัตถุข้อมูลที่ระบุเข้ากันไม่ได้กับส่วนที่เลือกปัจจุบัน";Strings.OfficeOM.L_UnsupportedEnumerationMessage="การแจงนับไม่ได้รับการสนับสนุนในแอปพลิเคชันที่เป็นโฮสต์ในปัจจุบัน";Strings.OfficeOM.L_InvalidCoercion="ชนิดของการบังคับใช้ไม่ถูกต้อง";Strings.OfficeOM.L_NotSupportedEventType="ไม่สนับสนุนชนิดเหตุการณ์ที่ระบุ {0}";Strings.OfficeOM.L_UnsupportedDataObject="ชนิดวัตถุข้อมูลที่ให้มาไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_GetDataIsTooLarge="ชุดข้อมูลที่ร้องขอมีขนาดใหญ่เกินไป";Strings.OfficeOM.L_AppNameNotExist="ไม่มี AppName สำหรับ {0} อยู่";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="โปรดเลือก";Strings.OfficeOM.L_MultipleNamedItemFound="พบหลายวัตถุที่มีชื่อเดียวกัน";Strings.OfficeOM.L_InvalidCellsValue="พารามิเตอร์ของเซลล์อย่างน้อยหนึ่งรายการมีค่าที่ไม่ได้รับอนุญาต ตรวจสอบค่าใหม่แล้วลองอีกครั้ง";Strings.OfficeOM.L_DataNotMatchBindingType="วัตถุข้อมูลที่ระบุไม่เข้ากันกับชนิดการผูก";Strings.OfficeOM.L_InvalidFormatValue="พารามิเตอร์ของรูปแบบอย่างน้อยหนึ่งรายการมีค่าที่ไม่ได้รับอนุญาต ตรวจสอบค่าใหม่แล้วลองอีกครั้ง";Strings.OfficeOM.L_NotSupportedBindingType="ไม่สนับสนุนชนิดการผูกที่ระบุ {0}";Strings.OfficeOM.L_InitializeNotReady="ยังไม่ได้โหลด Office.js แบบเต็ม โปรดลองอีกครั้งในภายหลัง หรือตรวจสอบให้แน่ใจว่าได้เพิ่มโค้ดการเตรียมใช้งานของคุณบนฟังก์ชัน Office.initialize ";Strings.OfficeOM.L_FormattingReminder="ตัวเตือนการจัดรูปแบบ";Strings.OfficeOM.L_ShuttingDown="การดำเนินการล้มเหลวเพราะข้อมูลไม่เป็นข้อมูลปัจจุบันบนเซิร์ฟเวอร์";Strings.OfficeOM.L_OperationNotSupported="ไม่สนับสนุนการดำเนินการนี้";Strings.OfficeOM.L_DocumentReadOnly="ไม่อนุญาตการดำเนินการที่ร้องขอในโหมดเอกสารปัจจุบัน";Strings.OfficeOM.L_NamedItemNotFound="ไม่มีรายการที่มีชื่ออยู่";Strings.OfficeOM.L_InvalidApiCallInContext="การเรียก API ในบริบทปัจจุบันไม่ถูกต้อง";Strings.OfficeOM.L_InvalidGetRows="แถวที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="หมายเหตุ: ชุดการจัดรูปแบบที่ถูกตั้งค่าโดยการเรียก API การจัดรูปแบบควรจะต่ำกว่า 100";Strings.OfficeOM.L_TooManyIncompleteRequests="รอจนกว่าการเรียกก่อนหน้าจะเสร็จสมบูรณ์";Strings.OfficeOM.L_SetDataIsTooLarge="วัตถุข้อมูลที่ระบุมีขนาดใหญ่เกินไป";Strings.OfficeOM.L_DataWriteError="การเขียนข้อมูลผิดพลาด";Strings.OfficeOM.L_InvalidBindingOperation="การดำเนินการผูกที่ไม่ถูกต้อง";Strings.OfficeOM.L_APICallFailed="การเรียก API ล้มเหลว";Strings.OfficeOM.L_SpecifiedIdNotExist="ไม่มี ID ที่ระบุ";Strings.OfficeOM.L_FunctionCallFailed="การเรียกฟังก์ชัน {0} ล้มเหลว รหัสข้อผิดพลาด: {1}";Strings.OfficeOM.L_DataNotMatchBindingSize="วัตถุข้อมูลที่ให้มามีขนาดไม่ตรงกันกับส่วนที่เลือกปัจจุบัน";Strings.OfficeOM.L_SaveSettingsError="การตั้งค่าการบันทึกผิดพลาด";Strings.OfficeOM.L_RequestTokenUnavailable="API นี้ถูกควบคุมให้ใช้ปริมาณความถี่ในการเรียกช้าลง";Strings.OfficeOM.L_InvalidSetStartRowColumn="ค่าของ startRow หรือ startColumn ที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_InvalidFormat="ข้อผิดพลาดรูปแบบไม่ถูกต้อง";Strings.OfficeOM.L_BindingNotExist="การรวมที่ระบุไม่มีอยู่";Strings.OfficeOM.L_SettingNameNotExist="ไม่มีชื่อการตั้งค่าที่ระบุ";Strings.OfficeOM.L_EventHandlerAdditionFailed="ไม่สามารถเพิ่มตัวจัดการเหตุการณ์ได้";Strings.OfficeOM.L_BrowserAPINotSupported="เบราว์เซอร์นี้ไม่สนับสนุน API ที่ร้องขอ";Strings.OfficeOM.L_InvalidAPICall="การเรียก API ไม่ถูกต้อง";Strings.OfficeOM.L_EventRegistrationError="การลงทะเบียนเหตุการณ์ผิดพลาด";Strings.OfficeOM.L_ElementMissing="เราไม่สามารถจัดรูปแบบเซลล์ตารางได้ เนื่องจากค่าพารามิเตอร์บางค่าหายไป ตรวจสอบพารามิเตอร์ใหม่แล้วลองอีกครั้ง";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="ไม่สามารถใช้พารามิเตอร์พิกัดกับชนิดการบังคับใช้ตารางได้ เมื่อตารางนั้นมีเซลล์ที่ถูกผสาน";Strings.OfficeOM.L_NavOutOfBound="การดำเนินการล้มเหลวเนื่องจากดัชนีอยู่นอกช่วง";Strings.OfficeOM.L_RedundantCallbackSpecification="ไม่สามารถระบุการติดต่อกลับทั้งในรายการอาร์กิวเมนต์และในวัตถุทางเลือก";Strings.OfficeOM.L_CustomXmlError="ข้อผิดพลาด XML แบบกำหนดเอง";Strings.OfficeOM.L_SettingsAreStale="ไม่สามารถบันทึกการตั้งค่าได้เพราะไม่เป็นข้อมูลปัจจุบัน";Strings.OfficeOM.L_TooManyOptionalFunction="ฟังก์ชันทางเลือกหลายฟังก์ชันในรายการพารามิเตอร์";Strings.OfficeOM.L_MissingRequiredArguments="อาร์กิวเมนต์ที่จำเป็นบางอย่างหายไป";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="ไม่สามารถใช้พารามิเตอร์พิกัดกับชนิดการบังคับใช้ตารางได้ เมื่อตารางนั้นมีเซลล์ที่ถูกผสาน";Strings.OfficeOM.L_HostError="โฮสต์ผิดพลาด";Strings.OfficeOM.L_OutOfRange="ไม่อยู่ในช่วงที่กำหนด";Strings.OfficeOM.L_InvalidSelectionForBindingType="ไม่สามารถสร้างการผูกกับการเลือกปัจจุบันและชนิดการผูกที่ระบุได้";Strings.OfficeOM.L_TooManyOptionalObjects="วัตถุทางเลือกหลายวัตถุในรายการพารามิเตอร์";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="เนื้อหาที่เลือกต้องอยู่ในรูปแบบตาราง จัดรูปแบบข้อมูลเป็นตารางแล้วลองอีกครั้ง";Strings.OfficeOM.L_APINotSupported="API ไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_SliceSizeNotSupported="ขนาดของชิ้นที่ระบุไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_EventHandlerRemovalFailed="ไม่สามารถเอาตัวจัดการเหตุการณ์ออกได้";Strings.OfficeOM.L_BindingToMultipleSelection="ไม่สนับสนุนส่วนที่เลือกแบบไม่ติดกัน";Strings.OfficeOM.L_DataReadError="การอ่านข้อมูลผิดพลาด";Strings.OfficeOM.L_InternalErrorDescription="มีข้อผิดพลาดภายในเกิดขึ้น";Strings.OfficeOM.L_InvalidDataFormat="รูปแบบของวัตถุข้อมูลที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_RequestTimeout="การเรียกใช้เวลานานเกินไปในการดำเนินการ";Strings.OfficeOM.L_DataStale="ข้อมูลไม่เป็นปัจจุบัน";Strings.OfficeOM.L_GetSelectionNotSupported="ส่วนที่เลือกในปัจจุบันไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_MemoryLimit="เกินขีดจำกัดของหน่วยความจำ";Strings.OfficeOM.L_CellDataAmountBeyondLimits="หมายเหตุ: จำนวนของเซลล์ในตารางควรจะต่ำกว่า 20,000 เซลล์";Strings.OfficeOM.L_InvalidTableOptionValue="พารามิเตอร์ของตัวเลือกตารางอย่างน้อยหนึ่งรายการมีค่าที่ไม่ได้รับอนุญาต ตรวจสอบค่าใหม่แล้วลองอีกครั้ง";Strings.OfficeOM.L_PermissionDenied="สิทธิ์ถูกปฏิเสธ";Strings.OfficeOM.L_InvalidDataObject="วัตถุข้อมูลไม่ถูกต้อง";Strings.OfficeOM.L_UserNotSignedIn="ไม่มีผู้ใช้ลงชื่อเข้าใช้ Office";Strings.OfficeOM.L_SelectionCannotBound="ไม่สามารถผูกกับส่วนที่เลือกปัจจุบัน";Strings.OfficeOM.L_InvalidColumnsForBinding="คอลัมน์ที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_BadSelectorString="สตริงที่ส่งผ่านไปยังตัวเลือกได้รับการจัดรูปแบบไม่ถูกต้อง หรือไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_InvalidGetRowColumnCounts="ค่าของ rowCount หรือ columnCount ที่ระบุไม่ถูกต้อง";Strings.OfficeOM.L_OsfControlTypeNotSupported="ไม่สนับสนุนชนิดของ OsfControl";Strings.OfficeOM.L_InvalidValue="ค่าไม่ถูกต้อง";Strings.OfficeOM.L_DataNotMatchSelection="วัตถุข้อมูลที่ให้มาเข้ากันไม่ได้กับรูปร่างหรือมิติของการเลือกปัจจุบัน";Strings.OfficeOM.L_InternalError="ข้อผิดพลาดภายใน";Strings.OfficeOM.L_NotSupported="ไม่สนับสนุนฟังก์ชัน {0}";Strings.OfficeOM.L_CustomXmlNodeNotFound="ไม่พบโหนดที่ระบุ";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="ชนิดการบังคับใช้ที่ระบุเข้ากันไม่ได้กับชนิดการผูกนี้";Strings.OfficeOM.L_NetworkProblemRetrieveFile="ปัญหาเครือข่ายป้องกันไม่ให้เรียกใช้ไฟล์";Strings.OfficeOM.L_TooManyArguments="มีอาร์กิวเมนต์มากเกินไป";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="ชนิดการผูกนี้ไม่สนับสนุนากรดำเนินการนี้";Strings.OfficeOM.L_InValidOptionalArgument="อาร์กิวเมนต์ทางเลือกไม่ถูกต้อง";Strings.OfficeOM.L_FileTypeNotSupported="ชนิดของไฟล์ที่ระบุไม่ได้รับการสนับสนุน";Strings.OfficeOM.L_GetDataParametersConflict="พารามิเตอร์ที่ระบุขัดแย้งกัน";Strings.OfficeOM.L_CallbackNotAFunction="การติดต่อกลับที่ต้องเป็นของฟังก์ชันชนิด กลับเป็นของ {0} ของชนิด" \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/outlook_strings.debug.js new file mode 100644 index 000000000..9b7b7bed6 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "ไม่สามารถลบสิ่งที่แนบมาได้เนื่องจากไม่พบสิ่งที่แนบมาที่มีดัชนีสิ่งที่แนบมานี้"; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "ขนาดการร้องขอเกินขีดจำกัดที่ 1 เมกะไบต์ โปรดปรับเปลี่ยนการร้องขอ EWS ของคุณ"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "จำเป็นต้องมีสิทธิ์ที่ปรับให้สูงขึ้นเพื่อเรียกใช้เมธอด: '{0}'"; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "ข้อผิดพลาดสิ่งที่แนบมา"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "วันที่สิ้นสุดเกิดขึ้นก่อนวันที่เริ่มต้น"; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "ชื่อที่ใช้แสดงที่ให้มาอย่างน้อยหนึ่งรายการยาวมากเกินไป"; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "จำนวนผู้รับทั้งหมดในเขตข้อมูลต้องไม่เกิน {0} รายการ"; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "การรักษาให้ HTML ปลอดภัยล้มเหลว"; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "การเขียนข้อมูลผิดพลาด"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "จำเป็นต้องมีสิทธิ์ที่ปรับให้สูงขึ้นเพื่อเข้าถึงสมาชิกของ JavaScript API ที่ได้รับการป้องกันสำหรับ Office"; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "ไม่สามารถเพิ่มสิ่งที่แนบมาได้ เนื่องจากข้อความมีจำนวนสิ่งที่แนบมาถึงขีดจำกัดสูงสุดแล้ว"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "ข้อผิดพลาดของโพรโทคอลภายใน: '{0}'"; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "ผู้ใช้ลบสิ่งที่แนบมาก่อนการอัปโหลดจะเสร็จสมบูรณ์"; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "ไม่พบออฟเซตสำหรับการประทับเวลานี้"; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "ไม่สามารถเพิ่มสิ่งที่แนบมาได้เนื่องจากมีขนาดใหญ่เกินไป"; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "เวลาสิ้นสุดไม่สามารถเกิดขึ้นก่อนเวลาเริ่มต้นได้"; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "พารามิเตอร์ที่กำหนดไม่ตรงกับรูปแบบที่ต้องการ"; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "ไม่สามารถเพิ่มสิ่งที่แนบมาลงในรายการได้"; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "ไม่ได้ให้ผู้รับที่ถูกต้อง"; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ID สิ่งที่แนบมาไม่ถูกต้อง"; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "ไม่สามารถเพิ่มสิ่งที่แนบมาได้ขณะกำลังเรียกใช้การตอบกลับหรือการส่งต่อเต็มรูปแบบจากเซิร์ฟเวอร์"; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "ที่อยู่อีเมลที่ให้มาอย่างน้อยหนึ่งรายการยาวมากเกินไป"; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "เส้นทางสิ่งที่แนบมาไม่ถูกต้อง"; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "ไม่สามารถลบสิ่งที่แนบมาออกจากรายการได้"; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "มีข้อผิดพลาดรูปแบบภายใน"; +_u.ExtensibilityStrings.l_InvalidDate_Text = "ค่าป้อนเข้าไม่ได้แก้ไขเป็นวันที่ถูกต้อง"; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "ผู้ใช้เปลี่ยนตำแหน่งของเคอร์เซอร์ขณะที่กำลังแทรกข้อมูล" diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/outlook_strings.js new file mode 100644 index 000000000..46c14dda3 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/th-th/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="ไม่สามารถลบสิ่งที่แนบมาได้เนื่องจากไม่พบสิ่งที่แนบมาที่มีดัชนีสิ่งที่แนบมานี้";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="ขนาดการร้องขอเกินขีดจำกัดที่ 1 เมกะไบต์ โปรดปรับเปลี่ยนการร้องขอ EWS ของคุณ";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="จำเป็นต้องมีสิทธิ์ที่ปรับให้สูงขึ้นเพื่อเรียกใช้เมธอด: '{0}'";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="ข้อผิดพลาดสิ่งที่แนบมา";_u.ExtensibilityStrings.l_InvalidEventDates_Text="วันที่สิ้นสุดเกิดขึ้นก่อนวันที่เริ่มต้น";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="ชื่อที่ใช้แสดงที่ให้มาอย่างน้อยหนึ่งรายการยาวมากเกินไป";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="จำนวนผู้รับทั้งหมดในเขตข้อมูลต้องไม่เกิน {0} รายการ";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="การรักษาให้ HTML ปลอดภัยล้มเหลว";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="การเขียนข้อมูลผิดพลาด";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="จำเป็นต้องมีสิทธิ์ที่ปรับให้สูงขึ้นเพื่อเข้าถึงสมาชิกของ JavaScript API ที่ได้รับการป้องกันสำหรับ Office";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="ไม่สามารถเพิ่มสิ่งที่แนบมาได้ เนื่องจากข้อความมีจำนวนสิ่งที่แนบมาถึงขีดจำกัดสูงสุดแล้ว";_u.ExtensibilityStrings.l_InternalProtocolError_Text="ข้อผิดพลาดของโพรโทคอลภายใน: '{0}'";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="ผู้ใช้ลบสิ่งที่แนบมาก่อนการอัปโหลดจะเสร็จสมบูรณ์";_u.ExtensibilityStrings.l_OffsetNotfound_Text="ไม่พบออฟเซตสำหรับการประทับเวลานี้";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="ไม่สามารถเพิ่มสิ่งที่แนบมาได้เนื่องจากมีขนาดใหญ่เกินไป";_u.ExtensibilityStrings.l_InvalidEndTime_Text="เวลาสิ้นสุดไม่สามารถเกิดขึ้นก่อนเวลาเริ่มต้นได้";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="พารามิเตอร์ที่กำหนดไม่ตรงกับรูปแบบที่ต้องการ";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="ไม่สามารถเพิ่มสิ่งที่แนบมาลงในรายการได้";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="ไม่ได้ให้ผู้รับที่ถูกต้อง";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ID สิ่งที่แนบมาไม่ถูกต้อง";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="ไม่สามารถเพิ่มสิ่งที่แนบมาได้ขณะกำลังเรียกใช้การตอบกลับหรือการส่งต่อเต็มรูปแบบจากเซิร์ฟเวอร์";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="ที่อยู่อีเมลที่ให้มาอย่างน้อยหนึ่งรายการยาวมากเกินไป";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="เส้นทางสิ่งที่แนบมาไม่ถูกต้อง";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="ไม่สามารถลบสิ่งที่แนบมาออกจากรายการได้";_u.ExtensibilityStrings.l_InternalFormatError_Text="มีข้อผิดพลาดรูปแบบภายใน";_u.ExtensibilityStrings.l_InvalidDate_Text="ค่าป้อนเข้าไม่ได้แก้ไขเป็นวันที่ถูกต้อง";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="ผู้ใช้เปลี่ยนตำแหน่งของเคอร์เซอร์ขณะที่กำลังแทรกข้อมูล" \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/office_strings.debug.js new file mode 100644 index 000000000..72f7013e6 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Belirtilen bağlama türü sağlanan adlandırılmış öğe ile uyumlu değil."; +Strings.OfficeOM.L_EventHandlerNotExist = "Belirtilen olay türü bu bağlama üzerinde desteklenmiyor."; +Strings.OfficeOM.L_UnknownBindingType = "Bağlama türü desteklenmiyor."; +Strings.OfficeOM.L_InvalidNode = "Geçersiz Düğüm"; +Strings.OfficeOM.L_NotImplemented = "{0} işlevi uygulanmadı."; +Strings.OfficeOM.L_NoCapability = "Bu eylem için yeterli izne sahip değilsiniz."; +Strings.OfficeOM.L_SettingsCannotSave = "Ayarlar kaydedilemedi."; +Strings.OfficeOM.L_DataWriteReminder = "Veri Yazma Anımsatıcısı"; +Strings.OfficeOM.L_InvalidBinding = "Geçersiz Bağlama"; +Strings.OfficeOM.L_InvalidSetColumns = "Belirtilen sütunlar geçersiz."; +Strings.OfficeOM.L_BindingCreationError = "Bağlama Oluşturma Hatası"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Değer izin verilen aralığın dışında."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Geçerli seçim belirtilen zorlama türüyle uyumlu değil."; +Strings.OfficeOM.L_InvalidBindingError = "Geçersiz Bağlama Hatası"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Belirtilen satırBaşlat veya sütunBaşlat değerleri geçersiz."; +Strings.OfficeOM.L_InvalidSetRows = "Belirtilen satırlar geçersiz."; +Strings.OfficeOM.L_NetworkProblem = "Ağ Sorunu"; +Strings.OfficeOM.L_CannotWriteToSelection = "Geçerli seçime yazılamıyor."; +Strings.OfficeOM.L_MissingParameter = "Eksik Parametre"; +Strings.OfficeOM.L_IndexOutOfRange = "Dizin aralık dışında."; +Strings.OfficeOM.L_SettingsStaleError = "Eski Ayar Hatası"; +Strings.OfficeOM.L_CannotNavigateTo = "Nesne, gezinmenin desteklenmediği bir yerde bulunuyor."; +Strings.OfficeOM.L_ReadSettingsError = "Ayarları Oku Hatası"; +Strings.OfficeOM.L_InvalidGetColumns = "Belirtilen sütunlar geçersiz."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Belirtilen zorlama türü desteklenmiyor."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "{0} uygulaması mevcut değil. Microsoft.Office.WebExtension.initialize(reason) çağrılamadı."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Sağlanan veri nesnesi verilerin üzerine yazılacağından veya veriler değişeceğinden ayarlama işlemi başarısız oldu."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Satır dizini değeri izin verilen aralığın dışında. Satır sayısından az bir değer (0 veya daha yüksek) kullanın."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Belirtilen satır boş."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Sütun dizini değeri izin verilen aralığın dışında. Sütun sayısından az bir değer (0 veya daha yüksek) kullanın."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Desteklenmeyen Listeleme"; +Strings.OfficeOM.L_InvalidParameters = "{0} işlevi geçersiz parametrelere sahip."; +Strings.OfficeOM.L_SetDataParametersConflict = "Belirtilen parametreler çakışıyor."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Başka dosya almadan mevcut dosyada closeAsync çağrısı yapın."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Belirtilen veri nesnesi türü geçerli seçimle uyumlu değil."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Sabit listesi geçerli ana bilgisayar uygulamasında desteklenmiyor."; +Strings.OfficeOM.L_InvalidCoercion = "Geçersiz Zorlama Türü"; +Strings.OfficeOM.L_NotSupportedEventType = "Belirtilen olay türü {0} desteklenmiyor."; +Strings.OfficeOM.L_UnsupportedDataObject = "Sağlanan veri nesnesi türü desteklenmiyor."; +Strings.OfficeOM.L_GetDataIsTooLarge = "İstenen veri kümesi çok büyük."; +Strings.OfficeOM.L_AppNameNotExist = "{0} için Uygulama Adı mevcut değil."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Lütfen seçim yapın."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Aynı ada sahip birden çok nesne bulundu."; +Strings.OfficeOM.L_InvalidCellsValue = "Bir veya daha fazla hücre parametresi izin verilmeyen değerler içeriyor. Değerleri bir daha kontrol edin ve yeniden deneyin."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Belirtilen veri nesnesi bağlama türü ile uyumlu değil."; +Strings.OfficeOM.L_InvalidFormatValue = "Bir veya daha fazla biçim parametresi izin verilmeyen değerler içeriyor. Değerleri bir daha kontrol edin ve yeniden deneyin."; +Strings.OfficeOM.L_NotSupportedBindingType = "Belirtilen bağlama türü {0} desteklenmiyor."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js henüz tam olarak yüklenmedi. Lütfen daha sonra tekrar deneyin veya Office.initialize işlevine başlatma kodunuzu eklediğinizden emin olun."; +Strings.OfficeOM.L_FormattingReminder = "Biçimlendirme Anımsatıcısı"; +Strings.OfficeOM.L_ShuttingDown = "Sunucudaki veriler güncel olmadığından, işlem başarısız oldu."; +Strings.OfficeOM.L_OperationNotSupported = "İşlem desteklenmiyor."; +Strings.OfficeOM.L_DocumentReadOnly = "Geçerli belge modunda istenen işleme izin verilmiyor."; +Strings.OfficeOM.L_NamedItemNotFound = "Adlandırılmış öğe mevcut değil."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Geçerli bağlamda geçersiz API çağrısı."; +Strings.OfficeOM.L_InvalidGetRows = "Belirtilen satırlar geçersiz."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Not: Biçimlendirme API'si çağrısı tarafından ayarlanan biçimlendirme kümelerinin 100'ün altında olması önerilir."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Önceki çağrı tamamlanana kadar bekleyin."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Belirtilen veri nesnesi çok büyük."; +Strings.OfficeOM.L_DataWriteError = "Veri Yazma Hatası"; +Strings.OfficeOM.L_InvalidBindingOperation = "Geçersiz Bağlama İşlemi"; +Strings.OfficeOM.L_APICallFailed = "API Çağrısı Başarısız Oldu"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Belirtilen kimlik yok."; +Strings.OfficeOM.L_FunctionCallFailed = "{0} işlev çağrısı başarısız oldu, hata kodu: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Sağlanan veri nesnesi geçerli seçim boyutuyla eşleşmiyor."; +Strings.OfficeOM.L_SaveSettingsError = "Ayarları Kaydet Hatası"; +Strings.OfficeOM.L_RequestTokenUnavailable = "API, çağrı sıkılığını yavaşlatmak amacıyla kısıtlandı."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Belirtilen satırBaşlat veya sütunBaşlat değerleri geçersiz."; +Strings.OfficeOM.L_InvalidFormat = "Geçersiz Biçim Hatası"; +Strings.OfficeOM.L_BindingNotExist = "Belirtilen bağlama mevcut değil."; +Strings.OfficeOM.L_SettingNameNotExist = "Belirtilen ayar adı mevcut değil."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Olay işleyicisi eklenemedi."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Bu tarayıcı istenen API'yi desteklemiyor."; +Strings.OfficeOM.L_InvalidAPICall = "Geçersiz API Çağrısı"; +Strings.OfficeOM.L_EventRegistrationError = "Olay Kayıt Hatası"; +Strings.OfficeOM.L_ElementMissing = "Bazı parametre değerleri eksik olduğu için tablo hücresini biçimlendiremedik. Parametreleri bir daha kontrol edin ve yeniden deneyin."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Tablo birleştirilmiş hücreler içerdiğinde koordinasyon parametreleri, zorlama türü Tablo ile kullanılamaz."; +Strings.OfficeOM.L_NavOutOfBound = "Dizin aralık dışında olduğundan işlem başarısız oldu."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Geri arama, hem değişken listesinde hem de isteğe bağlı nesnede belirtilemiyor."; +Strings.OfficeOM.L_CustomXmlError = "Özel XML Hatası."; +Strings.OfficeOM.L_SettingsAreStale = "Ayarlar güncel olmadığından kaydedilemedi."; +Strings.OfficeOM.L_TooManyOptionalFunction = "parametre listesinde birden fazla isteğe bağlı nesne"; +Strings.OfficeOM.L_MissingRequiredArguments = "gerekli olan bazı bağımsız değişkenler eksik"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Tablo birleştirilmiş hücreler içerdiğinde koordinasyon parametreleri, zorlama türü Tablo ile kullanılamaz."; +Strings.OfficeOM.L_HostError = "Ana Bilgisayar Hatası"; +Strings.OfficeOM.L_OutOfRange = "Aralık Dışında"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Bağlama, geçerli seçim ve belirtilen bağlama türüyle oluşturulamıyor."; +Strings.OfficeOM.L_TooManyOptionalObjects = "parametre listesinde birden fazla isteğe bağlı nesne"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Seçili içeriğin tablo biçiminde olması gerekir. Verileri tablo olarak biçimlendirin ve yeniden deneyin."; +Strings.OfficeOM.L_APINotSupported = "API Desteklenmiyor"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Belirtilen dilim boyutu desteklenmiyor."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Olay işleyicisi kaldırılamadı."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Bitişik olmayan seçimler desteklenmiyor."; +Strings.OfficeOM.L_DataReadError = "Veri Okuma Hatası"; +Strings.OfficeOM.L_InternalErrorDescription = "Dahili bir hata oluştu."; +Strings.OfficeOM.L_InvalidDataFormat = "Belirtilen veri nesnesi biçimi geçerli değil."; +Strings.OfficeOM.L_RequestTimeout = "Çağrı yürütme çok uzun sürdü."; +Strings.OfficeOM.L_DataStale = "Veriler Güncel Değil"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Geçerli seçim desteklenmiyor."; +Strings.OfficeOM.L_MemoryLimit = "Bellek Sınırı Aşıldı"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Not: Tablodaki hücre sayısının 20.000'in altında olması önerilir."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Bir veya daha fazla tableOptions parametresi izin verilmeyen değerler içeriyor. Değerleri bir daha kontrol edin ve yeniden deneyin."; +Strings.OfficeOM.L_PermissionDenied = "İzin Reddedildi"; +Strings.OfficeOM.L_InvalidDataObject = "Geçersiz Veri Nesnesi"; +Strings.OfficeOM.L_UserNotSignedIn = "Office oturumu açmış kullanıcı yok."; +Strings.OfficeOM.L_SelectionCannotBound = "Geçerli seçime bağlanılamıyor."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Belirtilen sütunlar geçersiz."; +Strings.OfficeOM.L_BadSelectorString = "Seçiciye iletilen dize yanlış biçimlendirilmiş veya desteklenmiyor."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Belirtilen satırSayısı veya sütunSayısı değerleri geçersiz."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "OsfControl türü desteklenmiyor."; +Strings.OfficeOM.L_InvalidValue = "Geçersiz Değer"; +Strings.OfficeOM.L_DataNotMatchSelection = "Sağlanan veri nesnesi geçerli seçimin şekil ve boyutlarıyla uyumlu değil."; +Strings.OfficeOM.L_InternalError = "İç Hata"; +Strings.OfficeOM.L_NotSupported = "{0} işlevi desteklenmiyor."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Belirtilen düğüm bulunamadı."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Belirtilen zorlama türü bu bağlama türüyle uyumlu değil."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Bir ağ sorunu nedeniyle dosya alınamadı."; +Strings.OfficeOM.L_TooManyArguments = "çok fazla bağımsız değişken"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "İşlem bu bağlama türünde desteklenmiyor."; +Strings.OfficeOM.L_InValidOptionalArgument = "geçersiz isteğe bağlı bağımsız değişken"; +Strings.OfficeOM.L_FileTypeNotSupported = "Belirtilen dosya türü desteklenmiyor."; +Strings.OfficeOM.L_GetDataParametersConflict = "Belirtilen parametreler çakışıyor."; +Strings.OfficeOM.L_CallbackNotAFunction = "{0} türünde olan geri arama, işlev türünde olmalıdır." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/office_strings.js new file mode 100644 index 000000000..2da46969c --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Belirtilen bağlama türü sağlanan adlandırılmış öğe ile uyumlu değil.";Strings.OfficeOM.L_EventHandlerNotExist="Belirtilen olay türü bu bağlama üzerinde desteklenmiyor.";Strings.OfficeOM.L_UnknownBindingType="Bağlama türü desteklenmiyor.";Strings.OfficeOM.L_InvalidNode="Geçersiz Düğüm";Strings.OfficeOM.L_NotImplemented="{0} işlevi uygulanmadı.";Strings.OfficeOM.L_NoCapability="Bu eylem için yeterli izne sahip değilsiniz.";Strings.OfficeOM.L_SettingsCannotSave="Ayarlar kaydedilemedi.";Strings.OfficeOM.L_DataWriteReminder="Veri Yazma Anımsatıcısı";Strings.OfficeOM.L_InvalidBinding="Geçersiz Bağlama";Strings.OfficeOM.L_InvalidSetColumns="Belirtilen sütunlar geçersiz.";Strings.OfficeOM.L_BindingCreationError="Bağlama Oluşturma Hatası";Strings.OfficeOM.L_FormatValueOutOfRange="Değer izin verilen aralığın dışında.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Geçerli seçim belirtilen zorlama türüyle uyumlu değil.";Strings.OfficeOM.L_InvalidBindingError="Geçersiz Bağlama Hatası";Strings.OfficeOM.L_InvalidGetStartRowColumn="Belirtilen satırBaşlat veya sütunBaşlat değerleri geçersiz.";Strings.OfficeOM.L_InvalidSetRows="Belirtilen satırlar geçersiz.";Strings.OfficeOM.L_NetworkProblem="Ağ Sorunu";Strings.OfficeOM.L_CannotWriteToSelection="Geçerli seçime yazılamıyor.";Strings.OfficeOM.L_MissingParameter="Eksik Parametre";Strings.OfficeOM.L_IndexOutOfRange="Dizin aralık dışında.";Strings.OfficeOM.L_SettingsStaleError="Eski Ayar Hatası";Strings.OfficeOM.L_CannotNavigateTo="Nesne, gezinmenin desteklenmediği bir yerde bulunuyor.";Strings.OfficeOM.L_ReadSettingsError="Ayarları Oku Hatası";Strings.OfficeOM.L_InvalidGetColumns="Belirtilen sütunlar geçersiz.";Strings.OfficeOM.L_CoercionTypeNotSupported="Belirtilen zorlama türü desteklenmiyor.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="{0} uygulaması mevcut değil. Microsoft.Office.WebExtension.initialize(reason) çağrılamadı.";Strings.OfficeOM.L_OverwriteWorksheetData="Sağlanan veri nesnesi verilerin üzerine yazılacağından veya veriler değişeceğinden ayarlama işlemi başarısız oldu.";Strings.OfficeOM.L_RowIndexOutOfRange="Satır dizini değeri izin verilen aralığın dışında. Satır sayısından az bir değer (0 veya daha yüksek) kullanın.";Strings.OfficeOM.L_InvalidReadForBlankRow="Belirtilen satır boş.";Strings.OfficeOM.L_ColIndexOutOfRange="Sütun dizini değeri izin verilen aralığın dışında. Sütun sayısından az bir değer (0 veya daha yüksek) kullanın.";Strings.OfficeOM.L_UnsupportedEnumeration="Desteklenmeyen Listeleme";Strings.OfficeOM.L_InvalidParameters="{0} işlevi geçersiz parametrelere sahip.";Strings.OfficeOM.L_SetDataParametersConflict="Belirtilen parametreler çakışıyor.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Başka dosya almadan mevcut dosyada closeAsync çağrısı yapın.";Strings.OfficeOM.L_DataNotMatchCoercionType="Belirtilen veri nesnesi türü geçerli seçimle uyumlu değil.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Sabit listesi geçerli ana bilgisayar uygulamasında desteklenmiyor.";Strings.OfficeOM.L_InvalidCoercion="Geçersiz Zorlama Türü";Strings.OfficeOM.L_NotSupportedEventType="Belirtilen olay türü {0} desteklenmiyor.";Strings.OfficeOM.L_UnsupportedDataObject="Sağlanan veri nesnesi türü desteklenmiyor.";Strings.OfficeOM.L_GetDataIsTooLarge="İstenen veri kümesi çok büyük.";Strings.OfficeOM.L_AppNameNotExist="{0} için Uygulama Adı mevcut değil.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Lütfen seçim yapın.";Strings.OfficeOM.L_MultipleNamedItemFound="Aynı ada sahip birden çok nesne bulundu.";Strings.OfficeOM.L_InvalidCellsValue="Bir veya daha fazla hücre parametresi izin verilmeyen değerler içeriyor. Değerleri bir daha kontrol edin ve yeniden deneyin.";Strings.OfficeOM.L_DataNotMatchBindingType="Belirtilen veri nesnesi bağlama türü ile uyumlu değil.";Strings.OfficeOM.L_InvalidFormatValue="Bir veya daha fazla biçim parametresi izin verilmeyen değerler içeriyor. Değerleri bir daha kontrol edin ve yeniden deneyin.";Strings.OfficeOM.L_NotSupportedBindingType="Belirtilen bağlama türü {0} desteklenmiyor.";Strings.OfficeOM.L_InitializeNotReady="Office.js henüz tam olarak yüklenmedi. Lütfen daha sonra tekrar deneyin veya Office.initialize işlevine başlatma kodunuzu eklediğinizden emin olun.";Strings.OfficeOM.L_FormattingReminder="Biçimlendirme Anımsatıcısı";Strings.OfficeOM.L_ShuttingDown="Sunucudaki veriler güncel olmadığından, işlem başarısız oldu.";Strings.OfficeOM.L_OperationNotSupported="İşlem desteklenmiyor.";Strings.OfficeOM.L_DocumentReadOnly="Geçerli belge modunda istenen işleme izin verilmiyor.";Strings.OfficeOM.L_NamedItemNotFound="Adlandırılmış öğe mevcut değil.";Strings.OfficeOM.L_InvalidApiCallInContext="Geçerli bağlamda geçersiz API çağrısı.";Strings.OfficeOM.L_InvalidGetRows="Belirtilen satırlar geçersiz.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Not: Biçimlendirme API'si çağrısı tarafından ayarlanan biçimlendirme kümelerinin 100'ün altında olması önerilir.";Strings.OfficeOM.L_TooManyIncompleteRequests="Önceki çağrı tamamlanana kadar bekleyin.";Strings.OfficeOM.L_SetDataIsTooLarge="Belirtilen veri nesnesi çok büyük.";Strings.OfficeOM.L_DataWriteError="Veri Yazma Hatası";Strings.OfficeOM.L_InvalidBindingOperation="Geçersiz Bağlama İşlemi";Strings.OfficeOM.L_APICallFailed="API Çağrısı Başarısız Oldu";Strings.OfficeOM.L_SpecifiedIdNotExist="Belirtilen kimlik yok.";Strings.OfficeOM.L_FunctionCallFailed="{0} işlev çağrısı başarısız oldu, hata kodu: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Sağlanan veri nesnesi geçerli seçim boyutuyla eşleşmiyor.";Strings.OfficeOM.L_SaveSettingsError="Ayarları Kaydet Hatası";Strings.OfficeOM.L_RequestTokenUnavailable="API, çağrı sıkılığını yavaşlatmak amacıyla kısıtlandı.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Belirtilen satırBaşlat veya sütunBaşlat değerleri geçersiz.";Strings.OfficeOM.L_InvalidFormat="Geçersiz Biçim Hatası";Strings.OfficeOM.L_BindingNotExist="Belirtilen bağlama mevcut değil.";Strings.OfficeOM.L_SettingNameNotExist="Belirtilen ayar adı mevcut değil.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Olay işleyicisi eklenemedi.";Strings.OfficeOM.L_BrowserAPINotSupported="Bu tarayıcı istenen API'yi desteklemiyor.";Strings.OfficeOM.L_InvalidAPICall="Geçersiz API Çağrısı";Strings.OfficeOM.L_EventRegistrationError="Olay Kayıt Hatası";Strings.OfficeOM.L_ElementMissing="Bazı parametre değerleri eksik olduğu için tablo hücresini biçimlendiremedik. Parametreleri bir daha kontrol edin ve yeniden deneyin.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Tablo birleştirilmiş hücreler içerdiğinde koordinasyon parametreleri, zorlama türü Tablo ile kullanılamaz.";Strings.OfficeOM.L_NavOutOfBound="Dizin aralık dışında olduğundan işlem başarısız oldu.";Strings.OfficeOM.L_RedundantCallbackSpecification="Geri arama, hem değişken listesinde hem de isteğe bağlı nesnede belirtilemiyor.";Strings.OfficeOM.L_CustomXmlError="Özel XML Hatası.";Strings.OfficeOM.L_SettingsAreStale="Ayarlar güncel olmadığından kaydedilemedi.";Strings.OfficeOM.L_TooManyOptionalFunction="parametre listesinde birden fazla isteğe bağlı nesne";Strings.OfficeOM.L_MissingRequiredArguments="gerekli olan bazı bağımsız değişkenler eksik";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Tablo birleştirilmiş hücreler içerdiğinde koordinasyon parametreleri, zorlama türü Tablo ile kullanılamaz.";Strings.OfficeOM.L_HostError="Ana Bilgisayar Hatası";Strings.OfficeOM.L_OutOfRange="Aralık Dışında";Strings.OfficeOM.L_InvalidSelectionForBindingType="Bağlama, geçerli seçim ve belirtilen bağlama türüyle oluşturulamıyor.";Strings.OfficeOM.L_TooManyOptionalObjects="parametre listesinde birden fazla isteğe bağlı nesne";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Seçili içeriğin tablo biçiminde olması gerekir. Verileri tablo olarak biçimlendirin ve yeniden deneyin.";Strings.OfficeOM.L_APINotSupported="API Desteklenmiyor";Strings.OfficeOM.L_SliceSizeNotSupported="Belirtilen dilim boyutu desteklenmiyor.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Olay işleyicisi kaldırılamadı.";Strings.OfficeOM.L_BindingToMultipleSelection="Bitişik olmayan seçimler desteklenmiyor.";Strings.OfficeOM.L_DataReadError="Veri Okuma Hatası";Strings.OfficeOM.L_InternalErrorDescription="Dahili bir hata oluştu.";Strings.OfficeOM.L_InvalidDataFormat="Belirtilen veri nesnesi biçimi geçerli değil.";Strings.OfficeOM.L_RequestTimeout="Çağrı yürütme çok uzun sürdü.";Strings.OfficeOM.L_DataStale="Veriler Güncel Değil";Strings.OfficeOM.L_GetSelectionNotSupported="Geçerli seçim desteklenmiyor.";Strings.OfficeOM.L_MemoryLimit="Bellek Sınırı Aşıldı";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Not: Tablodaki hücre sayısının 20.000'in altında olması önerilir.";Strings.OfficeOM.L_InvalidTableOptionValue="Bir veya daha fazla tableOptions parametresi izin verilmeyen değerler içeriyor. Değerleri bir daha kontrol edin ve yeniden deneyin.";Strings.OfficeOM.L_PermissionDenied="İzin Reddedildi";Strings.OfficeOM.L_InvalidDataObject="Geçersiz Veri Nesnesi";Strings.OfficeOM.L_UserNotSignedIn="Office oturumu açmış kullanıcı yok.";Strings.OfficeOM.L_SelectionCannotBound="Geçerli seçime bağlanılamıyor.";Strings.OfficeOM.L_InvalidColumnsForBinding="Belirtilen sütunlar geçersiz.";Strings.OfficeOM.L_BadSelectorString="Seçiciye iletilen dize yanlış biçimlendirilmiş veya desteklenmiyor.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Belirtilen satırSayısı veya sütunSayısı değerleri geçersiz.";Strings.OfficeOM.L_OsfControlTypeNotSupported="OsfControl türü desteklenmiyor.";Strings.OfficeOM.L_InvalidValue="Geçersiz Değer";Strings.OfficeOM.L_DataNotMatchSelection="Sağlanan veri nesnesi geçerli seçimin şekil ve boyutlarıyla uyumlu değil.";Strings.OfficeOM.L_InternalError="İç Hata";Strings.OfficeOM.L_NotSupported="{0} işlevi desteklenmiyor.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Belirtilen düğüm bulunamadı.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Belirtilen zorlama türü bu bağlama türüyle uyumlu değil.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Bir ağ sorunu nedeniyle dosya alınamadı.";Strings.OfficeOM.L_TooManyArguments="çok fazla bağımsız değişken";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="İşlem bu bağlama türünde desteklenmiyor.";Strings.OfficeOM.L_InValidOptionalArgument="geçersiz isteğe bağlı bağımsız değişken";Strings.OfficeOM.L_FileTypeNotSupported="Belirtilen dosya türü desteklenmiyor.";Strings.OfficeOM.L_GetDataParametersConflict="Belirtilen parametreler çakışıyor.";Strings.OfficeOM.L_CallbackNotAFunction="{0} türünde olan geri arama, işlev türünde olmalıdır." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/outlook_strings.debug.js new file mode 100644 index 000000000..03a6a65d3 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Ek dizini bulunamadığı için ek silinemiyor."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "İstek, 1 MB'lık boyut sınırını aşıyor. Lütfen EWS isteğinizi değiştirin."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Şu yöntemi çağırmak için yükseltilmiş izin gerekir: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Ek Hatası"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Bitiş tarihi başlangıç tarihinden önce girilmiş."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Sağlanan bir veya daha fazla sayıda görünen ad çok uzun."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Alana eklenen toplam alıcı sayısı {0} değerinden fazla olamaz."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "HTML temizlemesi başarısız oldu."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Veri Yazma Hatası"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Office için JavaScript API'sinin korumalı üyelerine erişmek amacıyla yükseltilmiş izinler gerekir:."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "İletide izin verilen en fazla ek sayısına ulaşıldığı için ek eklenemez"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "İç protokol hatası: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Kullanıcı yükleme tamamlanmadan önce eki kaldırdı."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Bu zaman damgası için bir uzaklık bulunamadı."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Ek çok büyük olduğu için eklenemiyor."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Bitiş saati başlangıç saatinden önce olamaz."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Belirtilen parametreler beklenen biçimle eşleşmiyor."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Öğeye ek eklenemiyor."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Geçerli alıcı bilgisi sağlanmadı."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Ek kimliği geçersiz."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Sunucudan tam yanıt veya ilet metni alınırken ek eklenemez."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Sağlanan bir veya daha fazla e-posta adresi çok uzun."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Ek yolu geçersiz."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Ek öğeden silinemiyor."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Dahili biçim hatası oluştu."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Giriş, geçerli bir tarihe çözümlenemiyor."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Kullanıcı, veriler eklenirken imlecin yerini değiştirdi." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/outlook_strings.js new file mode 100644 index 000000000..0d83d2765 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/tr-tr/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Ek dizini bulunamadığı için ek silinemiyor.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="İstek, 1 MB'lık boyut sınırını aşıyor. Lütfen EWS isteğinizi değiştirin.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Şu yöntemi çağırmak için yükseltilmiş izin gerekir: '{0}'.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Ek Hatası";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Bitiş tarihi başlangıç tarihinden önce girilmiş.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Sağlanan bir veya daha fazla sayıda görünen ad çok uzun.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Alana eklenen toplam alıcı sayısı {0} değerinden fazla olamaz.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="HTML temizlemesi başarısız oldu.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Veri Yazma Hatası";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Office için JavaScript API'sinin korumalı üyelerine erişmek amacıyla yükseltilmiş izinler gerekir:.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="İletide izin verilen en fazla ek sayısına ulaşıldığı için ek eklenemez";_u.ExtensibilityStrings.l_InternalProtocolError_Text="İç protokol hatası: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Kullanıcı yükleme tamamlanmadan önce eki kaldırdı.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Bu zaman damgası için bir uzaklık bulunamadı.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Ek çok büyük olduğu için eklenemiyor.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Bitiş saati başlangıç saatinden önce olamaz.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Belirtilen parametreler beklenen biçimle eşleşmiyor.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Öğeye ek eklenemiyor.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Geçerli alıcı bilgisi sağlanmadı.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Ek kimliği geçersiz.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Sunucudan tam yanıt veya ilet metni alınırken ek eklenemez.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Sağlanan bir veya daha fazla e-posta adresi çok uzun.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Ek yolu geçersiz.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Ek öğeden silinemiyor.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Dahili biçim hatası oluştu.";_u.ExtensibilityStrings.l_InvalidDate_Text="Giriş, geçerli bir tarihe çözümlenemiyor.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Kullanıcı, veriler eklenirken imlecin yerini değiştirdi." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/office_strings.debug.js new file mode 100644 index 000000000..848215482 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Указаний тип зв’язування несумісний із наданим іменованим елементом."; +Strings.OfficeOM.L_EventHandlerNotExist = "Вказаний обробник подій не знайдено у цьому зв\\'язуванні."; +Strings.OfficeOM.L_UnknownBindingType = "Тип зв’язування не підтримується."; +Strings.OfficeOM.L_InvalidNode = "Неприпустимий вузол"; +Strings.OfficeOM.L_NotImplemented = "Функцію {0} не виконано."; +Strings.OfficeOM.L_NoCapability = "У вас недостатньо дозволів для виконання цієї дії."; +Strings.OfficeOM.L_SettingsCannotSave = "Не вдалося зберегти настройки."; +Strings.OfficeOM.L_DataWriteReminder = "Нагадування про записування даних"; +Strings.OfficeOM.L_InvalidBinding = "Неприпустиме зв’язування"; +Strings.OfficeOM.L_InvalidSetColumns = "Указані стовпці неприпустимі."; +Strings.OfficeOM.L_BindingCreationError = "Помилка створення зв’язування"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Значення перебуває за межами припустимого діапазону."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Поточне виділення несумісне з указаним типом приведення."; +Strings.OfficeOM.L_InvalidBindingError = "Помилка неприпустимого зв’язування"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Указані значення startRow або startColumn неприпустимі."; +Strings.OfficeOM.L_InvalidSetRows = "Указані рядки неприпустимі."; +Strings.OfficeOM.L_NetworkProblem = "Проблема мережі"; +Strings.OfficeOM.L_CannotWriteToSelection = "Не вдалося записати до поточного виділення."; +Strings.OfficeOM.L_MissingParameter = "Відсутній параметр"; +Strings.OfficeOM.L_IndexOutOfRange = "Індекс перебуває за межами діапазону."; +Strings.OfficeOM.L_SettingsStaleError = "Помилка застарілих настройок"; +Strings.OfficeOM.L_CannotNavigateTo = "Об’єкт розташовано там, де не підтримується навігація."; +Strings.OfficeOM.L_ReadSettingsError = "Помилка читання настройок"; +Strings.OfficeOM.L_InvalidGetColumns = "Указані стовпці неприпустимі."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Указаний тип приведення не підтримується."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Застосунок {0} не існує. Не вдалося викликати службу Microsoft.Office.WebExtension.initialize(reason)."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Не вдалося виконати операцію встановлення, тому що наданий об’єкт даних перезапише або зсуне дані."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Значення індексу рядка перебуває за межами припустимого діапазону. Укажіть значення (0 або більше), менше кількості рядків."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Указаний рядок порожній."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Значення індексу стовпця перебуває за межами припустимого діапазону. Укажіть значення (0 або більше), менше кількості стовпців."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Непідтримуване перелічення"; +Strings.OfficeOM.L_InvalidParameters = "Функція {0} має неприпустимі параметри."; +Strings.OfficeOM.L_SetDataParametersConflict = "Указані параметри конфліктують."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Виконайте команду closeAsync для поточного файлу, перш ніж отримати наступний."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Тип указаного об’єкта даних несумісний із поточним виділенням."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Перелічення не підтримується в поточному хост-застосунку."; +Strings.OfficeOM.L_InvalidCoercion = "Неприпустимий тип приведення"; +Strings.OfficeOM.L_NotSupportedEventType = "Указаний тип події {0} не підтримується."; +Strings.OfficeOM.L_UnsupportedDataObject = "Наданий тип об’єкта даних не підтримується."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Запитаний набір даних завеликий."; +Strings.OfficeOM.L_AppNameNotExist = "Застосунок для {0} не існує."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Зробіть вибір."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Знайдено кілька об’єктів з однаковим іменем."; +Strings.OfficeOM.L_InvalidCellsValue = "Принаймні один параметр клітинок має неприпустиме значення. Перевірте значення і спробуйте ще раз."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Указаний об’єкт даних несумісний із типом зв’язування."; +Strings.OfficeOM.L_InvalidFormatValue = "Принаймні один параметр формату має неприпустиме значення. Перевірте значення і спробуйте ще раз."; +Strings.OfficeOM.L_NotSupportedBindingType = "Указаний тип зв’язування {0} не підтримується."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js ще не повністю завантажено. Повторіть спробу пізніше або переконайтеся, що ви додали код ініціалізації до функції Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Нагадування про форматування"; +Strings.OfficeOM.L_ShuttingDown = "Не вдалося виконати операцію, тому що дані на сервері застаріли."; +Strings.OfficeOM.L_OperationNotSupported = "Операція не підтримується."; +Strings.OfficeOM.L_DocumentReadOnly = "Операція, на яку створено запит, заборонена для поточного режиму документа."; +Strings.OfficeOM.L_NamedItemNotFound = "Іменований елемент не існує."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Неприпустимий виклик API для поточного контексту."; +Strings.OfficeOM.L_InvalidGetRows = "Указані рядки неприпустимі."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Примітка: рекомендована кількість наборів форматування, створених за допомогою виклику API форматування, – не більше 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Дочекайтеся завершення попереднього виклику."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Указаний об’єкт даних завеликий."; +Strings.OfficeOM.L_DataWriteError = "Помилка записування даних"; +Strings.OfficeOM.L_InvalidBindingOperation = "Неприпустима операція зв’язування"; +Strings.OfficeOM.L_APICallFailed = "Не вдалося здійснити виклик API"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "Указаний ідентифікатор не існує."; +Strings.OfficeOM.L_FunctionCallFailed = "Не вдалося викликати функцію {0}. Код помилки: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Наданий об’єкт даних не відповідає розміру поточного виділення."; +Strings.OfficeOM.L_SaveSettingsError = "Помилка збереження настройок"; +Strings.OfficeOM.L_RequestTokenUnavailable = "Цей API настроєно, щоб знизити частоту викликів."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Указані значення startRow або startColumn неприпустимі."; +Strings.OfficeOM.L_InvalidFormat = "Помилка неприпустимого формату"; +Strings.OfficeOM.L_BindingNotExist = "Указане зв’язування не існує."; +Strings.OfficeOM.L_SettingNameNotExist = "Указана назва параметра не існує."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Не вдалося додати обробник подій."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Цей браузер не підтримує запитаний API."; +Strings.OfficeOM.L_InvalidAPICall = "Неприпустимий виклик API"; +Strings.OfficeOM.L_EventRegistrationError = "Помилка реєстрації події"; +Strings.OfficeOM.L_ElementMissing = "Не вдалося відформатувати клітинку таблиці, оскільки відсутні деякі значення параметрів. Перевірте параметри та спробуйте ще раз."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Параметри координати не підлягають використанню з таблицею типу приведення, коли вона містить злиті клітинки."; +Strings.OfficeOM.L_NavOutOfBound = "Не вдалося виконати операцію, оскільки індекс поза межами діапазону."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Зворотній виклик не можна вказати одночасно у списку аргументів і як додатковий об’єкт."; +Strings.OfficeOM.L_CustomXmlError = "Помилка настроюваного XML."; +Strings.OfficeOM.L_SettingsAreStale = "Не вдалося зберегти настройки, тому що вони застаріли."; +Strings.OfficeOM.L_TooManyOptionalFunction = "у списку параметрів кілька необов’язкових функцій"; +Strings.OfficeOM.L_MissingRequiredArguments = "відсутні кілька обов’язкових аргументів"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Параметри координати не підлягають використанню з таблицею типу приведення, коли вона містить злиті клітинки."; +Strings.OfficeOM.L_HostError = "Помилка хоста"; +Strings.OfficeOM.L_OutOfRange = "За межами діапазону"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Неможливо створити зв’язування з поточним виділенням і вказаним типом."; +Strings.OfficeOM.L_TooManyOptionalObjects = "у списку параметрів кілька необов’язкових об’єктів"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Вибраний вміст має бути у форматі таблиці. Відформатуйте дані як таблицю та повторіть спробу."; +Strings.OfficeOM.L_APINotSupported = "API не підтримується"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Указаний розмір роздільника не підтримується."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Не вдалося видалити обробник подій."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Переривчасті виділення не підтримуються."; +Strings.OfficeOM.L_DataReadError = "Помилка читання даних"; +Strings.OfficeOM.L_InternalErrorDescription = "Сталася внутрішня помилка."; +Strings.OfficeOM.L_InvalidDataFormat = "Неприпустимий формат указаного об’єкта даних."; +Strings.OfficeOM.L_RequestTimeout = "Виклик тривав занадто довго, тому не вдалося його виконати."; +Strings.OfficeOM.L_DataStale = "Дані застаріли"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Поточне виділення не підтримується."; +Strings.OfficeOM.L_MemoryLimit = "Перевищено обмеження пам’яті"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Примітка: рекомендована кількість клітинок у таблиці – менше 20 000."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Принаймні один параметр tableOptions має неприпустиме значення. Перевірте значення і спробуйте ще раз."; +Strings.OfficeOM.L_PermissionDenied = "Відмовлено в дозволі"; +Strings.OfficeOM.L_InvalidDataObject = "Неприпустимий об’єкт даних"; +Strings.OfficeOM.L_UserNotSignedIn = "Ніхто з користувачів не ввійшов у службу Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Не вдалося зв’язати з поточним виділенням."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Указані стовпці неприпустимі."; +Strings.OfficeOM.L_BadSelectorString = "Переданий у селектор рядок має неприпустимий формат або не підтримується."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Указані значення rowCount або columnCount неприпустимі."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Тип OsfControl не підтримується."; +Strings.OfficeOM.L_InvalidValue = "Неприпустиме значення"; +Strings.OfficeOM.L_DataNotMatchSelection = "Наданий об’єкт даних несумісний із фігурою або розмірами поточного виділення."; +Strings.OfficeOM.L_InternalError = "Внутрішня помилка"; +Strings.OfficeOM.L_NotSupported = "Функція {0} не підтримується."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Не вдалося знайти вказаний вузол."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Указаний тип приведення несумісний з указаним типом зв’язування."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Не вдалось отримати файл через помилку мережі."; +Strings.OfficeOM.L_TooManyArguments = "забагато аргументів"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Операція не підтримується цим типом зв’язування."; +Strings.OfficeOM.L_InValidOptionalArgument = "неприпустимий необов’язковий аргумент"; +Strings.OfficeOM.L_FileTypeNotSupported = "Указаний тип файлу не підтримується."; +Strings.OfficeOM.L_GetDataParametersConflict = "Указані параметри конфліктують."; +Strings.OfficeOM.L_CallbackNotAFunction = "Зворотній виклик має бути функцією, а не {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/office_strings.js new file mode 100644 index 000000000..73c36cee8 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Указаний тип зв’язування несумісний із наданим іменованим елементом.";Strings.OfficeOM.L_EventHandlerNotExist="Вказаний обробник подій не знайдено у цьому зв\\'язуванні.";Strings.OfficeOM.L_UnknownBindingType="Тип зв’язування не підтримується.";Strings.OfficeOM.L_InvalidNode="Неприпустимий вузол";Strings.OfficeOM.L_NotImplemented="Функцію {0} не виконано.";Strings.OfficeOM.L_NoCapability="У вас недостатньо дозволів для виконання цієї дії.";Strings.OfficeOM.L_SettingsCannotSave="Не вдалося зберегти настройки.";Strings.OfficeOM.L_DataWriteReminder="Нагадування про записування даних";Strings.OfficeOM.L_InvalidBinding="Неприпустиме зв’язування";Strings.OfficeOM.L_InvalidSetColumns="Указані стовпці неприпустимі.";Strings.OfficeOM.L_BindingCreationError="Помилка створення зв’язування";Strings.OfficeOM.L_FormatValueOutOfRange="Значення перебуває за межами припустимого діапазону.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Поточне виділення несумісне з указаним типом приведення.";Strings.OfficeOM.L_InvalidBindingError="Помилка неприпустимого зв’язування";Strings.OfficeOM.L_InvalidGetStartRowColumn="Указані значення startRow або startColumn неприпустимі.";Strings.OfficeOM.L_InvalidSetRows="Указані рядки неприпустимі.";Strings.OfficeOM.L_NetworkProblem="Проблема мережі";Strings.OfficeOM.L_CannotWriteToSelection="Не вдалося записати до поточного виділення.";Strings.OfficeOM.L_MissingParameter="Відсутній параметр";Strings.OfficeOM.L_IndexOutOfRange="Індекс перебуває за межами діапазону.";Strings.OfficeOM.L_SettingsStaleError="Помилка застарілих настройок";Strings.OfficeOM.L_CannotNavigateTo="Об’єкт розташовано там, де не підтримується навігація.";Strings.OfficeOM.L_ReadSettingsError="Помилка читання настройок";Strings.OfficeOM.L_InvalidGetColumns="Указані стовпці неприпустимі.";Strings.OfficeOM.L_CoercionTypeNotSupported="Указаний тип приведення не підтримується.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Застосунок {0} не існує. Не вдалося викликати службу Microsoft.Office.WebExtension.initialize(reason).";Strings.OfficeOM.L_OverwriteWorksheetData="Не вдалося виконати операцію встановлення, тому що наданий об’єкт даних перезапише або зсуне дані.";Strings.OfficeOM.L_RowIndexOutOfRange="Значення індексу рядка перебуває за межами припустимого діапазону. Укажіть значення (0 або більше), менше кількості рядків.";Strings.OfficeOM.L_InvalidReadForBlankRow="Указаний рядок порожній.";Strings.OfficeOM.L_ColIndexOutOfRange="Значення індексу стовпця перебуває за межами припустимого діапазону. Укажіть значення (0 або більше), менше кількості стовпців.";Strings.OfficeOM.L_UnsupportedEnumeration="Непідтримуване перелічення";Strings.OfficeOM.L_InvalidParameters="Функція {0} має неприпустимі параметри.";Strings.OfficeOM.L_SetDataParametersConflict="Указані параметри конфліктують.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Виконайте команду closeAsync для поточного файлу, перш ніж отримати наступний.";Strings.OfficeOM.L_DataNotMatchCoercionType="Тип указаного об’єкта даних несумісний із поточним виділенням.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Перелічення не підтримується в поточному хост-застосунку.";Strings.OfficeOM.L_InvalidCoercion="Неприпустимий тип приведення";Strings.OfficeOM.L_NotSupportedEventType="Указаний тип події {0} не підтримується.";Strings.OfficeOM.L_UnsupportedDataObject="Наданий тип об’єкта даних не підтримується.";Strings.OfficeOM.L_GetDataIsTooLarge="Запитаний набір даних завеликий.";Strings.OfficeOM.L_AppNameNotExist="Застосунок для {0} не існує.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Зробіть вибір.";Strings.OfficeOM.L_MultipleNamedItemFound="Знайдено кілька об’єктів з однаковим іменем.";Strings.OfficeOM.L_InvalidCellsValue="Принаймні один параметр клітинок має неприпустиме значення. Перевірте значення і спробуйте ще раз.";Strings.OfficeOM.L_DataNotMatchBindingType="Указаний об’єкт даних несумісний із типом зв’язування.";Strings.OfficeOM.L_InvalidFormatValue="Принаймні один параметр формату має неприпустиме значення. Перевірте значення і спробуйте ще раз.";Strings.OfficeOM.L_NotSupportedBindingType="Указаний тип зв’язування {0} не підтримується.";Strings.OfficeOM.L_InitializeNotReady="Office.js ще не повністю завантажено. Повторіть спробу пізніше або переконайтеся, що ви додали код ініціалізації до функції Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Нагадування про форматування";Strings.OfficeOM.L_ShuttingDown="Не вдалося виконати операцію, тому що дані на сервері застаріли.";Strings.OfficeOM.L_OperationNotSupported="Операція не підтримується.";Strings.OfficeOM.L_DocumentReadOnly="Операція, на яку створено запит, заборонена для поточного режиму документа.";Strings.OfficeOM.L_NamedItemNotFound="Іменований елемент не існує.";Strings.OfficeOM.L_InvalidApiCallInContext="Неприпустимий виклик API для поточного контексту.";Strings.OfficeOM.L_InvalidGetRows="Указані рядки неприпустимі.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Примітка: рекомендована кількість наборів форматування, створених за допомогою виклику API форматування, – не більше 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Дочекайтеся завершення попереднього виклику.";Strings.OfficeOM.L_SetDataIsTooLarge="Указаний об’єкт даних завеликий.";Strings.OfficeOM.L_DataWriteError="Помилка записування даних";Strings.OfficeOM.L_InvalidBindingOperation="Неприпустима операція зв’язування";Strings.OfficeOM.L_APICallFailed="Не вдалося здійснити виклик API";Strings.OfficeOM.L_SpecifiedIdNotExist="Указаний ідентифікатор не існує.";Strings.OfficeOM.L_FunctionCallFailed="Не вдалося викликати функцію {0}. Код помилки: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Наданий об’єкт даних не відповідає розміру поточного виділення.";Strings.OfficeOM.L_SaveSettingsError="Помилка збереження настройок";Strings.OfficeOM.L_RequestTokenUnavailable="Цей API настроєно, щоб знизити частоту викликів.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Указані значення startRow або startColumn неприпустимі.";Strings.OfficeOM.L_InvalidFormat="Помилка неприпустимого формату";Strings.OfficeOM.L_BindingNotExist="Указане зв’язування не існує.";Strings.OfficeOM.L_SettingNameNotExist="Указана назва параметра не існує.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Не вдалося додати обробник подій.";Strings.OfficeOM.L_BrowserAPINotSupported="Цей браузер не підтримує запитаний API.";Strings.OfficeOM.L_InvalidAPICall="Неприпустимий виклик API";Strings.OfficeOM.L_EventRegistrationError="Помилка реєстрації події";Strings.OfficeOM.L_ElementMissing="Не вдалося відформатувати клітинку таблиці, оскільки відсутні деякі значення параметрів. Перевірте параметри та спробуйте ще раз.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Параметри координати не підлягають використанню з таблицею типу приведення, коли вона містить злиті клітинки.";Strings.OfficeOM.L_NavOutOfBound="Не вдалося виконати операцію, оскільки індекс поза межами діапазону.";Strings.OfficeOM.L_RedundantCallbackSpecification="Зворотній виклик не можна вказати одночасно у списку аргументів і як додатковий об’єкт.";Strings.OfficeOM.L_CustomXmlError="Помилка настроюваного XML.";Strings.OfficeOM.L_SettingsAreStale="Не вдалося зберегти настройки, тому що вони застаріли.";Strings.OfficeOM.L_TooManyOptionalFunction="у списку параметрів кілька необов’язкових функцій";Strings.OfficeOM.L_MissingRequiredArguments="відсутні кілька обов’язкових аргументів";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Параметри координати не підлягають використанню з таблицею типу приведення, коли вона містить злиті клітинки.";Strings.OfficeOM.L_HostError="Помилка хоста";Strings.OfficeOM.L_OutOfRange="За межами діапазону";Strings.OfficeOM.L_InvalidSelectionForBindingType="Неможливо створити зв’язування з поточним виділенням і вказаним типом.";Strings.OfficeOM.L_TooManyOptionalObjects="у списку параметрів кілька необов’язкових об’єктів";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Вибраний вміст має бути у форматі таблиці. Відформатуйте дані як таблицю та повторіть спробу.";Strings.OfficeOM.L_APINotSupported="API не підтримується";Strings.OfficeOM.L_SliceSizeNotSupported="Указаний розмір роздільника не підтримується.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Не вдалося видалити обробник подій.";Strings.OfficeOM.L_BindingToMultipleSelection="Переривчасті виділення не підтримуються.";Strings.OfficeOM.L_DataReadError="Помилка читання даних";Strings.OfficeOM.L_InternalErrorDescription="Сталася внутрішня помилка.";Strings.OfficeOM.L_InvalidDataFormat="Неприпустимий формат указаного об’єкта даних.";Strings.OfficeOM.L_RequestTimeout="Виклик тривав занадто довго, тому не вдалося його виконати.";Strings.OfficeOM.L_DataStale="Дані застаріли";Strings.OfficeOM.L_GetSelectionNotSupported="Поточне виділення не підтримується.";Strings.OfficeOM.L_MemoryLimit="Перевищено обмеження пам’яті";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Примітка: рекомендована кількість клітинок у таблиці – менше 20 000.";Strings.OfficeOM.L_InvalidTableOptionValue="Принаймні один параметр tableOptions має неприпустиме значення. Перевірте значення і спробуйте ще раз.";Strings.OfficeOM.L_PermissionDenied="Відмовлено в дозволі";Strings.OfficeOM.L_InvalidDataObject="Неприпустимий об’єкт даних";Strings.OfficeOM.L_UserNotSignedIn="Ніхто з користувачів не ввійшов у службу Office.";Strings.OfficeOM.L_SelectionCannotBound="Не вдалося зв’язати з поточним виділенням.";Strings.OfficeOM.L_InvalidColumnsForBinding="Указані стовпці неприпустимі.";Strings.OfficeOM.L_BadSelectorString="Переданий у селектор рядок має неприпустимий формат або не підтримується.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Указані значення rowCount або columnCount неприпустимі.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Тип OsfControl не підтримується.";Strings.OfficeOM.L_InvalidValue="Неприпустиме значення";Strings.OfficeOM.L_DataNotMatchSelection="Наданий об’єкт даних несумісний із фігурою або розмірами поточного виділення.";Strings.OfficeOM.L_InternalError="Внутрішня помилка";Strings.OfficeOM.L_NotSupported="Функція {0} не підтримується.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Не вдалося знайти вказаний вузол.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Указаний тип приведення несумісний з указаним типом зв’язування.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Не вдалось отримати файл через помилку мережі.";Strings.OfficeOM.L_TooManyArguments="забагато аргументів";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Операція не підтримується цим типом зв’язування.";Strings.OfficeOM.L_InValidOptionalArgument="неприпустимий необов’язковий аргумент";Strings.OfficeOM.L_FileTypeNotSupported="Указаний тип файлу не підтримується.";Strings.OfficeOM.L_GetDataParametersConflict="Указані параметри конфліктують.";Strings.OfficeOM.L_CallbackNotAFunction="Зворотній виклик має бути функцією, а не {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/outlook_strings.debug.js new file mode 100644 index 000000000..5e404e6ae --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Вкладення не можна видалити, оскільки вкладення з індексом не вдалося знайти."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Розмір запиту перевищує максимально дозволений – 1 МБ. Змініть свій запит EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = 'Для виклику методу "{0}" потрібен дозвіл вищого рівня.'; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Помилка вкладення"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Дата завершення передує даті початку."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Принаймні одне вказане коротке ім’я задовге."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Загальна кількість одержувачів у полі не має перевищувати {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Не вдалося очистити HTML."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Помилка записування даних"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Для доступу до захищених учасників інтерфейсу API JavaScript для Office потрібен дозвіл вищого рівня."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Вкладення не можна додати, оскільки повідомлення вже містить максимальну кількість вкладень"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Помилка внутрішнього протоколу: {0}."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Користувач видалив вкладення до завершення передавання."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Зміщення для цієї позначки часу не знайдено."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Вкладення не можна додати, оскільки воно завелике."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Час завершення не може передувати часу початку."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Указані параметри не відповідають припустимому формату."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Вкладення не можна додати до цього елемента."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Не вказано жодного припустимого одержувача."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "Неприпустимий ідентифікатор вкладення."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Вкладення не можна додавати, коли із сервера отримуються повна відповідь або переслане повідомлення."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Принаймні одна вказана адреса електронної пошти задовга."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Неприпустимий шлях до вкладення."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Вкладення не можна видалити з елемента."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Сталася помилка, пов’язана із внутрішнім форматом."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Введене значення не відповідає припустимій даті."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Вставляючи дані, користувач змінив положення курсору." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/outlook_strings.js new file mode 100644 index 000000000..aae106dbf --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/uk-ua/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Вкладення не можна видалити, оскільки вкладення з індексом не вдалося знайти.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Розмір запиту перевищує максимально дозволений – 1 МБ. Змініть свій запит EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text='Для виклику методу "{0}" потрібен дозвіл вищого рівня.';_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Помилка вкладення";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Дата завершення передує даті початку.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Принаймні одне вказане коротке ім’я задовге.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Загальна кількість одержувачів у полі не має перевищувати {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Не вдалося очистити HTML.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Помилка записування даних";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Для доступу до захищених учасників інтерфейсу API JavaScript для Office потрібен дозвіл вищого рівня.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Вкладення не можна додати, оскільки повідомлення вже містить максимальну кількість вкладень";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Помилка внутрішнього протоколу: {0}.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Користувач видалив вкладення до завершення передавання.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Зміщення для цієї позначки часу не знайдено.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Вкладення не можна додати, оскільки воно завелике.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Час завершення не може передувати часу початку.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Указані параметри не відповідають припустимому формату.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Вкладення не можна додати до цього елемента.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Не вказано жодного припустимого одержувача.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="Неприпустимий ідентифікатор вкладення.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Вкладення не можна додавати, коли із сервера отримуються повна відповідь або переслане повідомлення.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Принаймні одна вказана адреса електронної пошти задовга.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Неприпустимий шлях до вкладення.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Вкладення не можна видалити з елемента.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Сталася помилка, пов’язана із внутрішнім форматом.";_u.ExtensibilityStrings.l_InvalidDate_Text="Введене значення не відповідає припустимій даті.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Вставляючи дані, користувач змінив положення курсору." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/office_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/office_strings.debug.js new file mode 100644 index 000000000..ba1ef36fb --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/office_strings.debug.js @@ -0,0 +1,128 @@ + +Type.registerNamespace("Strings"); +Strings.OfficeOM = function() +{ +}; +Strings.OfficeOM.registerClass("Strings.OfficeOM"); +Strings.OfficeOM.L_InvalidNamedItemForBindingType = "Kiểu ghép nối đã xác định không tương thích với mục được đặt tên đã cung cấp."; +Strings.OfficeOM.L_EventHandlerNotExist = "Không tìm thấy bộ xử lý biến cố xác định cho gắn kết này."; +Strings.OfficeOM.L_UnknownBindingType = "Kiểu ghép nối không được hỗ trợ."; +Strings.OfficeOM.L_InvalidNode = "Nút Không hợp lệ"; +Strings.OfficeOM.L_NotImplemented = "Hàm {0} chưa được triển khai."; +Strings.OfficeOM.L_NoCapability = "Bạn không có đủ quyền cho hành động này."; +Strings.OfficeOM.L_SettingsCannotSave = "Không thể lưu thiết đặt."; +Strings.OfficeOM.L_DataWriteReminder = "Lời nhắc Viết Dữ liệu"; +Strings.OfficeOM.L_InvalidBinding = "Ghép nối Không hợp lệ"; +Strings.OfficeOM.L_InvalidSetColumns = "Các cột đã xác định không hợp lệ."; +Strings.OfficeOM.L_BindingCreationError = "Lỗi Tạo Ghép nối"; +Strings.OfficeOM.L_FormatValueOutOfRange = "Giá trị nằm ngoài khoảng cho phép."; +Strings.OfficeOM.L_SelectionNotSupportCoercionType = "Lựa chọn hiện tại không tương thích với kiểu ép buộc đã xác định."; +Strings.OfficeOM.L_InvalidBindingError = "Lỗi Ghép nối Không hợp lệ"; +Strings.OfficeOM.L_InvalidGetStartRowColumn = "Giá trị startRow hoặc startColumn đã xác định không hợp lệ."; +Strings.OfficeOM.L_InvalidSetRows = "Các hàng đã xác định không hợp lệ."; +Strings.OfficeOM.L_NetworkProblem = "Vấn đề về Mạng"; +Strings.OfficeOM.L_CannotWriteToSelection = "Không thể ghi vào lựa chọn hiện tại."; +Strings.OfficeOM.L_MissingParameter = "Thiếu Tham số"; +Strings.OfficeOM.L_IndexOutOfRange = "Chỉ mục ngoài phạm vi."; +Strings.OfficeOM.L_SettingsStaleError = "Lỗi Thiết đặt Cũ"; +Strings.OfficeOM.L_CannotNavigateTo = "Đối tượng nằm ở vị trí không hỗ trợ dẫn hướng."; +Strings.OfficeOM.L_ReadSettingsError = "Lỗi Thiết đặt Đọc"; +Strings.OfficeOM.L_InvalidGetColumns = "Các cột đã xác định không hợp lệ."; +Strings.OfficeOM.L_CoercionTypeNotSupported = "Kiểu ép buộc đã xác định không được hỗ trợ."; +Strings.OfficeOM.L_AppNotExistInitializeNotCalled = "Ứng dụng {0} không tồn tại. Microsoft.Office.WebExtension.initialize(reason) không được gọi."; +Strings.OfficeOM.L_OverwriteWorksheetData = "Thao tác được đặt bị lỗi vì đối tượng dữ liệu được cung cấp sẽ ghi đè hoặc thay đổi dữ liệu."; +Strings.OfficeOM.L_RowIndexOutOfRange = "Giá trị chỉ mục dòng nằm ngoài phạm vi cho phép. Hãy sử dụng một giá trị (0 hoặc cao hơn) và nhỏ hơn số lượng hàng."; +Strings.OfficeOM.L_InvalidReadForBlankRow = "Dòng đã nêu trống."; +Strings.OfficeOM.L_ColIndexOutOfRange = "Giá trị chỉ mục cột nằm ngoài phạm vi cho phép. Hãy sử dụng một giá trị (0 hoặc cao hơn) và bé hơn số lượng cột."; +Strings.OfficeOM.L_UnsupportedEnumeration = "Liệt kê Không được hỗ trợ"; +Strings.OfficeOM.L_InvalidParameters = "Hàm {0} có các tham số không hợp lệ."; +Strings.OfficeOM.L_SetDataParametersConflict = "Các tham biến đã xác định có xung đột."; +Strings.OfficeOM.L_CloseFileBeforeRetrieve = "Gọi closeAsync trên Tệp hiện tại trước khi truy xuất tệp khác."; +Strings.OfficeOM.L_DataNotMatchCoercionType = "Kiểu đối tượng dữ liệu đã xác định không tương thích với lựa chọn hiện tại."; +Strings.OfficeOM.L_UnsupportedEnumerationMessage = "Liệt kê không được hỗ trợ trong ứng dụng máy chủ hiện tại."; +Strings.OfficeOM.L_InvalidCoercion = "Kiểu Ép buộc Không hợp lệ"; +Strings.OfficeOM.L_NotSupportedEventType = "Không hỗ trợ kiểu sự kiện {0} đã xác định."; +Strings.OfficeOM.L_UnsupportedDataObject = "Kiểu đối tượng dữ liệu được cung cấp không được hỗ trợ."; +Strings.OfficeOM.L_GetDataIsTooLarge = "Bộ dữ liệu được yêu cầu quá lớn."; +Strings.OfficeOM.L_AppNameNotExist = "AppName cho {0} không tồn tại."; +Strings.OfficeOM.L_AddBindingFromPromptDefaultText = "Vui lòng chọn."; +Strings.OfficeOM.L_MultipleNamedItemFound = "Đã tìm thấy nhiều đối tượng có cùng tên."; +Strings.OfficeOM.L_InvalidCellsValue = "Một hoặc nhiều tham số ô có chứa giá trị không được phép. Hãy kiểm tra kép các giá trị rồi thử lại."; +Strings.OfficeOM.L_DataNotMatchBindingType = "Dữ liệu đã định không tương thích với kiểu ghép nối."; +Strings.OfficeOM.L_InvalidFormatValue = "Một hoặc nhiều tham số định dạng có chứa giá trị không được phép. Hãy kiểm tra kép các giá trị rồi thử lại."; +Strings.OfficeOM.L_NotSupportedBindingType = "Không hỗ trợ kiểu ghép nối {0} đã xác định."; +Strings.OfficeOM.L_InitializeNotReady = "Office.js chưa được tải hết. Vui lòng thử lại sau hoặc đảm bảo thêm mã khởi tạo vào hàm Office.initialize."; +Strings.OfficeOM.L_FormattingReminder = "Định dạng Lời nhắc"; +Strings.OfficeOM.L_ShuttingDown = "Thao tác bị lỗi vì dữ liệu không phải là mới nhất trên máy chủ."; +Strings.OfficeOM.L_OperationNotSupported = "Thao tác không được hỗ trợ."; +Strings.OfficeOM.L_DocumentReadOnly = "Không cho phép thao tác yêu cầu ở chế độ tài liệu hiện tại."; +Strings.OfficeOM.L_NamedItemNotFound = "Mục được đặt tên không tồn tại."; +Strings.OfficeOM.L_InvalidApiCallInContext = "Lệnh gọi API không hợp lệ trong ngữ cảnh hiện tại."; +Strings.OfficeOM.L_InvalidGetRows = "Các hàng đã xác định không hợp lệ."; +Strings.OfficeOM.L_CellFormatAmountBeyondLimits = "Lưu ý: Bộ định dạng do lệnh gọi Định dạng API thiết lập được đề nghị để dưới 100."; +Strings.OfficeOM.L_TooManyIncompleteRequests = "Chờ đến khi cuộc gọi trước hoàn tất."; +Strings.OfficeOM.L_SetDataIsTooLarge = "Đối tượng dữ liệu đã xác định quá lớn."; +Strings.OfficeOM.L_DataWriteError = "Lỗi Ghi Dữ liệu"; +Strings.OfficeOM.L_InvalidBindingOperation = "Thao tác Ghép nối Không hợp lệ"; +Strings.OfficeOM.L_APICallFailed = "Gọi API Không thành công"; +Strings.OfficeOM.L_SpecifiedIdNotExist = "ID đã xác định không tồn tại."; +Strings.OfficeOM.L_FunctionCallFailed = "Lệnh gọi hàm {0} không thành công, mã lỗi: {1}."; +Strings.OfficeOM.L_DataNotMatchBindingSize = "Đối tượng dữ liệu được cung cấp không khớp với kích cỡ của lựa chọn hiện tại."; +Strings.OfficeOM.L_SaveSettingsError = "Lỗi Thiết đặt Lưu"; +Strings.OfficeOM.L_RequestTokenUnavailable = "API này đã được giới hạn để làm chậm tần số cuộc gọi."; +Strings.OfficeOM.L_InvalidSetStartRowColumn = "Giá trị startRow hoặc startColumn đã xác định không hợp lệ."; +Strings.OfficeOM.L_InvalidFormat = "Lỗi Định dạng Không hợp lệ"; +Strings.OfficeOM.L_BindingNotExist = "Kết ghép đã xác định không tồn tại."; +Strings.OfficeOM.L_SettingNameNotExist = "Tên thiết đặt đã xác định không tồn tại."; +Strings.OfficeOM.L_EventHandlerAdditionFailed = "Không thể thêm trình xử lý sự kiện."; +Strings.OfficeOM.L_BrowserAPINotSupported = "Trình duyệt này không hỗ trợ API được yêu cầu."; +Strings.OfficeOM.L_InvalidAPICall = "Lệnh gọi API Không hợp lệ"; +Strings.OfficeOM.L_EventRegistrationError = "Lỗi Đăng ký Sự kiện"; +Strings.OfficeOM.L_ElementMissing = "Chúng tôi không thể định dạng ô bảng bởi vì một vài giá trị tham số bị thiếu. Hãy kiểm tra kép các tham số rồi thử lại."; +Strings.OfficeOM.L_NonUniformPartialSetNotSupported = "Không thể dùng thông số tọa độ với Bảng kiểu ép buộc khi bảng chứa các ô được kết hợp."; +Strings.OfficeOM.L_NavOutOfBound = "Thao tác thất bại do chỉ mục nằm ngoài phạm vi."; +Strings.OfficeOM.L_RedundantCallbackSpecification = "Gọi lại không thể được xác định trong cả danh sách đối số và đối tượng tùy chọn."; +Strings.OfficeOM.L_CustomXmlError = "Lỗi XML Tùy chỉnh."; +Strings.OfficeOM.L_SettingsAreStale = "Không thể lưu thiết đặt vì chúng không phải là mới nhất."; +Strings.OfficeOM.L_TooManyOptionalFunction = "nhiều chức năng tùy chọn trong danh sách tham số"; +Strings.OfficeOM.L_MissingRequiredArguments = "thiếu một số đối số bắt buộc"; +Strings.OfficeOM.L_NonUniformPartialGetNotSupported = "Không thể dùng thông số tọa độ với Bảng kiểu ép buộc khi bảng chứa các ô được kết hợp."; +Strings.OfficeOM.L_HostError = "Lỗi Máy chủ"; +Strings.OfficeOM.L_OutOfRange = "Ngoài Phạm vi"; +Strings.OfficeOM.L_InvalidSelectionForBindingType = "Không thể tạo ghép nối với lựa chọn hiện tại và kiểu ghép nối đã xác định."; +Strings.OfficeOM.L_TooManyOptionalObjects = "nhiều đối tượng tùy chọn trong danh sách tham số"; +Strings.OfficeOM.L_OperationNotSupportedOnMatrixData = "Nội dung được chọn phải ở định dạng bảng. Hãy định dạng dữ liệu dưới dạng bảng và thử lại."; +Strings.OfficeOM.L_APINotSupported = "API Không được Hỗ trợ"; +Strings.OfficeOM.L_SliceSizeNotSupported = "Kích thước lát cắt đã chỉ định không được hỗ trợ."; +Strings.OfficeOM.L_EventHandlerRemovalFailed = "Không thể loại bỏ trình xử lý sự kiện."; +Strings.OfficeOM.L_BindingToMultipleSelection = "Không hỗ trợ lựa chọn không liền nhau."; +Strings.OfficeOM.L_DataReadError = "Lỗi Đọc Dữ liệu"; +Strings.OfficeOM.L_InternalErrorDescription = "Đã xuất hiện lỗi nội bộ."; +Strings.OfficeOM.L_InvalidDataFormat = "Định dạng của đối tượng dữ liệu đã xác định không hợp lệ."; +Strings.OfficeOM.L_RequestTimeout = "Cuộc gọi mất quá lâu để thực hiện."; +Strings.OfficeOM.L_DataStale = "Dữ liệu Không Cập nhật"; +Strings.OfficeOM.L_GetSelectionNotSupported = "Lựa chọn hiện tại không được hỗ trợ."; +Strings.OfficeOM.L_MemoryLimit = "Vượt quá Giới hạn Bộ nhớ"; +Strings.OfficeOM.L_CellDataAmountBeyondLimits = "Lưu ý: Số lượng ô trong một bảng được đề nghị để dưới 20.000 ô."; +Strings.OfficeOM.L_InvalidTableOptionValue = "Một hoặc nhiều tham số tableOption có chứa giá trị không được phép. Hãy kiểm tra kép các giá trị rồi thử lại."; +Strings.OfficeOM.L_PermissionDenied = "Từ chối Quyền"; +Strings.OfficeOM.L_InvalidDataObject = "Đối tượng Dữ liệu Không hợp lệ"; +Strings.OfficeOM.L_UserNotSignedIn = "Không có người dùng nào đăng nhập vào Office."; +Strings.OfficeOM.L_SelectionCannotBound = "Không thể ghép nối với lựa chọn hiện tại."; +Strings.OfficeOM.L_InvalidColumnsForBinding = "Các cột đã xác định không hợp lệ."; +Strings.OfficeOM.L_BadSelectorString = "Chuỗi được chuyển vào công cụ chọn không được định dạng đúng hoặc không được hỗ trợ."; +Strings.OfficeOM.L_InvalidGetRowColumnCounts = "Giá trị rowCount hoặc columnCount đã xác định không hợp lệ."; +Strings.OfficeOM.L_OsfControlTypeNotSupported = "Kiểu OsfControl không được hỗ trợ."; +Strings.OfficeOM.L_InvalidValue = "Giá trị Không hợp lệ"; +Strings.OfficeOM.L_DataNotMatchSelection = "Đối tượng dữ liệu được cung cấp không tương thích với hình dạng hoặc kích thước của lựa chọn hiện tại."; +Strings.OfficeOM.L_InternalError = "Lỗi Nội bộ"; +Strings.OfficeOM.L_NotSupported = "Hàm {0} không được hỗ trợ."; +Strings.OfficeOM.L_CustomXmlNodeNotFound = "Không tìm thấy nút đã xác định."; +Strings.OfficeOM.L_CoercionTypeNotMatchBinding = "Kiểu ép buộc đã xác định không tương thích với kiểu ghép nối này."; +Strings.OfficeOM.L_NetworkProblemRetrieveFile = "Sự cố mạng đã không cho truy xuất tệp."; +Strings.OfficeOM.L_TooManyArguments = "quá nhiều đối số"; +Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType = "Thao tác không được hỗ trợ trên kiểu ghép nối này."; +Strings.OfficeOM.L_InValidOptionalArgument = "đối số tùy chọn không hợp lệ"; +Strings.OfficeOM.L_FileTypeNotSupported = "Loại tệp đã chỉ định không được hỗ trợ."; +Strings.OfficeOM.L_GetDataParametersConflict = "Các tham biến đã xác định có xung đột."; +Strings.OfficeOM.L_CallbackNotAFunction = "Gọi lại phải là chức năng kiểu, thuộc kiểu {0}." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/office_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/office_strings.js new file mode 100644 index 000000000..12dce9aa5 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/office_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("Strings");Strings.OfficeOM=function(){};Strings.OfficeOM.registerClass("Strings.OfficeOM");Strings.OfficeOM.L_InvalidNamedItemForBindingType="Kiểu ghép nối đã xác định không tương thích với mục được đặt tên đã cung cấp.";Strings.OfficeOM.L_EventHandlerNotExist="Không tìm thấy bộ xử lý biến cố xác định cho gắn kết này.";Strings.OfficeOM.L_UnknownBindingType="Kiểu ghép nối không được hỗ trợ.";Strings.OfficeOM.L_InvalidNode="Nút Không hợp lệ";Strings.OfficeOM.L_NotImplemented="Hàm {0} chưa được triển khai.";Strings.OfficeOM.L_NoCapability="Bạn không có đủ quyền cho hành động này.";Strings.OfficeOM.L_SettingsCannotSave="Không thể lưu thiết đặt.";Strings.OfficeOM.L_DataWriteReminder="Lời nhắc Viết Dữ liệu";Strings.OfficeOM.L_InvalidBinding="Ghép nối Không hợp lệ";Strings.OfficeOM.L_InvalidSetColumns="Các cột đã xác định không hợp lệ.";Strings.OfficeOM.L_BindingCreationError="Lỗi Tạo Ghép nối";Strings.OfficeOM.L_FormatValueOutOfRange="Giá trị nằm ngoài khoảng cho phép.";Strings.OfficeOM.L_SelectionNotSupportCoercionType="Lựa chọn hiện tại không tương thích với kiểu ép buộc đã xác định.";Strings.OfficeOM.L_InvalidBindingError="Lỗi Ghép nối Không hợp lệ";Strings.OfficeOM.L_InvalidGetStartRowColumn="Giá trị startRow hoặc startColumn đã xác định không hợp lệ.";Strings.OfficeOM.L_InvalidSetRows="Các hàng đã xác định không hợp lệ.";Strings.OfficeOM.L_NetworkProblem="Vấn đề về Mạng";Strings.OfficeOM.L_CannotWriteToSelection="Không thể ghi vào lựa chọn hiện tại.";Strings.OfficeOM.L_MissingParameter="Thiếu Tham số";Strings.OfficeOM.L_IndexOutOfRange="Chỉ mục ngoài phạm vi.";Strings.OfficeOM.L_SettingsStaleError="Lỗi Thiết đặt Cũ";Strings.OfficeOM.L_CannotNavigateTo="Đối tượng nằm ở vị trí không hỗ trợ dẫn hướng.";Strings.OfficeOM.L_ReadSettingsError="Lỗi Thiết đặt Đọc";Strings.OfficeOM.L_InvalidGetColumns="Các cột đã xác định không hợp lệ.";Strings.OfficeOM.L_CoercionTypeNotSupported="Kiểu ép buộc đã xác định không được hỗ trợ.";Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Ứng dụng {0} không tồn tại. Microsoft.Office.WebExtension.initialize(reason) không được gọi.";Strings.OfficeOM.L_OverwriteWorksheetData="Thao tác được đặt bị lỗi vì đối tượng dữ liệu được cung cấp sẽ ghi đè hoặc thay đổi dữ liệu.";Strings.OfficeOM.L_RowIndexOutOfRange="Giá trị chỉ mục dòng nằm ngoài phạm vi cho phép. Hãy sử dụng một giá trị (0 hoặc cao hơn) và nhỏ hơn số lượng hàng.";Strings.OfficeOM.L_InvalidReadForBlankRow="Dòng đã nêu trống.";Strings.OfficeOM.L_ColIndexOutOfRange="Giá trị chỉ mục cột nằm ngoài phạm vi cho phép. Hãy sử dụng một giá trị (0 hoặc cao hơn) và bé hơn số lượng cột.";Strings.OfficeOM.L_UnsupportedEnumeration="Liệt kê Không được hỗ trợ";Strings.OfficeOM.L_InvalidParameters="Hàm {0} có các tham số không hợp lệ.";Strings.OfficeOM.L_SetDataParametersConflict="Các tham biến đã xác định có xung đột.";Strings.OfficeOM.L_CloseFileBeforeRetrieve="Gọi closeAsync trên Tệp hiện tại trước khi truy xuất tệp khác.";Strings.OfficeOM.L_DataNotMatchCoercionType="Kiểu đối tượng dữ liệu đã xác định không tương thích với lựa chọn hiện tại.";Strings.OfficeOM.L_UnsupportedEnumerationMessage="Liệt kê không được hỗ trợ trong ứng dụng máy chủ hiện tại.";Strings.OfficeOM.L_InvalidCoercion="Kiểu Ép buộc Không hợp lệ";Strings.OfficeOM.L_NotSupportedEventType="Không hỗ trợ kiểu sự kiện {0} đã xác định.";Strings.OfficeOM.L_UnsupportedDataObject="Kiểu đối tượng dữ liệu được cung cấp không được hỗ trợ.";Strings.OfficeOM.L_GetDataIsTooLarge="Bộ dữ liệu được yêu cầu quá lớn.";Strings.OfficeOM.L_AppNameNotExist="AppName cho {0} không tồn tại.";Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Vui lòng chọn.";Strings.OfficeOM.L_MultipleNamedItemFound="Đã tìm thấy nhiều đối tượng có cùng tên.";Strings.OfficeOM.L_InvalidCellsValue="Một hoặc nhiều tham số ô có chứa giá trị không được phép. Hãy kiểm tra kép các giá trị rồi thử lại.";Strings.OfficeOM.L_DataNotMatchBindingType="Dữ liệu đã định không tương thích với kiểu ghép nối.";Strings.OfficeOM.L_InvalidFormatValue="Một hoặc nhiều tham số định dạng có chứa giá trị không được phép. Hãy kiểm tra kép các giá trị rồi thử lại.";Strings.OfficeOM.L_NotSupportedBindingType="Không hỗ trợ kiểu ghép nối {0} đã xác định.";Strings.OfficeOM.L_InitializeNotReady="Office.js chưa được tải hết. Vui lòng thử lại sau hoặc đảm bảo thêm mã khởi tạo vào hàm Office.initialize.";Strings.OfficeOM.L_FormattingReminder="Định dạng Lời nhắc";Strings.OfficeOM.L_ShuttingDown="Thao tác bị lỗi vì dữ liệu không phải là mới nhất trên máy chủ.";Strings.OfficeOM.L_OperationNotSupported="Thao tác không được hỗ trợ.";Strings.OfficeOM.L_DocumentReadOnly="Không cho phép thao tác yêu cầu ở chế độ tài liệu hiện tại.";Strings.OfficeOM.L_NamedItemNotFound="Mục được đặt tên không tồn tại.";Strings.OfficeOM.L_InvalidApiCallInContext="Lệnh gọi API không hợp lệ trong ngữ cảnh hiện tại.";Strings.OfficeOM.L_InvalidGetRows="Các hàng đã xác định không hợp lệ.";Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Lưu ý: Bộ định dạng do lệnh gọi Định dạng API thiết lập được đề nghị để dưới 100.";Strings.OfficeOM.L_TooManyIncompleteRequests="Chờ đến khi cuộc gọi trước hoàn tất.";Strings.OfficeOM.L_SetDataIsTooLarge="Đối tượng dữ liệu đã xác định quá lớn.";Strings.OfficeOM.L_DataWriteError="Lỗi Ghi Dữ liệu";Strings.OfficeOM.L_InvalidBindingOperation="Thao tác Ghép nối Không hợp lệ";Strings.OfficeOM.L_APICallFailed="Gọi API Không thành công";Strings.OfficeOM.L_SpecifiedIdNotExist="ID đã xác định không tồn tại.";Strings.OfficeOM.L_FunctionCallFailed="Lệnh gọi hàm {0} không thành công, mã lỗi: {1}.";Strings.OfficeOM.L_DataNotMatchBindingSize="Đối tượng dữ liệu được cung cấp không khớp với kích cỡ của lựa chọn hiện tại.";Strings.OfficeOM.L_SaveSettingsError="Lỗi Thiết đặt Lưu";Strings.OfficeOM.L_RequestTokenUnavailable="API này đã được giới hạn để làm chậm tần số cuộc gọi.";Strings.OfficeOM.L_InvalidSetStartRowColumn="Giá trị startRow hoặc startColumn đã xác định không hợp lệ.";Strings.OfficeOM.L_InvalidFormat="Lỗi Định dạng Không hợp lệ";Strings.OfficeOM.L_BindingNotExist="Kết ghép đã xác định không tồn tại.";Strings.OfficeOM.L_SettingNameNotExist="Tên thiết đặt đã xác định không tồn tại.";Strings.OfficeOM.L_EventHandlerAdditionFailed="Không thể thêm trình xử lý sự kiện.";Strings.OfficeOM.L_BrowserAPINotSupported="Trình duyệt này không hỗ trợ API được yêu cầu.";Strings.OfficeOM.L_InvalidAPICall="Lệnh gọi API Không hợp lệ";Strings.OfficeOM.L_EventRegistrationError="Lỗi Đăng ký Sự kiện";Strings.OfficeOM.L_ElementMissing="Chúng tôi không thể định dạng ô bảng bởi vì một vài giá trị tham số bị thiếu. Hãy kiểm tra kép các tham số rồi thử lại.";Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Không thể dùng thông số tọa độ với Bảng kiểu ép buộc khi bảng chứa các ô được kết hợp.";Strings.OfficeOM.L_NavOutOfBound="Thao tác thất bại do chỉ mục nằm ngoài phạm vi.";Strings.OfficeOM.L_RedundantCallbackSpecification="Gọi lại không thể được xác định trong cả danh sách đối số và đối tượng tùy chọn.";Strings.OfficeOM.L_CustomXmlError="Lỗi XML Tùy chỉnh.";Strings.OfficeOM.L_SettingsAreStale="Không thể lưu thiết đặt vì chúng không phải là mới nhất.";Strings.OfficeOM.L_TooManyOptionalFunction="nhiều chức năng tùy chọn trong danh sách tham số";Strings.OfficeOM.L_MissingRequiredArguments="thiếu một số đối số bắt buộc";Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Không thể dùng thông số tọa độ với Bảng kiểu ép buộc khi bảng chứa các ô được kết hợp.";Strings.OfficeOM.L_HostError="Lỗi Máy chủ";Strings.OfficeOM.L_OutOfRange="Ngoài Phạm vi";Strings.OfficeOM.L_InvalidSelectionForBindingType="Không thể tạo ghép nối với lựa chọn hiện tại và kiểu ghép nối đã xác định.";Strings.OfficeOM.L_TooManyOptionalObjects="nhiều đối tượng tùy chọn trong danh sách tham số";Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Nội dung được chọn phải ở định dạng bảng. Hãy định dạng dữ liệu dưới dạng bảng và thử lại.";Strings.OfficeOM.L_APINotSupported="API Không được Hỗ trợ";Strings.OfficeOM.L_SliceSizeNotSupported="Kích thước lát cắt đã chỉ định không được hỗ trợ.";Strings.OfficeOM.L_EventHandlerRemovalFailed="Không thể loại bỏ trình xử lý sự kiện.";Strings.OfficeOM.L_BindingToMultipleSelection="Không hỗ trợ lựa chọn không liền nhau.";Strings.OfficeOM.L_DataReadError="Lỗi Đọc Dữ liệu";Strings.OfficeOM.L_InternalErrorDescription="Đã xuất hiện lỗi nội bộ.";Strings.OfficeOM.L_InvalidDataFormat="Định dạng của đối tượng dữ liệu đã xác định không hợp lệ.";Strings.OfficeOM.L_RequestTimeout="Cuộc gọi mất quá lâu để thực hiện.";Strings.OfficeOM.L_DataStale="Dữ liệu Không Cập nhật";Strings.OfficeOM.L_GetSelectionNotSupported="Lựa chọn hiện tại không được hỗ trợ.";Strings.OfficeOM.L_MemoryLimit="Vượt quá Giới hạn Bộ nhớ";Strings.OfficeOM.L_CellDataAmountBeyondLimits="Lưu ý: Số lượng ô trong một bảng được đề nghị để dưới 20.000 ô.";Strings.OfficeOM.L_InvalidTableOptionValue="Một hoặc nhiều tham số tableOption có chứa giá trị không được phép. Hãy kiểm tra kép các giá trị rồi thử lại.";Strings.OfficeOM.L_PermissionDenied="Từ chối Quyền";Strings.OfficeOM.L_InvalidDataObject="Đối tượng Dữ liệu Không hợp lệ";Strings.OfficeOM.L_UserNotSignedIn="Không có người dùng nào đăng nhập vào Office.";Strings.OfficeOM.L_SelectionCannotBound="Không thể ghép nối với lựa chọn hiện tại.";Strings.OfficeOM.L_InvalidColumnsForBinding="Các cột đã xác định không hợp lệ.";Strings.OfficeOM.L_BadSelectorString="Chuỗi được chuyển vào công cụ chọn không được định dạng đúng hoặc không được hỗ trợ.";Strings.OfficeOM.L_InvalidGetRowColumnCounts="Giá trị rowCount hoặc columnCount đã xác định không hợp lệ.";Strings.OfficeOM.L_OsfControlTypeNotSupported="Kiểu OsfControl không được hỗ trợ.";Strings.OfficeOM.L_InvalidValue="Giá trị Không hợp lệ";Strings.OfficeOM.L_DataNotMatchSelection="Đối tượng dữ liệu được cung cấp không tương thích với hình dạng hoặc kích thước của lựa chọn hiện tại.";Strings.OfficeOM.L_InternalError="Lỗi Nội bộ";Strings.OfficeOM.L_NotSupported="Hàm {0} không được hỗ trợ.";Strings.OfficeOM.L_CustomXmlNodeNotFound="Không tìm thấy nút đã xác định.";Strings.OfficeOM.L_CoercionTypeNotMatchBinding="Kiểu ép buộc đã xác định không tương thích với kiểu ghép nối này.";Strings.OfficeOM.L_NetworkProblemRetrieveFile="Sự cố mạng đã không cho truy xuất tệp.";Strings.OfficeOM.L_TooManyArguments="quá nhiều đối số";Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Thao tác không được hỗ trợ trên kiểu ghép nối này.";Strings.OfficeOM.L_InValidOptionalArgument="đối số tùy chọn không hợp lệ";Strings.OfficeOM.L_FileTypeNotSupported="Loại tệp đã chỉ định không được hỗ trợ.";Strings.OfficeOM.L_GetDataParametersConflict="Các tham biến đã xác định có xung đột.";Strings.OfficeOM.L_CallbackNotAFunction="Gọi lại phải là chức năng kiểu, thuộc kiểu {0}." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/outlook_strings.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/outlook_strings.debug.js new file mode 100644 index 000000000..1a487f333 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/outlook_strings.debug.js @@ -0,0 +1,33 @@ + +Type.registerNamespace("_u"); +_u.ExtensibilityStrings = function() +{ +}; +_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"); +_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text = "Không thể xóa phần đính kèm do không tìm thấy phần đính kèm có chỉ mục đính kèm."; +_u.ExtensibilityStrings.l_EwsRequestOversized_Text = "Yêu cầu vượt quá giới hạn kích thước 1 MB. Vui lòng thay đổi yêu cầu EWS."; +_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text = "Yêu cầu có mức quyền cáo để có thể gọi phương pháp: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentErrorName_Text = "Lỗi Phần đính kèm"; +_u.ExtensibilityStrings.l_InvalidEventDates_Text = "Ngày kết thúc xảy ra trước ngày bắt đầu."; +_u.ExtensibilityStrings.l_DisplayNameTooLong_Text = "Một hoặc nhiều tên hiển thị được cung cấp quá dài."; +_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text = "Tổng số người nhận trong trường không thể vượt quá {0}."; +_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text = "Làm sạch HTML đã thất bại."; +_u.ExtensibilityStrings.l_DataWriteErrorName_Text = "Lỗi Ghi Dữ liệu"; +_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text = "Yêu cầu có mức quyền cao để có thể truy nhập các phần tử được bảo vệ của JavaScript API cho Office."; +_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text = "Không thể thêm phần đính kèm do thư đã đạt lượng tệp đính kèm tối đa"; +_u.ExtensibilityStrings.l_InternalProtocolError_Text = "Lỗi giao thức nội bộ: '{0}'."; +_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text = "Người dùng đã loại bỏ phần đính kèm trước khi tải lên hoàn tất."; +_u.ExtensibilityStrings.l_OffsetNotfound_Text = "Không tìm thấy phần bù cho tem thời gian này."; +_u.ExtensibilityStrings.l_AttachmentExceededSize_Text = "Không thể thêm phần đính kèm do quá lớn."; +_u.ExtensibilityStrings.l_InvalidEndTime_Text = "Thời gian kết thúc không thể trước khi thời gian bắt đầu."; +_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text = "Các thông số đã cung cấp không phù hợp với các định dạng dự kiến."; +_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text = "Không thể thêm phần đính kèm vào mục."; +_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text = "Chưa có thông tin về người nhận hợp lệ."; +_u.ExtensibilityStrings.l_InvalidAttachmentId_Text = "ID phần đính kèm không hợp lệ."; +_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text = "Không thể thêm phần đính kèm trong lúc đang truy xuất trả lời đầy đủ hoặc chuyển tiếp từ máy chủ."; +_u.ExtensibilityStrings.l_EmailAddressTooLong_Text = "Một hoặc nhiều địa chỉ email được cung cấp quá dài."; +_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text = "Đường dẫn phần đính kèm không hợp lệ."; +_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text = "Không thể xóa phần đính kèm ra khỏi mục."; +_u.ExtensibilityStrings.l_InternalFormatError_Text = "Đã có lỗi định dạng nội bộ."; +_u.ExtensibilityStrings.l_InvalidDate_Text = "Đầu vào không giải quyết vào một ngày hợp lệ."; +_u.ExtensibilityStrings.l_CursorPositionChanged_Text = "Người dùng đã thay đổi vị trí của con trỏ chuột trong lúc chèn dữ liệu." diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/outlook_strings.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/outlook_strings.js new file mode 100644 index 000000000..60ade0780 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/vi-vn/outlook_strings.js @@ -0,0 +1 @@ +Type.registerNamespace("_u");_u.ExtensibilityStrings=function(){};_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings");_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="Không thể xóa phần đính kèm do không tìm thấy phần đính kèm có chỉ mục đính kèm.";_u.ExtensibilityStrings.l_EwsRequestOversized_Text="Yêu cầu vượt quá giới hạn kích thước 1 MB. Vui lòng thay đổi yêu cầu EWS.";_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Yêu cầu có mức quyền cáo để có thể gọi phương pháp: '{0}'.";_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Lỗi Phần đính kèm";_u.ExtensibilityStrings.l_InvalidEventDates_Text="Ngày kết thúc xảy ra trước ngày bắt đầu.";_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="Một hoặc nhiều tên hiển thị được cung cấp quá dài.";_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="Tổng số người nhận trong trường không thể vượt quá {0}.";_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="Làm sạch HTML đã thất bại.";_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Lỗi Ghi Dữ liệu";_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Yêu cầu có mức quyền cao để có thể truy nhập các phần tử được bảo vệ của JavaScript API cho Office.";_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Không thể thêm phần đính kèm do thư đã đạt lượng tệp đính kèm tối đa";_u.ExtensibilityStrings.l_InternalProtocolError_Text="Lỗi giao thức nội bộ: '{0}'.";_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="Người dùng đã loại bỏ phần đính kèm trước khi tải lên hoàn tất.";_u.ExtensibilityStrings.l_OffsetNotfound_Text="Không tìm thấy phần bù cho tem thời gian này.";_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="Không thể thêm phần đính kèm do quá lớn.";_u.ExtensibilityStrings.l_InvalidEndTime_Text="Thời gian kết thúc không thể trước khi thời gian bắt đầu.";_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="Các thông số đã cung cấp không phù hợp với các định dạng dự kiến.";_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="Không thể thêm phần đính kèm vào mục.";_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="Chưa có thông tin về người nhận hợp lệ.";_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="ID phần đính kèm không hợp lệ.";_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Không thể thêm phần đính kèm trong lúc đang truy xuất trả lời đầy đủ hoặc chuyển tiếp từ máy chủ.";_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="Một hoặc nhiều địa chỉ email được cung cấp quá dài.";_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="Đường dẫn phần đính kèm không hợp lệ.";_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="Không thể xóa phần đính kèm ra khỏi mục.";_u.ExtensibilityStrings.l_InternalFormatError_Text="Đã có lỗi định dạng nội bộ.";_u.ExtensibilityStrings.l_InvalidDate_Text="Đầu vào không giải quyết vào một ngày hợp lệ.";_u.ExtensibilityStrings.l_CursorPositionChanged_Text="Người dùng đã thay đổi vị trí của con trỏ chuột trong lúc chèn dữ liệu." \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.01.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.01.debug.js new file mode 100644 index 000000000..399fb0f00 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.01.debug.js @@ -0,0 +1,1287 @@ +/* Word specific JavaScript API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { + Html: "html", + Ooxml: "ooxml" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + DataNodeDeleted: "nodeDeleted", + DataNodeInserted: "nodeInserted", + DataNodeReplaced: "nodeReplaced" +}); +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +} +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed" +}; +OSF.DDA.RichClientSettingsManager={ + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + window.external.GetContext().GetSettings().Read(keys, values); + if (onReceiving) { + onReceiving(); + } + var serializedSettings={}; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + return serializedSettings; + }, + write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving) { + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + if (onCalling) { + onCalling(); + } + window.external.GetContext().GetSettings().Write(keys, values); + if (onReceiving) { + onReceiving(); + } + } +}; +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + try { + response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name : Strings.OfficeOM.L_InternalError, message : ex }; + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving); + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.write( + hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], + hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], + onCalling, + onReceiving + ); + } + switch (actionId) { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break; + } + return delegateMethods; +} +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], + privateState + ); +} +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() { + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id]=dispatch; + } + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], + partId + ); +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], + handle + ); +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FileType, { + Pdf: "pdf" +}); +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if (rows==1 && cols==1) { + ret=[vbArr]; + } else { + ret=[]; + for (var row=0; row < rows; row++) { + var rowArr=[]; + for (var col=0; col < cols; col++) { + var datum=vbArr[row * cols+col]; + if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode, + Microsoft.Office.Internal.Parameters.OfficeTheme, + Microsoft.Office.Internal.Parameters.DocumentTheme + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; + this.dynamicTypes=dynamicTypes; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.FilePropertiesDescriptor; + define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: ns.Url, value: 0 } + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self} + ] + }) + define({ + type: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: 0} + ] + }) + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 }, + { name: ns.SlideRange, value:7 } + ] + }); + ns=Microsoft.Office.WebExtension.GoToType; + define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: ns.Binding, value: 0 }, + { name: ns.NamedItem, value: 1 }, + { name: ns.Slide, value: 2 }, + { name: ns.Index, value: 3 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 }, + { name: ns.Pdf, value: 6 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.Internal.OfficeTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.OfficeTheme, + fromHost: [ + {name: ns.PrimaryFontColor, value: 0}, + {name: ns.PrimaryBackgroundColor, value: 1}, + {name: ns.SecondaryFontColor, value:2}, + {name: ns.SecondaryBackgroundColor, value:3} + ] + }) + } + ns=Microsoft.Office.WebExtension.ActiveView; + if (ns) { + define({ + type:Microsoft.Office.WebExtension.Parameters.ActiveView, + fromHost: [ + {name: 0, value: ns.Read}, + {name: 1, value: ns.Edit} + ] + }) + } + ns=Microsoft.Office.Internal.DocumentTheme; + if (ns) { + define({ + type:Microsoft.Office.Internal.Parameters.DocumentTheme, + fromHost: [ + {name: ns.PrimaryBackgroundColor, value: 0}, + {name: ns.PrimaryFontColor, value: 1}, + {name: ns.SecondaryBackgroundColor, value: 2}, + {name: ns.SecondaryFontColor, value: 3}, + {name: ns.Accent1, value: 4}, + {name: ns.Accent2, value: 5}, + {name: ns.Accent3, value: 6}, + {name: ns.Accent4, value: 7}, + {name: ns.Accent5, value: 8}, + {name: ns.Accent6, value: 9}, + {name: ns.Hyperlink, value: 10}, + {name: ns.FollowedHyperlink, value: 11}, + {name: ns.HeaderLatinFont, value: 12}, + {name: ns.HeaderEastAsianFont, value: 13}, + {name: ns.HeaderScriptFont, value: 14}, + {name: ns.HeaderLocalizedFont, value: 15}, + {name: ns.BodyLatinFont, value: 16}, + {name: ns.BodyEastAsianFont, value: 17}, + {name: ns.BodyScriptFont, value: 18}, + {name: ns.BodyLocalizedFont, value: 19} + ] + }) + } + ns=Microsoft.Office.WebExtension.SelectionMode; + define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: ns.Default, value: 0 }, + { name: ns.Selected, value: 1 }, + { name: ns.None, value: 2 }, + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidNavigateToMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.GoToType, value: 1 }, + { name: ns.SelectionMode, value: 2 } + ] + }); + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidClearFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidSetTableOptionsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.TableOptions, value: 1 }, + ] + }); + define({ + type: cns.dispidSetFormatsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CellFormat, value: 1 }, + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod, + fromHost: [ + { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self } + ] + }); + define({ + type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: self } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDocumentThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidOfficeThemeChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidActiveViewChangedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + parameterMap.define=define; + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.GoToType, { + Binding: "binding" +}); +OSF.DDA.WordDocument=function OSF_DDA_WordDocument(officeAppContext, settings) { + OSF.DDA.WordDocument.uber.constructor.call(this, + officeAppContext, + new OSF.DDA.BindingFacade(this), + settings + ); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + OSF.DDA.AsyncMethodNames.GoToByIdAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync + ]); + OSF.OUtil.defineEnumerableProperty(this, "customXmlParts", { + value: new OSF.DDA.CustomXmlParts() + }); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.WordDocument, OSF.DDA.JsomDocument); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.01.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.01.js new file mode 100644 index 000000000..87ead1907 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.01.js @@ -0,0 +1,11 @@ +/* Word specific JavaScript API library */ +/* Version: 15.0.4615.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType,{Html:"html",Ooxml:"ooxml"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DataNodeDeleted:"nodeDeleted",DataNodeInserted:"nodeInserted",DataNodeReplaced:"nodeReplaced"});OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.RichClientSettingsManager={read:function(e,d){var b=[],f=[];e&&e();window.external.GetContext().GetSettings().Read(b,f);d&&d();for(var c={},a=0;a0&&b.push(c)}}}catch(i){}return b}var d=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.EventDescriptors.DocumentThemeChangedEvent,OSF.DDA.EventDescriptors.OfficeThemeChangedEvent,OSF.DDA.EventDescriptors.ActiveViewChangedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode,Microsoft.Office.Internal.Parameters.OfficeTheme,Microsoft.Office.Internal.Parameters.DocumentTheme],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var b=0,a=1;return {toHost:function(c){if(typeof c!="string"&&c[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[b]=c[OSF.DDA.TableDataProperties.TableRows];d[a]=c[OSF.DDA.TableDataProperties.TableHeaders];c=d}return c},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=c(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=c(d[b]);e[OSF.DDA.TableDataProperties.TableHeaders]=c(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(b,d,a);b.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};b.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b};b.dynamicTypes=a};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var f=true,e=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=e.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + window.external.Execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + window.external.RegisterEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + window.external.UnregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.WordDocument=function OSF_DDA_WordDocument(officeAppContext, settings) { + OSF.DDA.WordDocument.uber.constructor.call(this, + officeAppContext, + new OSF.DDA.BindingFacade(this), + settings + ); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync + ]); + OSF.OUtil.defineEnumerableProperty(this, "customXmlParts", { + value: new OSF.DDA.CustomXmlParts() + }); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.WordDocument, OSF.DDA.JsomDocument); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.js new file mode 100644 index 000000000..7d759fdfc --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-15.js @@ -0,0 +1,11 @@ +/* Word specific JavaScript API library */ +/* Version: 15.0.4420.1017 Build Time: 03/31/2014 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType,{Html:"html",Ooxml:"ooxml"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DataNodeDeleted:"nodeDeleted",DataNodeInserted:"nodeInserted",DataNodeReplaced:"nodeReplaced"});OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.RichClientSettingsManager={read:function(e,d){var b=[],f=[];e&&e();window.external.GetContext().GetSettings().Read(b,f);d&&d();for(var c={},a=0;a0&&b.push(c)}}}catch(i){}return b}var c=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,a=1;return {toHost:function(b){if(typeof b!="string"&&b[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=b[OSF.DDA.TableDataProperties.TableRows];d[a]=b[OSF.DDA.TableDataProperties.TableHeaders];b=d}return b},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=b(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=b(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=b(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,a);this.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};this.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var e=true,f=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=f.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + + +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response = { + Status: 0, + Payload: 1 +}; + +OSF.DDA.SafeArray.UniqueArguments = { + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException = function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number = ex.number; + if (number) { + switch (number) { + case -2146828218: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor = function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows = vbArr.ubound(1); + var cols = vbArr.ubound(2); + vbArr = vbArr.toArray(); + if (rows == 1 && cols == 1) { + ret = [vbArr]; + } else { + ret = []; + for (var row = 0; row < rows; row++) { + var rowArr = []; + for (var col = 0; col < cols; col++) { + var datum = vbArr[row * cols + col]; + if (datum != OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes = []; + var dynamicTypes = {}; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = (function () { + var tableRows = 0; + var tableHeaders = 1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data != "string" && data[OSF.DDA.TableDataProperties.TableRows] !== undefined) { + var tableData = []; + tableData[tableRows] = data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders] = data[OSF.DDA.TableDataProperties.TableHeaders]; + data = tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs.toArray) { + var dimensions = hostArgs.dimensions(); + if (dimensions === 2) { + ret = _2DVBArrayToJaggedArray(hostArgs); + } else { + var array = hostArgs.toArray(); + if (array.length === 2 && ((array[0] != null && array[0].toArray) || (array[1] != null && array[1].toArray))) { + ret = {}; + ret[OSF.DDA.TableDataProperties.TableRows] = _2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders] = _2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret = array; + } + } + } else { + ret = hostArgs; + } + return ret; + } + }; + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + + this.unpack = function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + var toArraySupported = (arg || typeof arg === "unknown") && arg.toArray; + value = toArraySupported ? arg.toArray() : arg || {}; + } else if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; + +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); + +OSF.DDA.SafeArray.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [ + { + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 }, + { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 } + ] + }, + { + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 } + ] + } +]); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 }, + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 } + ] +}); +OSF.DDA.SafeArray.Delegate.executeAsync = function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + function toArray(args) { + var arrArgs = args; + if (OSF.OUtil.isArray(args)) { + var len = arrArgs.length; + for (var i = 0; i < len; i++) { + arrArgs[i] = toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs = args.getVarDate(); + } else if (typeof args === "object" && !OSF.OUtil.isArray(args)) { + arrArgs = []; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index] = toArray(args[index]); + } + } + } + return arrArgs; + } + function fromSafeArray(value) { + var ret = value; + if (value != null && value.toArray) { + var arrayResult = value.toArray(); + for (var i = 0; i < arrayResult.length; i++) { + arrayResult[i] = fromSafeArray(arrayResult[i]); + } + ret = arrayResult; + } + return ret; + } + try { + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + var result = hostResponseArgs.toArray(); + var status = result[OSF.DDA.SafeArray.Response.Status]; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) { + var payload = result[OSF.DDA.SafeArray.Response.Payload]; + payload = fromSafeArray(payload); + if (payload != null) { + if (!args._chunkResultData) { + args._chunkResultData = new Array(); + } + + args._chunkResultData[payload[0]] = payload[1]; + } + } else { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload = []; + for (var i = 1; i < result.length; i++) + payload[i - 1] = result[i]; + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + if (args._chunkResultData) { + payload = fromSafeArray(payload); + if (payload != null) { + var expectedChunkCount = payload[payload.length - 1]; + if (args._chunkResultData.length == expectedChunkCount) { + payload[payload.length - 1] = args._chunkResultData; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + } + } else { + payload = result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + }); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent = function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status = hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync = function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync = function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; + +OSF.ClientMode = { + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason = { + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = this.initializeSettings; +}; +OSF.InitializationHelper.prototype.deserializeSettings = function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) { + var settings; + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = (typeof (JSON) !== "undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = (typeof (JSON) !== "undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface = function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + var license = new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler = (OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler)); + var getDelegateMethods, parameterMap; + getDelegateMethods = OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); +}; +OSF.InitializationHelper.prototype.getInitializationReason = function (appContext) { + return OSF.DDA.RichInitializationReason[appContext.get_reason()]; +}; + +OSF.DDA.DispIdHost.getClientDelegateMethods = function (actionId) { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + + if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId == OSF.DDA.AsyncMethodNames.RefreshAsync.id) { + var readSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings); + } + if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId == OSF.DDA.AsyncMethodNames.SaveAsync.id) { + var writeSerializedSettings = function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings); + } + return delegateMethods; +}; + +var OSF = OSF || {}; +var OSFWebkit; +(function (OSFWebkit) { + var WebkitSafeArray = (function () { + function WebkitSafeArray(data) { + this.data = data; + this.safeArrayFlag = this.isSafeArray(data); + } + WebkitSafeArray.prototype.dimensions = function () { + var dimensions = 0; + if (this.safeArrayFlag) { + dimensions = this.data[0][0]; + } else if (this.isArray()) { + dimensions = 2; + } + return dimensions; + }; + WebkitSafeArray.prototype.getItem = function () { + var array = []; + var element = null; + if (this.safeArrayFlag) { + array = this.toArray(); + } else { + array = this.data; + } + + element = array; + for (var i = 0; i < arguments.length; i++) { + element = element[arguments[i]]; + } + return element; + }; + WebkitSafeArray.prototype.lbound = function (dimension) { + return 0; + }; + WebkitSafeArray.prototype.ubound = function (dimension) { + var ubound = 0; + if (this.safeArrayFlag) { + ubound = this.data[0][dimension]; + } else if (this.isArray()) { + if (dimension == 1) { + return this.data.length; + } else if (dimension == 2) { + if (OSF.OUtil.isArray(this.data[0])) { + return this.data[0].length; + } else if (this.data[0] != null) { + return 1; + } + } + } + return ubound; + }; + WebkitSafeArray.prototype.toArray = function () { + if (this.isArray() == false) { + return this.data; + } + + var arr = []; + var startingIndex = this.safeArrayFlag ? 1 : 0; + for (var i = startingIndex; i < this.data.length; i++) { + var element = this.data[i]; + if (this.isSafeArray(element)) { + arr.push(new WebkitSafeArray(element)); + } else { + arr.push(element); + } + } + return arr; + }; + WebkitSafeArray.prototype.isArray = function () { + return OSF.OUtil.isArray(this.data); + }; + WebkitSafeArray.prototype.isSafeArray = function (obj) { + var isSafeArray = false; + if (OSF.OUtil.isArray(obj) && OSF.OUtil.isArray(obj[0])) { + var bounds = obj[0]; + var dimensions = bounds[0]; + if (bounds.length != dimensions + 1) { + return false; + } + var expectedArraySize = 1; + for (var i = 1; i < bounds.length; i++) { + var dimension = bounds[i]; + if (isFinite(dimension) == false) { + return false; + } + expectedArraySize = expectedArraySize * dimension; + } + + expectedArraySize++; + isSafeArray = (expectedArraySize == obj.length); + } + return isSafeArray; + }; + return WebkitSafeArray; + })(); + OSFWebkit.WebkitSafeArray = WebkitSafeArray; +})(OSFWebkit || (OSFWebkit = {})); +var OSFWebkit; +(function (OSFWebkit) { + (function (ScriptMessaging) { + var scriptMessenger = null; + + function agaveHostCallback(callbackId, params) { + scriptMessenger.agaveHostCallback(callbackId, params); + } + ScriptMessaging.agaveHostCallback = agaveHostCallback; + + function agaveHostEventCallback(callbackId, params) { + scriptMessenger.agaveHostEventCallback(callbackId, params); + } + ScriptMessaging.agaveHostEventCallback = agaveHostEventCallback; + function GetScriptMessenger() { + if (scriptMessenger == null) { + scriptMessenger = new WebkitScriptMessaging("OSF.ScriptMessaging.agaveHostCallback", "OSF.ScriptMessaging.agaveHostEventCallback"); + } + return scriptMessenger; + } + ScriptMessaging.GetScriptMessenger = GetScriptMessenger; + var EventHandlerCallback = (function () { + function EventHandlerCallback(id, targetId, handler) { + this.id = id; + this.targetId = targetId; + this.handler = handler; + } + return EventHandlerCallback; + })(); + var WebkitScriptMessaging = (function () { + function WebkitScriptMessaging(methodCallbackName, eventCallbackName) { + this.callingIndex = 0; + this.callbackList = {}; + this.eventHandlerList = {}; + this.asyncMethodCallbackFunctionName = methodCallbackName; + this.eventCallbackFunctionName = eventCallbackName; + + this.conversationId = WebkitScriptMessaging.getCurrentTimeMS().toString(); + } + WebkitScriptMessaging.prototype.invokeMethod = function (handlerName, methodId, params, callback) { + var messagingArgs = {}; + this.postWebkitMessage(messagingArgs, handlerName, methodId, params, callback); + }; + + WebkitScriptMessaging.prototype.registerEvent = function (handlerName, methodId, dispId, targetId, handler, callback) { + var messagingArgs = { + eventCallbackFunction: this.eventCallbackFunctionName + }; + var hostArgs = { + id: dispId, + targetId: targetId + }; + var correlationId = this.postWebkitMessage(messagingArgs, handlerName, methodId, hostArgs, callback); + + this.eventHandlerList[correlationId] = new EventHandlerCallback(dispId, targetId, handler); + }; + + WebkitScriptMessaging.prototype.unregisterEvent = function (handlerName, methodId, dispId, targetId, callback) { + var hostArgs = { + id: dispId, + targetId: targetId + }; + + for (var key in this.eventHandlerList) { + if (this.eventHandlerList.hasOwnProperty(key)) { + var eventCallback = this.eventHandlerList[key]; + if (eventCallback.id == dispId && eventCallback.targetId == targetId) { + delete this.eventHandlerList[key]; + } + } + } + this.invokeMethod(handlerName, methodId, hostArgs, callback); + }; + + WebkitScriptMessaging.prototype.agaveHostCallback = function (callbackId, params) { + var callbackFunction = this.callbackList[callbackId]; + if (callbackFunction) { + callbackFunction(params); + + delete this.callbackList[callbackId]; + } + }; + + WebkitScriptMessaging.prototype.agaveHostEventCallback = function (callbackId, params) { + var eventCallback = this.eventHandlerList[callbackId]; + if (eventCallback) { + eventCallback.handler(params); + } + }; + + WebkitScriptMessaging.prototype.postWebkitMessage = function (messagingArgs, handlerName, methodId, params, callback) { + var correlationId = this.generateCorrelationId(); + this.callbackList[correlationId] = callback; + messagingArgs.methodId = methodId; + messagingArgs.params = params; + messagingArgs.callbackId = correlationId; + messagingArgs.callbackFunction = this.asyncMethodCallbackFunctionName; + var invokePostMessage = function () { + window.webkit.messageHandlers[handlerName].postMessage(JSON.stringify(messagingArgs)); + }; + + var currentTimestamp = WebkitScriptMessaging.getCurrentTimeMS(); + if (this.lastMessageTimestamp == null || (currentTimestamp - this.lastMessageTimestamp >= WebkitScriptMessaging.MESSAGE_TIME_DELTA)) { + invokePostMessage(); + this.lastMessageTimestamp = currentTimestamp; + } else { + this.lastMessageTimestamp += WebkitScriptMessaging.MESSAGE_TIME_DELTA; + setTimeout(function () { + invokePostMessage(); + }, this.lastMessageTimestamp - currentTimestamp); + } + return correlationId; + }; + + WebkitScriptMessaging.prototype.generateCorrelationId = function () { + ++this.callingIndex; + return this.conversationId + this.callingIndex; + }; + + WebkitScriptMessaging.getCurrentTimeMS = function () { + return (new Date).getTime(); + }; + WebkitScriptMessaging.MESSAGE_TIME_DELTA = 10; + return WebkitScriptMessaging; + })(); + ScriptMessaging.WebkitScriptMessaging = WebkitScriptMessaging; + })(OSFWebkit.ScriptMessaging || (OSFWebkit.ScriptMessaging = {})); + var ScriptMessaging = OSFWebkit.ScriptMessaging; +})(OSFWebkit || (OSFWebkit = {})); +OSF.ScriptMessaging = OSFWebkit.ScriptMessaging; + +var OSFWebkit; +(function (OSFWebkit) { + OSFWebkit.MessageHandlerName = "Agave"; + (function (AppContextProperties) { + AppContextProperties[AppContextProperties["Settings"] = 0] = "Settings"; + AppContextProperties[AppContextProperties["SolutionReferenceId"] = 1] = "SolutionReferenceId"; + AppContextProperties[AppContextProperties["AppType"] = 2] = "AppType"; + AppContextProperties[AppContextProperties["MajorVersion"] = 3] = "MajorVersion"; + AppContextProperties[AppContextProperties["MinorVersion"] = 4] = "MinorVersion"; + AppContextProperties[AppContextProperties["RevisionVersion"] = 5] = "RevisionVersion"; + AppContextProperties[AppContextProperties["APIVersionSequence"] = 6] = "APIVersionSequence"; + AppContextProperties[AppContextProperties["AppCapabilities"] = 7] = "AppCapabilities"; + AppContextProperties[AppContextProperties["APPUILocale"] = 8] = "APPUILocale"; + AppContextProperties[AppContextProperties["AppDataLocale"] = 9] = "AppDataLocale"; + AppContextProperties[AppContextProperties["BindingCount"] = 10] = "BindingCount"; + AppContextProperties[AppContextProperties["DocumentUrl"] = 11] = "DocumentUrl"; + AppContextProperties[AppContextProperties["ActivationMode"] = 12] = "ActivationMode"; + AppContextProperties[AppContextProperties["ControlIntegrationLevel"] = 13] = "ControlIntegrationLevel"; + AppContextProperties[AppContextProperties["SolutionToken"] = 14] = "SolutionToken"; + AppContextProperties[AppContextProperties["APISetVersion"] = 15] = "APISetVersion"; + AppContextProperties[AppContextProperties["CorrelationId"] = 16] = "CorrelationId"; + AppContextProperties[AppContextProperties["InstanceId"] = 17] = "InstanceId"; + AppContextProperties[AppContextProperties["TouchEnabled"] = 18] = "TouchEnabled"; + AppContextProperties[AppContextProperties["CommerceAllowed"] = 19] = "CommerceAllowed"; + AppContextProperties[AppContextProperties["RequirementMatrix"] = 20] = "RequirementMatrix"; + })(OSFWebkit.AppContextProperties || (OSFWebkit.AppContextProperties = {})); + var AppContextProperties = OSFWebkit.AppContextProperties; + (function (MethodId) { + MethodId[MethodId["Execute"] = 1] = "Execute"; + MethodId[MethodId["RegisterEvent"] = 2] = "RegisterEvent"; + MethodId[MethodId["UnregisterEvent"] = 3] = "UnregisterEvent"; + MethodId[MethodId["WriteSettings"] = 4] = "WriteSettings"; + MethodId[MethodId["GetContext"] = 5] = "GetContext"; + })(OSFWebkit.MethodId || (OSFWebkit.MethodId = {})); + var MethodId = OSFWebkit.MethodId; + var WebkitHostController = (function () { + function WebkitHostController(hostScriptProxy) { + this.hostScriptProxy = hostScriptProxy; + } + WebkitHostController.prototype.execute = function (id, params, callback) { + var args = params; + if (args == null) { + args = []; + } + var hostParams = { + id: id, + apiArgs: args + }; + var agaveResponseCallback = function (payload) { + var safeArraySource = payload; + if (OSF.OUtil.isArray(payload) && payload.length >= 2) { + var hrStatus = payload[0]; + + safeArraySource = payload[1]; + } + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.Execute, hostParams, agaveResponseCallback); + }; + WebkitHostController.prototype.registerEvent = function (id, targetId, handler, callback) { + var agaveEventHandlerCallback = function (payload) { + var safeArraySource = payload; + var eventId = 0; + if (OSF.OUtil.isArray(payload) && payload.length >= 2) { + safeArraySource = payload[0]; + eventId = payload[1]; + } + if (handler) { + handler(eventId, new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + var agaveResponseCallback = function (payload) { + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(payload)); + } + }; + this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.RegisterEvent, id, targetId, agaveEventHandlerCallback, agaveResponseCallback); + }; + WebkitHostController.prototype.unregisterEvent = function (id, targetId, callback) { + var agaveResponseCallback = function (response) { + callback(new OSFWebkit.WebkitSafeArray(response)); + }; + this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.UnregisterEvent, id, targetId, agaveResponseCallback); + }; + return WebkitHostController; + })(); + OSFWebkit.WebkitHostController = WebkitHostController; +})(OSFWebkit || (OSFWebkit = {})); +OSF.Webkit = OSFWebkit; +OSF.ClientHostController = new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger()); +OSF.DDA.ClientSettingsManager = { + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + var onComplete = function onComplete(status, response) { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + try { + hostDelegateMethod(args.hostCallArgs, args.onCalling, onComplete); + } catch (ex) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response = { name: Strings.OfficeOM.L_InternalError, message: ex }; + onComplete(status, response); + } + }; + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onComplete) { + var keys = []; + var values = []; + if (onCalling) { + onCalling(); + } + + var initializationHelper = OSF._OfficeAppFactory.getInitializationHelper(); + var onReceivedContext = function onReceivedContext(appContext) { + if (onComplete) { + onComplete(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, appContext.get_settings()); + } + }; + initializationHelper.getAppContext(null, onReceivedContext); + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onComplete) { + var hostParams = {}; + var keys = []; + var values = []; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + hostParams["keys"] = keys; + hostParams["values"] = values; + if (onCalling) { + onCalling(); + } + var onWriteCompleted = function onWriteCompleted(status) { + if (onComplete) { + onComplete(status[0], null); + } + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.WriteSettings, hostParams, onWriteCompleted); + } +}; +OSF.InitializationHelper.prototype.initializeSettings = function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) { + var serializedSettings = appContext.get_settings(); + var settings = this.deserializeSettings(serializedSettings, refreshSupported); + return settings; +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var getInvocationCallback = function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(appContext) { + var returnedContext; + var appContextProperties = OSF.Webkit.AppContextProperties; + var appType = appContext[appContextProperties.AppType]; + var appTypeSupported = false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry] == appType) { + appTypeSupported = true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type " + appType; + } + var hostSettings = appContext[appContextProperties.Settings]; + var serializedSettings = {}; + var keys = hostSettings[0]; + var values = hostSettings[1]; + for (var index = 0; index < keys.length; index++) { + serializedSettings[keys[index]] = values[index]; + } + var id = appContext[appContextProperties.SolutionReferenceId]; + var version = appContext[appContextProperties.MajorVersion]; + var clientMode = appContext[appContextProperties.AppCapabilities]; + var UILocale = appContext[appContextProperties.APPUILocale]; + var dataLocale = appContext[appContextProperties.AppDataLocale]; + var docUrl = appContext[appContextProperties.DocumentUrl]; + var reason = appContext[appContextProperties.ActivationMode]; + var osfControlType = appContext[appContextProperties.ControlIntegrationLevel]; + var eToken = appContext[appContextProperties.SolutionToken]; + eToken = eToken ? eToken.toString() : ""; + var correlationId = appContext[appContextProperties.CorrelationId]; + var appInstanceId = appContext[appContextProperties.InstanceId]; + var touchEnabled = appContext[appContextProperties.TouchEnabled]; + var commerceAllowed = appContext[appContextProperties.CommerceAllowed]; + var minorVersion = appContext[appContextProperties.MinorVersion]; + var requirementMatrix = appContext[appContextProperties.RequirementMatrix]; + returnedContext = new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, serializedSettings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.GetContext, [], getInvocationCallback); +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.FileType = { + Text: "text", + Compressed: "compressed", + Pdf: "pdf" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FileProperties: "FileProperties", + FileSliceProperties: "FileSliceProperties" +}); +OSF.DDA.FileProperties = { + Handle: "FileHandle", + FileSize: "FileSize", + SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize +}; +OSF.DDA.File = function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState = {}; + privateState[OSF.DDA.FileProperties.Handle] = handle; + privateState[OSF.DDA.FileProperties.SliceSize] = sliceSize; + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], privateState); +}; + +OSF.DDA.FileSliceOffset = "fileSliceoffset"; +OSF.DDA.AsyncMethodNames.addNames({ + GetDocumentCopyAsync: "getFileAsync", + GetDocumentCopyChunkAsync: "getSliceAsync", + ReleaseDocumentCopyAsync: "closeAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.FileType, + "enum": Microsoft.Office.WebExtension.FileType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SliceSize, + value: { + "types": ["number"], + "defaultValue": 64 * 1024 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var sliceSize = callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]; + + if (sliceSize <= 0 || sliceSize > (4 * 1024 * 1024)) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize; + } + return callArgs; + }, + onSucceeded: function (fileDescriptor, caller, callArgs) { + return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]); + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.SliceIndex, + "types": ["number"] + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + }, + { + name: OSF.DDA.FileProperties.SliceSize, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.SliceSize]; + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var index = callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]; + + if (index < 0 || index >= caller.sliceCount) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange; + } + + callArgs[OSF.DDA.FileSliceOffset] = parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString()); + return callArgs; + }, + onSucceeded: function (sliceDescriptor, caller, callArgs) { + var slice = {}; + OSF.OUtil.defineEnumerableProperties(slice, { + "data": { + value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data] + }, + "index": { + value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex] + }, + "size": { + value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize] + } + }); + return slice; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync, + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + } + ] +}); + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FileType, { + Text: "text", + Pdf: "pdf" +}); + +OSF.DDA.FilePropertiesDescriptor = { + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties = function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); + +Microsoft.Office.WebExtension.GoToType = { + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode = { + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index = { + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileProperties.FileSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: Microsoft.Office.WebExtension.FileType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.FileType.Compressed, value: 5 }, + { name: Microsoft.Office.WebExtension.FileType.Pdf, value: 6 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod, + toHost: [{ name: Microsoft.Office.WebExtension.Parameters.FileType, value: 0 }], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0 }] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); + +Microsoft.Office.WebExtension.BindingType = { + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties = { + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise = function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id = bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t = typeof onError; + if (t != "undefined" && t != "function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback = onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype = { + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me = this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status == Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade = function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches = []; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding = function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding = function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et = Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches = docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id] = new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch = bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId = function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_" + OSF.OUtil.getUniqueId() + "_" + new Date().getTime(); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding = function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id = bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows = bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols = bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders = bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding = new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding = new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp = function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject = OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject = OSF.DDA.TableBinding; + } + binding = new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding = new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id = callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); + +OSF.DDA.MatrixBinding = function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) { + OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Matrix + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + } + }); +}; +OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: 0 }, + { name: OSF.DDA.BindingProperties.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 } + ], + invertible: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: OSF.DDA.BindingProperties.RowCount, value: 0 }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddColumnsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties = { + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding = function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.DDA.TextBinding = function OSF_DDA_TextBinding(id, docInstance) { + OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperty(this, "type", { + value: Microsoft.Office.WebExtension.BindingType.Text + }); +}; +OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs = function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + BindingSelectionChanged: "bindingSelectionChanged", + BindingDataChanged: "bindingDataChanged" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" }); +OSF.DDA.BindingSelectionChangedEventArgs = function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged + }, + "binding": { + value: bindingInstance + } + }); + for (var prop in subset) { + OSF.OUtil.defineEnumerableProperty(this, prop, { + value: subset[prop] + }); + } +}; +OSF.DDA.BindingDataChangedEventArgs = function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingDataChanged + }, + "binding": { + value: bindingInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Html: "html" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Html, value: 3 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Ooxml: "ooxml" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Ooxml, value: 4 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { OoxmlPackage: "ooxmlPackage" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.OoxmlPackage, value: 5 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { PdfFile: "pdf" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.PdfFile, value: 6 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { SlideRange: "slideRange" }); + +OSF.DDA.SlideProperties = { + Id: 0, + Title: 1, + Index: 2 +}; +OSF.DDA.Slide = function OSF_DDA_Slide(id, title, index) { + OSF.OUtil.defineEnumerableProperties(this, { + "id": { + value: id + }, + "title": { + value: title + }, + "index": { + value: index + } + }); +}; +OSF.DDA.SlideRange = function OSF_DDA_SlideRange(slides) { + OSF.OUtil.defineEnumerableProperties(this, { + "slides": { + value: slides + } + }); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureSlideRange = function OSF_DDA_OMFactory$manufactureSlideRange(input) { + var items = null; + if (JSON) { + items = JSON.parse(input); + } else { + items = Sys.Serialization.JavaScriptSerializer.deserialize(input); + } + if (items == null) { + return null; + } + var numField = 0; + for (var key in OSF.DDA.SlideProperties) { + if (OSF.DDA.SlideProperties.hasOwnProperty(key)) { + numField++; + } + } + var slides = []; + var dataValid = true; + for (var i = 0; i < items.length && dataValid; i++) { + dataValid = false; + if (items[i].length == numField) { + var id = parseInt(items[i][OSF.DDA.SlideProperties.Id]); + var title = items[i][OSF.DDA.SlideProperties.Title]; + var index = parseInt(items[i][OSF.DDA.SlideProperties.Index]); + if (!isNaN(id) && !isNaN(index)) { + dataValid = true; + slides.push(new OSF.DDA.Slide(id, title, index)); + } + } + } + if (!dataValid) { + return null; + } + return new OSF.DDA.SlideRange(slides); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.SlideRange, value: 7 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }] +}); +OSF.DDA.DataPartProperties = { + Id: Microsoft.Office.WebExtension.Parameters.Id, + BuiltIn: "DataPartBuiltIn" +}; +OSF.DDA.DataNodeProperties = { + Handle: "DataNodeHandle", + BaseName: "DataNodeBaseName", + NamespaceUri: "DataNodeNamespaceUri", + NodeType: "DataNodeType" +}; +OSF.DDA.DataNodeEventProperties = { + OldNode: "OldNode", + NewNode: "NewNode", + NextSiblingNode: "NextSiblingNode", + InUndoRedo: "InUndoRedo" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + DataPartProperties: "DataPartProperties", + DataNodeProperties: "DataNodeProperties" +}); +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { + DataPartList: "DataPartList", + DataNodeList: "DataNodeList" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataPartList, OSF.DDA.PropertyDescriptors.DataPartProperties); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataNodeList, OSF.DDA.PropertyDescriptors.DataNodeProperties); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { + DataNodeInsertedEvent: "DataNodeInsertedEvent", + DataNodeReplacedEvent: "DataNodeReplacedEvent", + DataNodeDeletedEvent: "DataNodeDeletedEvent" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + DataNodeDeleted: "nodeDeleted", + DataNodeInserted: "nodeInserted", + DataNodeReplaced: "nodeReplaced" +}); + +OSF.DDA.CustomXmlParts = function OSF_DDA_CustomXmlParts() { + this._eventDispatches = []; + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; + +OSF.DDA.CustomXmlPart = function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + + var customXmlPartEventDispatches = customXmlParts._eventDispatches; + var dispatch = customXmlPartEventDispatches[id]; + if (!dispatch) { + var et = Microsoft.Office.WebExtension.EventType; + dispatch = new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id] = dispatch; + } + + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; + +OSF.DDA.CustomXmlPrefixMappings = function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], partId); +}; + +OSF.DDA.CustomXmlNode = function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], handle); +}; + +OSF.DDA.NodeInsertedEventArgs = function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs = function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs = function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureDataNode = function OSF_DDA_OMFactory$manufactureDataNode(nodeProperties) { + if (nodeProperties) { + return new OSF.DDA.CustomXmlNode(nodeProperties[OSF.DDA.DataNodeProperties.Handle], nodeProperties[OSF.DDA.DataNodeProperties.NodeType], nodeProperties[OSF.DDA.DataNodeProperties.NamespaceUri], nodeProperties[OSF.DDA.DataNodeProperties.BaseName]); + } +}; +OSF.DDA.OMFactory.manufactureDataPart = function OSF_DDA_OMFactory$manufactureDataPart(partProperties, containingCustomXmlParts) { + return new OSF.DDA.CustomXmlPart(containingCustomXmlParts, partProperties[OSF.DDA.DataPartProperties.Id], partProperties[OSF.DDA.DataPartProperties.BuiltIn]); +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddDataPartAsync: "addAsync", + GetDataPartByIdAsync: "getByIdAsync", + GetDataPartsByNameSpaceAsync: "getByNamespaceAsync", + DeleteDataPartAsync: "deleteAsync", + GetPartNodesAsync: "getNodesAsync", + GetPartXmlAsync: "getXmlAsync", + AddDataPartNamespaceAsync: "addNamespaceAsync", + GetDataPartNamespaceAsync: "getNamespaceAsync", + GetDataPartPrefixAsync: "getPrefixAsync", + GetRelativeNodesAsync: "getNodesAsync", + GetNodeValueAsync: "getNodeValueAsync", + GetNodeXmlAsync: "getXmlAsync", + SetNodeValueAsync: "setNodeValueAsync", + SetNodeXmlAsync: "setXmlAsync" +}); + +(function () { + function processDataPart(dataPartDescriptor) { + return OSF.DDA.OMFactory.manufactureDataPart(dataPartDescriptor, Microsoft.Office.WebExtension.context.document.customXmlParts); + } + function processDataNode(dataNodeDescriptor) { + return OSF.DDA.OMFactory.manufactureDataNode(dataNodeDescriptor); + } + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + return data == undefined ? null : data; + } + function getObjectId(obj) { + return obj.id; + } + function getPartId(part, partId) { + return partId; + } + ; + function getNodeHandle(node, nodeHandle) { + return nodeHandle; + } + ; + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddDataPartAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processDataPart + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processDataPart + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataPartList], processDataPart); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteDataPartAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetPartNodesAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetPartXmlAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetNodeValueAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetNodeXmlAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetNodeValueAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetNodeXmlAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: OSF.DDA.DataPartProperties.BuiltIn, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: OSF.DDA.DataNodeProperties.BaseName, value: 1 }, + { name: OSF.DDA.DataNodeProperties.NamespaceUri, value: 2 }, + { name: OSF.DDA.DataNodeProperties.NodeType, value: 3 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 }, + { name: OSF.DDA.DataNodeEventProperties.NewNode, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 }, + { name: OSF.DDA.DataNodeEventProperties.OldNode, value: 1 }, + { name: OSF.DDA.DataNodeEventProperties.NewNode, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 }, + { name: OSF.DDA.DataNodeEventProperties.OldNode, value: 1 }, + { name: OSF.DDA.DataNodeEventProperties.NextSiblingNode, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.DataNodeEventProperties.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.DataNodeEventProperties.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.DataNodeEventProperties.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Xml, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartXmlMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.XPath, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidDeleteDataPartMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodeValueMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.XPath, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Xml, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.WordDocument = function OSF_DDA_WordDocument(officeAppContext, settings) { + OSF.DDA.WordDocument.uber.constructor.call(this, officeAppContext, new OSF.DDA.BindingFacade(this), settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GoToByIdAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync + ]); + OSF.OUtil.defineEnumerableProperty(this, "customXmlParts", { + value: new OSF.DDA.CustomXmlParts() + }); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.WordDocument, OSF.DDA.JsomDocument); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.WordDocument(appContext, this._initializeSettings(appContext, false)); + appReady(); +}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-ios-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-ios-16.00.js new file mode 100644 index 000000000..81e87ae57 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-ios-16.00.js @@ -0,0 +1,11 @@ +/* Word iOS specific JavaScript API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b0&&b.push(c)}}}catch(i){}return b}var c=[],b={};b[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,b=1;return {toHost:function(a){if(typeof a!="string"&&a[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=a[OSF.DDA.TableDataProperties.TableRows];d[b]=a[OSF.DDA.TableDataProperties.TableHeaders];a=d}return a},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=a(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=a(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=a(d[b])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,b);this.unpack=function(c,a){var d;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c)){var e=(a||typeof a==="unknown")&&a.toArray;d=e?a.toArray():a||{}}else if(this.isDynamicType(c))d=b[c].fromHost(a);else d=a;return d}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(a){function c(a){var b=a;if(OSF.OUtil.isArray(a))for(var f=b.length,d=0;d2){c=[];for(var g=1;g=a.MESSAGE_TIME_DELTA){f();b.lastMessageTimestamp=d}else{b.lastMessageTimestamp+=a.MESSAGE_TIME_DELTA;setTimeout(function(){f()},b.lastMessageTimestamp-d)}return e};a.prototype.generateCorrelationId=function(){++this.callingIndex;return this.conversationId+this.callingIndex};a.getCurrentTimeMS=function(){return (new Date).getTime()};a.MESSAGE_TIME_DELTA=10;return a}();b.WebkitScriptMessaging=c})(a.ScriptMessaging||(a.ScriptMessaging={}));var b=a.ScriptMessaging})(OSFWebkit||(OSFWebkit={}));OSF.ScriptMessaging=OSFWebkit.ScriptMessaging;var OSFWebkit;(function(a){a.MessageHandlerName="Agave";(function(a){var u="RequirementMatrix",t="CommerceAllowed",s="TouchEnabled",r="InstanceId",q="CorrelationId",p="APISetVersion",o="SolutionToken",n="ControlIntegrationLevel",m="ActivationMode",l="DocumentUrl",k="BindingCount",j="AppDataLocale",i="APPUILocale",h="AppCapabilities",g="APIVersionSequence",f="RevisionVersion",e="MinorVersion",d="MajorVersion",c="SolutionReferenceId",b="Settings";a[a[b]=0]=b;a[a[c]=1]=c;a[a["AppType"]=2]="AppType";a[a[d]=3]=d;a[a[e]=4]=e;a[a[f]=5]=f;a[a[g]=6]=g;a[a[h]=7]=h;a[a[i]=8]=i;a[a[j]=9]=j;a[a[k]=10]=k;a[a[l]=11]=l;a[a[m]=12]=m;a[a[n]=13]=n;a[a[o]=14]=o;a[a[p]=15]=p;a[a[q]=16]=q;a[a[r]=17]=r;a[a[s]=18]=s;a[a[t]=19]=t;a[a[u]=20]=u})(a.AppContextProperties||(a.AppContextProperties={}));var c=a.AppContextProperties;(function(a){var e="GetContext",d="WriteSettings",c="UnregisterEvent",b="RegisterEvent";a[a["Execute"]=1]="Execute";a[a[b]=2]=b;a[a[c]=3]=c;a[a[d]=4]=d;a[a[e]=5]=e})(a.MethodId||(a.MethodId={}));var d=a.MethodId,b=function(){function b(a){this.hostScriptProxy=a}b.prototype.execute=function(g,f,c){var b=f;if(b==null)b=[];var e={id:g,apiArgs:b},d=function(b){var d=b;if(OSF.OUtil.isArray(b)&&b.length>=2){var e=b[0];d=b[1]}c&&c(new a.WebkitSafeArray(d))};this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.Execute,e,d)};b.prototype.registerEvent=function(g,f,c,b){var d=function(b){var d=b,e=0;if(OSF.OUtil.isArray(b)&&b.length>=2){d=b[0];e=b[1]}c&&c(e,new a.WebkitSafeArray(d))},e=function(c){b&&b(new a.WebkitSafeArray(c))};this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.RegisterEvent,g,f,d,e)};b.prototype.unregisterEvent=function(e,d,c){var b=function(b){c(new a.WebkitSafeArray(b))};this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.UnregisterEvent,e,d,b)};return b}();a.WebkitHostController=b})(OSFWebkit||(OSFWebkit={}));OSF.Webkit=OSFWebkit;OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger());OSF.DDA.ClientSettingsManager={getSettingsExecuteMethod:function(a){return function(b){var e,d,c=function(c,a){b.onReceiving&&b.onReceiving();b.onComplete&&b.onComplete(c,a)};try{a(b.hostCallArgs,b.onCalling,c)}catch(f){e=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;d={name:Strings.OfficeOM.L_InternalError,message:f};c(e,d)}}},read:function(b,a){var f=[],e=[];b&&b();var c=OSF._OfficeAppFactory.getInitializationHelper(),d=function(b){a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,b.get_settings())};c.getAppContext(null,d)},write:function(b,i,d,c){var a={},f=[],e=[];for(var g in b){f.push(g);e.push(b[g])}a["keys"]=f;a["values"]=e;d&&d();var h=function(a){c&&c(a[0],null)};OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.WriteSettings,a,h)}};OSF.InitializationHelper.prototype.initializeSettings=function(c,b){var a=c.get_settings(),d=this.deserializeSettings(a,b);return d};OSF.InitializationHelper.prototype.getAppContext=function(c,b){var a=function(c){var f,a=OSF.Webkit.AppContextProperties,g=c[a.AppType],i=false;for(var u in OSF.AppName)if(OSF.AppName[u]==g){i=true;break}if(!i)throw"Unsupported client type "+g;for(var j=c[a.Settings],h={},k=j[0],z=j[1],e=0;e40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e4*1024*1024)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return b},onSucceeded:function(a,c,b){return new OSF.DDA.File(a[OSF.DDA.FileProperties.Handle],a[OSF.DDA.FileProperties.FileSize],b[Microsoft.Office.WebExtension.Parameters.SliceSize])}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(b,a){return a[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(a,d,c){var b=a[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(b<0||b>=d.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;a[OSF.DDA.FileSliceOffset]=parseInt((b*c[OSF.DDA.FileProperties.SliceSize]).toString());return a},onSucceeded:function(a,d,c){var b={};OSF.OUtil.defineEnumerableProperties(b,{data:{value:a[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:c[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:a[OSF.DDA.FileProperties.SliceSize]}});return b}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FileType,{Text:"text",Pdf:"pdf"});OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"});Microsoft.Office.WebExtension.FileProperties=function(a){OSF.OUtil.defineEnumerableProperties(this,{url:{value:a[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(a){return new Microsoft.Office.WebExtension.FileProperties(a)}});Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"};Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"};Microsoft.Office.WebExtension.Index={First:"first",Last:"last",Next:"next",Previous:"previous"};OSF.DDA.AsyncMethodNames.addNames({GoToByIdAsync:"goToByIdAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GoToByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string","number"]},{name:Microsoft.Office.WebExtension.Parameters.GoToType,"enum":Microsoft.Office.WebExtension.GoToType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:{"enum":Microsoft.Office.WebExtension.SelectionMode,defaultValue:Microsoft.Office.WebExtension.SelectionMode.Default}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:0},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:1},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:2},{name:Microsoft.Office.WebExtension.GoToType.Index,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:0},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:1},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:1},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileProperties.FileSize,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:0},{name:OSF.DDA.FileProperties.SliceSize,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:0},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:5},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:6}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:0}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileSliceOffset,value:1},{name:OSF.DDA.FileProperties.SliceSize,value:2}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0}]});OSF.DDA.AsyncMethodNames.addNames({GetSelectedDataAsync:"getSelectedDataAsync",SetSelectedDataAsync:"setSelectedDataAsync"});(function(){function a(b,d,c){var a=b[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&a&&(a[OSF.DDA.TableDataProperties.TableRows]!=undefined||a[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))a=OSF.DDA.OMFactory.manufactureTableData(a);a=OSF.DDA.DataCoercion.coerceData(a,c[Microsoft.Office.WebExtension.Parameters.CoercionType]);return a==undefined?null:a}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,"enum":Microsoft.Office.WebExtension.CoercionType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}}],privateStateCallbacks:[],onSucceeded:a});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}}],privateStateCallbacks:[]})})();OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:1},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SettingsManager={SerializedSettings:"serializedSettings",DateJSONPrefix:"Date(",DataJSONSuffix:")",serializeSettings:function(b){var d={};for(var c in b){var a=b[c];try{if(JSON)a=JSON.stringify(a,function(a,b){return OSF.OUtil.isDate(this[a])?OSF.DDA.SettingsManager.DateJSONPrefix+this[a].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix:b});else a=Sys.Serialization.JavaScriptSerializer.serialize(a);d[c]=a}catch(e){}}return d},deserializeSettings:function(b){var d={};b=b||{};for(var c in b){var a=b[c];try{if(JSON)a=JSON.parse(a,function(c,a){var b;if(typeof a==="string"&&a&&a.length>6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(a){this._eventHandlers={};for(var c in a){var b=a[c];this._eventHandlers[b]=[]}};OSF.EventDispatch.prototype={getSupportedEvents:function(){var a=[];for(var b in this._eventHandlers)a.push(b);return a},supportsEvent:function(c){var a=false;for(var b in this._eventHandlers)if(c==b){a=true;break}return a},hasEventHandler:function(b,c){var a=this._eventHandlers[b];if(a&&a.length>0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SettingsManager.SerializedSettings},{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType};OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.BindingPromise=function(b,a){this._id=b;OSF.OUtil.defineEnumerableProperty(this,"onFail",{"get":function(){return a},"set":function(c){var b=typeof c;if(b!="undefined"&&b!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,b);a=c}})};OSF.DDA.BindingPromise.prototype={_fetch:function(b){var a=this;if(a.binding)b&&b(a.binding);else if(!a._binding){var c=a;Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(a._id,function(a){if(a.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded){OSF.OUtil.defineEnumerableProperty(c,"binding",{value:a.value});b&&b(c.binding)}else c.onFail&&c.onFail(a)})}return a},getDataAsync:function(){var a=arguments;this._fetch(function(b){b.getDataAsync.apply(b,a)});return this},setDataAsync:function(){var a=arguments;this._fetch(function(b){b.setDataAsync.apply(b,a)});return this},addHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.addHandlerAsync.apply(b,a)});return this},removeHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.removeHandlerAsync.apply(b,a)});return this}};OSF.DDA.BindingFacade=function(b){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:b});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddFromSelectionAsync,a.AddFromNamedItemAsync,a.GetAllAsync,a.GetByIdAsync,a.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{document:{value:a},id:{value:b}})};OSF.DDA.Binding=function(a,c){OSF.OUtil.defineEnumerableProperties(this,{document:{value:c},id:{value:a}});var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDataAsync,d.SetDataAsync]);var e=Microsoft.Office.WebExtension.EventType,b=c.bindings._eventDispatches;if(!b[a])b[a]=new OSF.EventDispatch([e.BindingSelectionChanged,e.BindingDataChanged]);var f=b[a];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.generateBindingId=function(){return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureBinding=function(a,c){var d=a[OSF.DDA.BindingProperties.Id],g=a[OSF.DDA.BindingProperties.RowCount],f=a[OSF.DDA.BindingProperties.ColumnCount],h=a[OSF.DDA.BindingProperties.HasHeaders],b;switch(a[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:b=new OSF.DDA.TextBinding(d,c);break;case Microsoft.Office.WebExtension.BindingType.Matrix:b=new OSF.DDA.MatrixBinding(d,c,g,f);break;case Microsoft.Office.WebExtension.BindingType.Table:var i=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument},e;if(i()&&OSF.DDA.ExcelTableBinding)e=OSF.DDA.ExcelTableBinding;else e=OSF.DDA.TableBinding;b=new e(d,c,g,f,h);break;default:b=new OSF.DDA.UnknownBinding(d,c)}return b};OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"});(function(){var d="number",c="object",b="string",a=null;function e(a){return OSF.DDA.OMFactory.manufactureBinding(a,Microsoft.Office.WebExtension.context.document)}function f(a){return a.id}function g(c,e,d){var b=c[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&b&&(b[OSF.DDA.TableDataProperties.TableRows]!=undefined||b[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))b=OSF.DDA.OMFactory.manufactureTableData(b);b=OSF.DDA.DataCoercion.coerceData(b,d[Microsoft.Office.WebExtension.Parameters.CoercionType]);return b==undefined?a:b}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return true}}],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.BindingList],e)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(d,b,a){var c=a[Microsoft.Office.WebExtension.Parameters.Id];delete b._eventDispatches[c]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(b,a){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(a.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&a[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&a[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn];delete a[Microsoft.Office.WebExtension.Parameters.RowCount];delete a[Microsoft.Office.WebExtension.Parameters.ColumnCount]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]||a[Microsoft.Office.WebExtension.Parameters.RowCount]||a[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}],onSucceeded:g});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[b,c,d,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}]})})();OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.MatrixBinding=function(d,c,b,a){OSF.DDA.MatrixBinding.uber.constructor.call(this,d,c);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:b?b:0},columnCount:{value:a?a:0}})};OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:0},{name:OSF.DDA.BindingProperties.Type,value:1},{name:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,value:2}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:0},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:1},{name:Microsoft.Office.WebExtension.BindingType.Table,value:2}],invertible:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:0},{name:Microsoft.Office.WebExtension.Parameters.Id,value:1},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:2},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:2},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:3},{name:OSF.DDA.PropertyDescriptors.Subset,value:4}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.Data,value:2},{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,fromHost:[{name:OSF.DDA.BindingProperties.RowCount,value:0},{name:OSF.DDA.BindingProperties.ColumnCount,value:1},{name:OSF.DDA.BindingProperties.HasHeaders,value:2}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,toHost:[{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:0},{name:OSF.DDA.SafeArray.UniqueArguments.Run,value:1}],canonical:true,isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Offset,toHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:0},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:1}],canonical:true,isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Run,toHost:[{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:0},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:1}],canonical:true,isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});Microsoft.Office.WebExtension.TableData=function(b,a){function c(a){if(a==null||a==undefined)return null;try{for(var b=OSF.DDA.DataCoercion.findArrayDimensionality(a,2);b<2;b++)a=[a];return a}catch(c){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{"get":function(){return a},"set":function(b){a=c(b)}},rows:{"get":function(){return b},"set":function(a){b=a==null||OSF.OUtil.isArray(a)&&a.length==0?[]:c(a)}}});this.headers=a;this.rows=b};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureTableData=function(a){return new Microsoft.Office.WebExtension.TableData(a[OSF.DDA.TableDataProperties.TableRows],a[OSF.DDA.TableDataProperties.TableHeaders])};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{TableDataProperties:"TableDataProperties"});OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.DDA.TableBinding=function(f,e,d,c,b){OSF.DDA.TableBinding.uber.constructor.call(this,f,e);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:d?d:0},columnCount:{value:c?c:0},hasHeaders:{value:b?b:false}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddRowsAsync,a.AddColumnsAsync,a.DeleteAllDataValuesAsync])};OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddRowsAsync:"addRowsAsync",AddColumnsAsync:"addColumnsAsync",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync"});(function(){function a(a){return a.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:a}]})})();OSF.DDA.TextBinding=function(b,a){OSF.DDA.TextBinding.uber.constructor.call(this,b,a);OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})};OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding);OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"});OSF.DDA.DocumentSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:a}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{BindingSelectionChangedEvent:"BindingSelectionChangedEvent"});OSF.DDA.BindingSelectionChangedEventArgs=function(c,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:c}});for(var b in a)OSF.OUtil.defineEnumerableProperty(this,b,{value:a[b]})};OSF.DDA.BindingDataChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:a}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0},{name:OSF.DDA.PropertyDescriptors.Subset,value:1}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],isComplexType:true});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"};OSF.DDA.DataCoercion=function(){var a=null;return {findArrayDimensionality:function(c){if(OSF.OUtil.isArray(c)){for(var b=0,a=0;a 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage = _getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart = window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd == -1) { + sessionKeyEnd = window.name.length; + } + var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue = osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString = window.location.search; + var conversationId = null; + if (searchString) { + var index = searchString.indexOf("&"); + + conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') { + conversationId = conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId = decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items = strInfo.split("$"); + if (typeof items[1] == "undefined") { + items = strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl = ''; + var xdmInfoValue = OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items = OSF.OUtil.getInfoItems(xdmInfoValue); + if (items != undefined && items.length >= 3) { + conversationUrl = items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e = Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e = Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !== 'undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor = descriptor || {}; + for (var nd in attributes) { + var attribute = attributes[nd]; + if (descriptor[attribute] == undefined) { + descriptor[attribute] = true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors = descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor = descriptor || {}; + var props = Object.getOwnPropertyNames(obj); + var propsLength = props.length; + for (var i = 0; i < propsLength; i++) { + var prop = props[i]; + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable = descriptor.writable || false; + } + desc.configurable = descriptor.configurable || false; + desc.enumerable = descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret = []; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key == item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value == list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add = list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key] = value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2] = newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj) === "[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj) === "[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj) === "[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on" + eventName, listener); + } else { + element["on" + eventName] = null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/="; + var output = []; + var temp = []; + var index = 0; + var c1, c2, c3, a, b, c; + var i; + var length = input.length; + do { + c1 = input.charCodeAt(index++); + c2 = input.charCodeAt(index++); + c3 = input.charCodeAt(index++); + i = 0; + a = c1 & 255; + b = c1 >> 8; + c = c2 & 255; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + if (!isNaN(c2)) { + a = c2 >> 8; + b = c3 & 255; + c = c3 >> 8; + temp[i++] = a >> 2; + temp[i++] = ((a & 3) << 4) | (b >> 4); + temp[i++] = ((b & 15) << 2) | (c >> 6); + temp[i++] = c & 63; + } + if (isNaN(c2)) { + temp[i - 1] = 64; + } else if (isNaN(c3)) { + temp[i - 2] = 64; + temp[i - 1] = 64; + } + for (var t = 0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage = window.localStorage; + } catch (ex) { + localStorage = null; + } + _safeLocalStorage = new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick = function (e) { + handler(); + }; + element.ontouchend = function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e = Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj = sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property] = sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid = (function () { + var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result = ""; + var tick = (new Date()).getTime(); + var index = 0; + + for (; index < 32 && tick > 0; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[tick % 16]; + tick = Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index == 8 || index == 12 || index == 16 || index == 20) { + result += "-"; + } + result += hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF = OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName = { + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker = { + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker = { + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction = { + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants = { + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id = id; + this._appName = appName; + this._appVersion = appVersion; + this._appUILocale = appUILocale; + this._dataLocale = dataLocale; + this._docUrl = docUrl; + this._clientMode = clientMode; + this._settings = settings; + this._reason = reason; + this._osfControlType = osfControlType; + this._eToken = eToken; + this._correlationId = correlationId; + this._appInstanceId = appInstanceId; + this._touchEnabled = touchEnabled; + this._commerceAllowed = commerceAllowed; + this._appMinorVersion = appMinorVersion; + this._requirementMatrix = requirementMatrix; + this.get_id = function get_id() { + return this._id; + }; + this.get_appName = function get_appName() { + return this._appName; + }; + this.get_appVersion = function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale = function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale = function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl = function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode = function get_clientMode() { + return this._clientMode; + }; + this.get_bindings = function get_bindings() { + return this._bindings; + }; + this.get_settings = function get_settings() { + return this._settings; + }; + this.get_reason = function get_reason() { + return this._reason; + }; + this.get_osfControlType = function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken = function get_eToken() { + return this._eToken; + }; + this.get_correlationId = function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId = function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled = function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed = function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion = function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementsMatrix = function get_requirementsMatrix() { + return this._requirementsMatrix; + }; +}; +OSF.OsfControlType = { + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode = { + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason = { + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat = { + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType = { + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters = { + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode = { + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors = { + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors = {}; +OSF.DDA.ListDescriptors = {}; + +OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId + "_" + eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId = { + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId = { + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager = (function () { + var _errorMappings = {}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode] = errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix = (function () { + function RequirementMatrix(_setMap) { + this.setMap = _setMap; + } + RequirementMatrix.prototype.isSetSupported = function (name, minVersion) { + if (name == undefined) { + return false; + } + if (minVersion == undefined) { + minVersion = 0; + } + var setSupportArray = this.setMap; + var sets = setSupportArray.sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion = sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >= minVersion; + } else { + return false; + } + }; + return RequirementMatrix; + })(); + Requirement.RequirementMatrix = RequirementMatrix; + var DefaultSetRequirement = (function () { + function DefaultSetRequirement(setMap) { + this.sets = setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement = DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement = (function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement = (function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement = (function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement = (function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement = (function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement = (function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement = (function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement = (function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement = (function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement = (function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement = (function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement = (function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement = (function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement = (function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement = (function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory = (function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda = function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix = undefined; + if (appContext.requirementMatrix != undefined && typeof (JSON) !== "undefined") { + var matrixItem = JSON.parse(appContext.requirementMatrix); + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion = appContext.get_appMinorVersion(); + var appMinorVersionString = ""; + if (appMinorVersion < 10) { + appMinorVersionString = "0" + appMinorVersion; + } else { + appMinorVersionString = "" + appMinorVersion; + } + + var appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString; + var appLocator = appContext.get_appName() + "-" + appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) { + defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix = function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix = {}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement = {})); + var Requirement = OfficeExt.Requirement; +})(OfficeExt || (OfficeExt = {})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode = { + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode = { + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager = (function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut = false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice = window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office = Microsoft.Office.WebExtension; + _useShortcut = true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office = _userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut = false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str == "string") { + var index = str.indexOf("#"); + if (index != -1) { + var op = str.substring(0, index); + var target = str.substring(index + 1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise = new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType = typeof errorCallback; + if (callbackType == "function") { + var callArgs = {}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail = errorCallback; + return promise; + } +}; + +OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName = appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context = OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License = function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties = { + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus = { + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode = { + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties = { + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames = {}; +OSF.DDA.AsyncMethodNames.addNames = function (methodNames) { + for (var entry in methodNames) { + var am = {}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry] = am; + } +}; +OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount = requiredParameters.length; + var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param = params[name]; + var arg = args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs = []; + var index; + for (index = 0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret = {}; + for (index = 0; index < requiredCount; index++) { + var param = requiredParameters[index]; + var arg = requiredArgs[index]; + if (param.verify) { + var isValid = param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name] = arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount + 2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i = userArgs.length - 1; i >= requiredCount; i--) { + var argument = userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options = argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback = argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options = options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value = undefined; + var option = supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value = option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !== undefined) { + value = option.defaultValue; + } + options[optionName] = value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required = OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs = {}; + for (var r in required) { + callArgs[r] = required[r]; + } + for (var o in options) { + callArgs[o] = options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s] = privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs = checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload = onSucceeded(response, caller, callArgs); + } else { + payload = response; + } + } else { + if (onFailed) { + payload = onFailed(status, response); + } else { + payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs = function (suppliedArgs) { + var options, parameterCallback; + + for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) { + var argument = suppliedArgs[i]; + switch (typeof argument) { + case "object": + options = argument; + break; + case "function": + parameterCallback = argument; + break; + } + } + options = options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory = (function () { + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions = params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks = params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls = {}; +OSF.DDA.AsyncMethodCalls.define = function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error = function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs = {}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload; + } else { + errorArgs = {}; + payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType = (function () { + var listTypes = {}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t] = prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap = function (specialProcessor, mappings) { + var toHostMap = "toHost"; + var fromHostMap = "fromHost"; + + var self = "self"; + var dynamicTypes = {}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = { + toHost: function (data) { + if (data != null && data.rows !== undefined) { + var tableData = {}; + tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers; + data = tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret = preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage = preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image = []; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image = dynamicTypes[entry][mapping](preimage); + } else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) { + image = mapValues(preimage, mapping); + } else { + var maps = mappings[entry]; + if (maps) { + var map = maps[mapping]; + if (map) { + image = map[preimage]; + if (image === undefined) { + image = preimage; + } + } + } else { + image = preimage; + } + } + ret[entry] = image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg = generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg = imageSet[param]; + } + if (arg != undefined) { + if (!ret) { + ret = {}; + } + var index = parameters[param]; + + if (index == self) { + index = param; + } + ret[index] = specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted = {}; + } + for (var param in parameters) { + var index = parameters[param]; + var value; + + if (index == self) { + value = source; + } else { + value = source[index]; + } + if (value === null || value === undefined) { + extracted[param] = undefined; + } else { + value = specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map = mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param] = extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map = {}; + var entryDescriptor = OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor] = self; + for (var item in value) { + value[item] = extractArguments(value[item], map); + } + } + extracted[param] = value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters = mappings[mapName][mapping]; + var image; + if (mapping == "toHost") { + var imageSet = mapValues(preimage, mapping); + image = generateArguments(imageSet, parameters); + } else if (mapping == "fromHost") { + var argumentSet = extractArguments(preimage, parameters); + image = mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings = {}; + } + this.addMapping = function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost = description.map; + fromHost = {}; + for (var preimage in toHost) { + var image = toHost[preimage]; + + if (image == self) { + image = preimage; + } + fromHost[image] = preimage; + } + } else { + toHost = description.toHost; + fromHost = description.fromHost; + } + var pair = mappings[mapName]; + if (pair) { + var currMap = pair[toHostMap]; + for (var th in currMap) + toHost[th] = currMap[th]; + currMap = pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh] = currMap[fh]; + } else { + pair = mappings[mapName] = {}; + } + pair[toHostMap] = toHost; + pair[fromHostMap] = fromHost; + }; + this.toHost = function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost = function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self = self; + this.addComplexType = function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType = function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType = function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes = dynamicTypes; + this.doMapValues = function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) { + this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt] = handler; + }; + this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn = []; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn = pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].toHost(arg); + } else { + value = arg; + } + return value; + }; + this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value = dynamicTypes[param].fromHost(arg); + } else { + value = arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) { + var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor); + var self = parameterMap.self; + function createObject(properties) { + var obj = null; + if (properties) { + obj = {}; + var len = properties.length; + for (var i = 0; i < len; i++) { + obj[properties[i].name] = properties[i].value; + } + } + return obj; + } + parameterMap.define = function define(definition) { + var args = {}; + var toHost = createObject(definition.toHost); + + if (definition.invertible) { + args.map = toHost; + } else if (definition.canonical) { + args.toHost = args.fromHost = toHost; + } else { + args.toHost = toHost; + args.fromHost = createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods = { + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates = { + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap = {}; + var jsom = OSF.DDA.AsyncMethodNames; + var did = OSF.DDA.MethodDispId; + + var methodMap = { + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id] = methodMap[method]; + } + } + + jsom = Microsoft.Office.WebExtension.EventType; + did = OSF.DDA.EventDispId; + var eventMap = { + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]] = eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex == "number") { + if (!callArgs) { + callArgs = asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName = method.id; + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId = dispIdMap[methodName]; + var delegate = getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs = parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs = callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs = parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs = hostResponseArgs; + } + } else { + responseArgs = hostResponseArgs; + } + var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added = eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args = parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error = OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler === null) { + removeSuccess = eventDispatch.clearEventHandlers(eventType); + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess = eventDispatch.removeEventHandler(eventType, handler); + status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) { + var dispId = dispIdMap[eventType]; + var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method = asyncMethodNames[entry]; + var name = method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Common", Microsoft.Office); +OSF.SerializerVersion = { + MsAjax: 0, + Browser: 1 +}; + +(function (window) { + "use strict"; + var stringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', 'g'), trueFalseNullRegEx = new RegExp('\\b(true|false|null)\\b', 'g'), numbersRegEx = new RegExp('-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?', 'g'), badBracketsRegEx = new RegExp('[^{:,\\[\\s](?=\\s*\\[)'), badRemainderRegEx = new RegExp('[^\\s\\[\\]{}:,]'), jsonErrorMsg = "Cannot deserialize. The data does not correspond to valid JSON."; + function addHandler(element, eventName, handler) { + if (element.addEventListener) { + element.addEventListener(eventName, handler, false); + } else if (element.attachEvent) { + element.attachEvent("on" + eventName, handler); + } + } + function getAjaxSerializer() { + if (OsfMsAjaxFactory.msAjaxSerializer) { + return OsfMsAjaxFactory.msAjaxSerializer; + } + return null; + } + function deserialize(data, secure, oldDeserialize) { + var transformed; + if (!secure) { + return oldDeserialize(data); + } + if (window.JSON && window.JSON.parse) { + return window.JSON.parse(data); + } + + transformed = data.replace(stringRegEx, "[]"); + + transformed = transformed.replace(trueFalseNullRegEx, "[]"); + + transformed = transformed.replace(numbersRegEx, "[]"); + + if (badBracketsRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + if (badRemainderRegEx.test(transformed)) { + throw jsonErrorMsg; + } + + try { + eval("(" + data + ")"); + } catch (e) { + throw jsonErrorMsg; + } + } + function patchDeserializer() { + var serializer = getAjaxSerializer(), oldDeserialize; + if (serializer === null || typeof (serializer.deserialize) !== "function") { + return false; + } + if (serializer.__patchVersion >= 1) { + return true; + } + + oldDeserialize = serializer.deserialize; + + serializer.deserialize = function (data, secure) { + return deserialize(data, true, oldDeserialize); + }; + serializer.__patchVersion = 1; + return true; + } + if (!patchDeserializer()) { + addHandler(window, "load", function () { + patchDeserializer(); + }); + } +}(window)); + +Microsoft.Office.Common.InvokeType = { + "async": 0, + "sync": 1, + "asyncRegisterEvent": 2, + "asyncUnregisterEvent": 3, + "syncRegisterEvent": 4, + "syncUnregisterEvent": 5 +}; + +Microsoft.Office.Common.InvokeResultCode = { + "noError": 0, + "errorInRequest": -1, + "errorHandlingRequest": -2, + "errorInResponse": -3, + "errorHandlingResponse": -4, + "errorHandlingRequestAccessDenied": -5, + "errorHandlingMethodCallTimedout": -6 +}; + +Microsoft.Office.Common.MessageType = { + "request": 0, + "response": 1 +}; + +Microsoft.Office.Common.ActionType = { + "invoke": 0, + "registerEvent": 1, + "unregisterEvent": 2 }; + +Microsoft.Office.Common.ResponseType = { + "forCalling": 0, + "forEventing": 1 +}; + +Microsoft.Office.Common.MethodObject = function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) { + this._method = method; + + this._invokeType = invokeType; + + this._blockingOthers = blockingOthers; +}; +Microsoft.Office.Common.MethodObject.prototype = { + getMethod: function Microsoft_Office_Common_MethodObject$getMethod() { + return this._method; + }, + getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() { + return this._invokeType; + }, + getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() { + return this._blockingOthers; + } +}; + +Microsoft.Office.Common.EventMethodObject = function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) { + this._registerMethodObject = registerMethodObject; + + this._unregisterMethodObject = unregisterMethodObject; +}; +Microsoft.Office.Common.EventMethodObject.prototype = { + getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() { + return this._registerMethodObject; + }, + getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() { + return this._unregisterMethodObject; + } +}; + +Microsoft.Office.Common.ServiceEndPoint = function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) { + var e = Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + + this._methodObjectList = {}; + + this._eventHandlerProxyList = {}; + + this._Id = serviceEndPointId; + + this._conversations = {}; + + this._policyManager = null; + + this._appDomains = {}; +}; +Microsoft.Office.Common.ServiceEndPoint.prototype = { + registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) { + var e = Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false }, + { name: "method", type: Function, mayBeNull: false }, + { name: "invokeType", type: Number, mayBeNull: false }, + { name: "blockingOthers", type: Boolean, mayBeNull: false } + ]); + if (e) + throw e; + if (invokeType !== Microsoft.Office.Common.InvokeType.async && invokeType !== Microsoft.Office.Common.InvokeType.sync) { + throw OsfMsAjaxFactory.msAjaxError.argument("invokeType"); + } + var methodObject = new Microsoft.Office.Common.MethodObject(method, invokeType, blockingOthers); + this._methodObjectList[methodName] = methodObject; + }, + unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) { + var e = Function._validateParams(arguments, [ + { name: "methodName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._methodObjectList[methodName]; + }, + registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject = new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, Microsoft.Office.Common.InvokeType.syncRegisterEvent, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, Microsoft.Office.Common.InvokeType.syncUnregisterEvent, false)); + this._methodObjectList[eventName] = methodObject; + }, + registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false }, + { name: "registerMethod", type: Function, mayBeNull: false }, + { name: "registerMethodInvokeType", type: Number, mayBeNull: false }, + { name: "unregisterMethod", type: Function, mayBeNull: false }, + { name: "unregisterMethodInvokeType", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + var methodObject = new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, registerMethodInvokeType, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, unregisterMethodInvokeType, false)); + this._methodObjectList[eventName] = methodObject; + }, + unregisterEvent: function (eventName) { + var e = Function._validateParams(arguments, [ + { name: "eventName", type: String, mayBeNull: false } + ]); + if (e) + throw e; + this.unregisterMethod(eventName); + }, + registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId, conversationUrl, appDomains, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "conversationUrl", type: String, mayBeNull: false, optional: true }, + { name: "appDomains", type: Object, mayBeNull: true, optional: true }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + ; + if (appDomains) { + if (!(appDomains instanceof Array)) { + throw OsfMsAjaxFactory.msAjaxError.argument("appDomains"); + } + this._appDomains[conversationId] = appDomains; + } + this._conversations[conversationId] = { url: conversationUrl, serializerVersion: serializerVersion }; + }, + unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete this._conversations[conversationId]; + }, + setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) { + var e = Function._validateParams(arguments, [ + { name: "policyManager", type: Object, mayBeNull: false } + ]); + if (e) + throw e; + + if (!policyManager.checkPermission) { + throw OsfMsAjaxFactory.msAjaxError.argument("policyManager"); + } + this._policyManager = policyManager; + }, + getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() { + return this._policyManager; + } +}; + +Microsoft.Office.Common.ClientEndPoint = function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false }, + { name: "targetWindow", mayBeNull: false }, + { name: "targetUrl", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + if (!targetWindow.postMessage) { + throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow"); + } + + this._conversationId = conversationId; + + this._targetWindow = targetWindow; + + this._targetUrl = targetUrl; + + this._callingIndex = 0; + + this._callbackList = {}; + + this._eventHandlerList = {}; + if (serializerVersion != null) { + this._serializerVersion = serializerVersion; + } else { + this._serializerVersion = OSF.SerializerVersion.MsAjax; + } +}; +Microsoft.Office.Common.ClientEndPoint.prototype = { + invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) { + var e = Function._validateParams(arguments, [ + { name: "targetMethodName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "param", mayBeNull: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + var callbackEntry = { "callback": callback, "createdOn": now.getTime() }; + + if (param && typeof param === "object" && typeof param.__timeout__ === "number") { + callbackEntry.timeout = param.__timeout__; + delete param.__timeout__; + } + this._callbackList[correlationId] = callbackEntry; + try { + var callRequest = new Microsoft.Office.Common.Request(targetMethodName, Microsoft.Office.Common.ActionType.invoke, this._conversationId, correlationId, param); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !== null) + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } finally { + delete this._callbackList[correlationId]; + } + } + }, + registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) { + var e = Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "eventHandler", type: Function, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + this._callbackList[correlationId] = { "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest = new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.registerEvent, this._conversationId, correlationId, data); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + + this._eventHandlerList[targetEventName] = eventHandler; + } catch (ex) { + try { + if (callback !== null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } + }, + unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) { + var e = Function._validateParams(arguments, [ + { name: "targetEventName", type: String, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + var correlationId = this._callingIndex++; + + var now = new Date(); + this._callbackList[correlationId] = { "callback": callback, "createdOn": now.getTime() }; + try { + var callRequest = new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.unregisterEvent, this._conversationId, correlationId, data); + + var msg = Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion); + this._targetWindow.postMessage(msg, this._targetUrl); + Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(); + } catch (ex) { + try { + if (callback !== null) { + callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex); + } + } finally { + delete this._callbackList[correlationId]; + } + } finally { + delete this._eventHandlerList[targetEventName]; + } + } +}; + +Microsoft.Office.Common.XdmCommunicationManager = (function () { + var _invokerQueue = []; + + var _lastMessageProcessTime = null; + + var _messageProcessingTimer = null; + + var _processInterval = 10; + + var _blockingFlag = false; + + var _methodTimeoutTimer = null; + + var _methodTimeoutProcessInterval = 2000; + + var _methodTimeoutDefault = 65000; + var _methodTimeout = _methodTimeoutDefault; + var _serviceEndPoints = {}; + var _clientEndPoints = {}; + var _initialized = false; + + function _lookupServiceEndPoint(conversationId) { + for (var id in _serviceEndPoints) { + if (_serviceEndPoints[id]._conversations[conversationId]) { + return _serviceEndPoints[id]; + } + } + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + ; + + function _lookupClientEndPoint(conversationId) { + var clientEndPoint = _clientEndPoints[conversationId]; + if (!clientEndPoint) { + OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."); + throw OsfMsAjaxFactory.msAjaxError.argument("conversationId"); + } + return clientEndPoint; + } + ; + + function _lookupMethodObject(serviceEndPoint, messageObject) { + var methodOrEventMethodObject = serviceEndPoint._methodObjectList[messageObject._actionName]; + if (!methodOrEventMethodObject) { + OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:" + messageObject._actionName); + throw OsfMsAjaxFactory.msAjaxError.argument("messageObject"); + } + var methodObject = null; + if (messageObject._actionType === Microsoft.Office.Common.ActionType.invoke) { + methodObject = methodOrEventMethodObject; + } else if (messageObject._actionType === Microsoft.Office.Common.ActionType.registerEvent) { + methodObject = methodOrEventMethodObject.getRegisterMethodObject(); + } else { + methodObject = methodOrEventMethodObject.getUnregisterMethodObject(); + } + return methodObject; + } + ; + + function _enqueInvoker(invoker) { + _invokerQueue.push(invoker); + } + ; + + function _dequeInvoker() { + if (_messageProcessingTimer !== null) { + if (!_blockingFlag) { + if (_invokerQueue.length > 0) { + var invoker = _invokerQueue.shift(); + _executeCommand(invoker); + } else { + clearInterval(_messageProcessingTimer); + _messageProcessingTimer = null; + } + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + function _executeCommand(invoker) { + _blockingFlag = invoker.getInvokeBlockingFlag(); + + invoker.invoke(); + _lastMessageProcessTime = (new Date()).getTime(); + } + ; + + function _checkMethodTimeout() { + if (_methodTimeoutTimer) { + var clientEndPoint; + var methodCallsNotTimedout = 0; + var now = new Date(); + var timeoutValue; + for (var conversationId in _clientEndPoints) { + clientEndPoint = _clientEndPoints[conversationId]; + for (var correlationId in clientEndPoint._callbackList) { + var callbackEntry = clientEndPoint._callbackList[correlationId]; + + timeoutValue = callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout; + if (timeoutValue >= 0 && Math.abs(now.getTime() - callbackEntry.createdOn) >= timeoutValue) { + try { + if (callbackEntry.callback) { + callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout, null); + } + } finally { + delete clientEndPoint._callbackList[correlationId]; + } + } else { + methodCallsNotTimedout++; + } + ; + } + } + if (methodCallsNotTimedout === 0) { + clearInterval(_methodTimeoutTimer); + _methodTimeoutTimer = null; + } + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready."); + } + } + ; + + function _postCallbackHandler() { + _blockingFlag = false; + } + ; + + function _registerListener(listener) { + if (window.addEventListener) { + window.addEventListener("message", listener, false); + } else if ((navigator.userAgent.indexOf("MSIE") > -1) && window.attachEvent) { + window.attachEvent("onmessage", listener); + } else { + OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."); + throw OsfMsAjaxFactory.msAjaxError.argument("Browser"); + } + } + ; + + function _checkOrigin(url, origin) { + var res = false; + + if (url === true) { + return true; + } + if (!url || !origin || !url.length || !origin.length) { + return res; + } + var url_parser, org_parser; + url_parser = document.createElement('a'); + org_parser = document.createElement('a'); + url_parser.href = url; + org_parser.href = origin; + res = _urlCompare(url_parser, org_parser); + delete url_parser, org_parser; + return res; + } + + function _checkOriginWithAppDomains(allowed_domains, origin) { + var res = false; + if (!origin || !origin.length || !(allowed_domains) || !(allowed_domains instanceof Array) || !allowed_domains.length) { + return res; + } + var org_parser = document.createElement('a'); + var app_domain_parser = document.createElement('a'); + org_parser.href = origin; + for (var i = 0; i < allowed_domains.length && !res; i++) { + if (allowed_domains[i].indexOf("://") !== -1) { + app_domain_parser.href = allowed_domains[i]; + res = _urlCompare(org_parser, app_domain_parser); + } + } + delete org_parser, app_domain_parser; + return res; + } + + function _urlCompare(url_parser1, url_parser2) { + return ((url_parser1.hostname == url_parser2.hostname) && (url_parser1.protocol == url_parser2.protocol) && (url_parser1.port == url_parser2.port)); + } + + function _receive(e) { + if (e.data != '') { + var messageObject; + var serializerVersion = OSF.SerializerVersion.MsAjax; + var serializedMessage = e.data; + + try { + messageObject = Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, OSF.SerializerVersion.Browser); + serializerVersion = messageObject._serializerVersion != null ? messageObject._serializerVersion : serializerVersion; + } catch (ex) { + } + if (serializerVersion != OSF.SerializerVersion.Browser) { + try { + messageObject = Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, serializerVersion); + } catch (ex) { + return; + } + } + if (typeof (messageObject._messageType) == 'undefined') { + return; + } + + if (messageObject._messageType === Microsoft.Office.Common.MessageType.request) { + var requesterUrl = (e.origin == null || e.origin == "null") ? messageObject._origin : e.origin; + try { + var serviceEndPoint = _lookupServiceEndPoint(messageObject._conversationId); + ; + var conversation = serviceEndPoint._conversations[messageObject._conversationId]; + serializerVersion = conversation.serializerVersion != null ? conversation.serializerVersion : serializerVersion; + ; + if (!_checkOrigin(conversation.url, e.origin) && !_checkOriginWithAppDomains(serviceEndPoint._appDomains[messageObject._conversationId], e.origin)) { + throw "Failed origin check"; + } + var policyManager = serviceEndPoint.getPolicyManager(); + if (policyManager && !policyManager.checkPermission(messageObject._conversationId, messageObject._actionName, messageObject._data)) { + throw "Access Denied"; + } + var methodObject = _lookupMethodObject(serviceEndPoint, messageObject); + + var invokeCompleteCallback = new Microsoft.Office.Common.InvokeCompleteCallback(e.source, requesterUrl, messageObject._actionName, messageObject._conversationId, messageObject._correlationId, _postCallbackHandler, serializerVersion); + + var invoker = new Microsoft.Office.Common.Invoker(methodObject, messageObject._data, invokeCompleteCallback, serviceEndPoint._eventHandlerProxyList, messageObject._conversationId, messageObject._actionName, serializerVersion); + var shouldEnque = true; + + if (_messageProcessingTimer == null) { + if ((_lastMessageProcessTime == null || (new Date()).getTime() - _lastMessageProcessTime > _processInterval) && !_blockingFlag) { + _executeCommand(invoker); + shouldEnque = false; + } else { + _messageProcessingTimer = setInterval(_dequeInvoker, _processInterval); + } + } + if (shouldEnque) { + _enqueInvoker(invoker); + } + } catch (ex) { + var errorCode = Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest; + if (ex == "Access Denied") { + errorCode = Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied; + } + var callResponse = new Microsoft.Office.Common.Response(messageObject._actionName, messageObject._conversationId, messageObject._correlationId, errorCode, Microsoft.Office.Common.ResponseType.forCalling, ex); + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(callResponse, serializerVersion); + if (e.source && e.source.postMessage) { + e.source.postMessage(envelopedResult, requesterUrl); + } + } + } else if (messageObject._messageType === Microsoft.Office.Common.MessageType.response) { + var clientEndPoint = _lookupClientEndPoint(messageObject._conversationId); + clientEndPoint._serializerVersion = serializerVersion; + ; + if (!_checkOrigin(clientEndPoint._targetUrl, e.origin)) { + throw "Failed orgin check"; + } + if (messageObject._responseType === Microsoft.Office.Common.ResponseType.forCalling) { + var callbackEntry = clientEndPoint._callbackList[messageObject._correlationId]; + if (callbackEntry) { + try { + if (callbackEntry.callback) + callbackEntry.callback(messageObject._errorCode, messageObject._data); + } finally { + delete clientEndPoint._callbackList[messageObject._correlationId]; + } + } + } else { + var eventhandler = clientEndPoint._eventHandlerList[messageObject._actionName]; + if (eventhandler !== undefined && eventhandler !== null) { + eventhandler(messageObject._data); + } + } + } else { + return; + } + } + } + ; + + function _initialize() { + if (!_initialized) { + _registerListener(_receive); + _initialized = true; + } + } + ; + + return { + connect: function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl, serializerVersion) { + var clientEndPoint = _clientEndPoints[conversationId]; + if (!clientEndPoint) { + _initialize(); + clientEndPoint = new Microsoft.Office.Common.ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion); + _clientEndPoints[conversationId] = clientEndPoint; + } + return clientEndPoint; + }, + getClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _clientEndPoints[conversationId]; + }, + createServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) { + _initialize(); + var serviceEndPoint = new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId); + _serviceEndPoints[serviceEndPointId] = serviceEndPoint; + return serviceEndPoint; + }, + getServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) { + var e = Function._validateParams(arguments, [ + { name: "serviceEndPointId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + return _serviceEndPoints[serviceEndPointId]; + }, + deleteClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) { + var e = Function._validateParams(arguments, [ + { name: "conversationId", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete _clientEndPoints[conversationId]; + }, + _setMethodTimeout: function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) { + var e = Function._validateParams(arguments, [ + { name: "methodTimeout", type: Number, mayBeNull: false } + ]); + if (e) + throw e; + _methodTimeout = (methodTimeout <= 0) ? _methodTimeoutDefault : methodTimeout; + }, + _startMethodTimeoutTimer: function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() { + if (!_methodTimeoutTimer) { + _methodTimeoutTimer = setInterval(_checkMethodTimeout, _methodTimeoutProcessInterval); + } + } + }; +})(); + +Microsoft.Office.Common.Message = function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) { + var e = Function._validateParams(arguments, [ + { name: "messageType", type: Number, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "data", mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._messageType = messageType; + + this._actionName = actionName; + + this._conversationId = conversationId; + + this._correlationId = correlationId; + + this._origin = window.location.href; + + if (typeof data == "undefined") { + this._data = null; + } else { + this._data = data; + } +}; +Microsoft.Office.Common.Message.prototype = { + getActionName: function Microsoft_Office_Common_Message$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_Message$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() { + return this._correlationId; + }, + getOrigin: function Microsoft_Office_Common_Message$getOrigin() { + return this._origin; + }, + getData: function Microsoft_Office_Common_Message$getData() { + return this._data; + }, + getMessageType: function Microsoft_Office_Common_Message$getMessageType() { + return this._messageType; + } +}; + +Microsoft.Office.Common.Request = function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) { + Microsoft.Office.Common.Request.uber.constructor.call(this, Microsoft.Office.Common.MessageType.request, actionName, conversationId, correlationId, data); + this._actionType = actionType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Request, Microsoft.Office.Common.Message); +Microsoft.Office.Common.Request.prototype.getActionType = function Microsoft_Office_Common_Request$getActionType() { + return this._actionType; +}; + +Microsoft.Office.Common.Response = function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) { + Microsoft.Office.Common.Response.uber.constructor.call(this, Microsoft.Office.Common.MessageType.response, actionName, conversationId, correlationId, data); + this._errorCode = errorCode; + this._responseType = responseType; +}; +OSF.OUtil.extend(Microsoft.Office.Common.Response, Microsoft.Office.Common.Message); + +Microsoft.Office.Common.Response.prototype.getErrorCode = function Microsoft_Office_Common_Response$getErrorCode() { + return this._errorCode; +}; + +Microsoft.Office.Common.Response.prototype.getResponseType = function Microsoft_Office_Common_Response$getResponseType() { + return this._responseType; +}; + +Microsoft.Office.Common.MessagePackager = { + envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject, serializerVersion) { + if (serializerVersion == OSF.SerializerVersion.Browser && (typeof (JSON) !== "undefined")) { + if (typeof (messageObject) === "object") { + messageObject._serializerVersion = serializerVersion; + } + return JSON.stringify(messageObject); + } else { + if (typeof (messageObject) === "object") { + messageObject._serializerVersion = OSF.SerializerVersion.MsAjax; + } + return OsfMsAjaxFactory.msAjaxSerializer.serialize(messageObject); + } + }, + unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject, serializerVersion) { + if (serializerVersion == OSF.SerializerVersion.Browser && (typeof (JSON) !== "undefined")) { + return JSON.parse(messageObject); + } else { + return OsfMsAjaxFactory.msAjaxSerializer.deserialize(messageObject, true); + } + } +}; + +Microsoft.Office.Common.ResponseSender = function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "requesterWindow", mayBeNull: false }, + { name: "requesterUrl", type: String, mayBeNull: false }, + { name: "actionName", type: String, mayBeNull: false }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "correlationId", mayBeNull: false }, + { name: "responsetype", type: Number, maybeNull: false }, + { name: "serializerVersion", type: Number, maybeNull: true, optional: true } + ]); + if (e) + throw e; + + this._requesterWindow = requesterWindow; + + this._requesterUrl = requesterUrl; + + this._actionName = actionName; + + this._conversationId = conversationId; + + this._correlationId = correlationId; + + this._invokeResultCode = Microsoft.Office.Common.InvokeResultCode.noError; + + this._responseType = responseType; + var me = this; + + this._send = function (result) { + try { + var response = new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + ; + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:" + ex.message); + } + }; +}; +Microsoft.Office.Common.ResponseSender.prototype = { + getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() { + return this._requesterWindow; + }, + getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() { + return this._requesterUrl; + }, + getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() { + return this._actionName; + }, + getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() { + return this._conversationId; + }, + getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() { + return this._correlationId; + }, + getSend: function Microsoft_Office_Common_ResponseSender$getSend() { + return this._send; + }, + setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) { + this._invokeResultCode = resultCode; + } +}; + +Microsoft.Office.Common.InvokeCompleteCallback = function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler, serializerVersion) { + Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this, requesterWindow, requesterUrl, actionName, conversationId, correlationId, Microsoft.Office.Common.ResponseType.forCalling, serializerVersion); + + this._postCallbackHandler = postCallbackHandler; + var me = this; + + this._send = function (result) { + try { + var response = new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result); + + var envelopedResult = Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion); + + me._requesterWindow.postMessage(envelopedResult, me._requesterUrl); + + me._postCallbackHandler(); + } catch (ex) { + OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:" + ex.message); + } + }; +}; +OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback, Microsoft.Office.Common.ResponseSender); + +Microsoft.Office.Common.Invoker = function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName, serializerVersion) { + var e = Function._validateParams(arguments, [ + { name: "methodObject", mayBeNull: false }, + { name: "paramValue", mayBeNull: true }, + { name: "invokeCompleteCallback", mayBeNull: false }, + { name: "eventHandlerProxyList", mayBeNull: true }, + { name: "conversationId", type: String, mayBeNull: false }, + { name: "eventName", type: String, mayBeNull: false }, + { name: "serializerVersion", type: Number, mayBeNull: true, optional: true } + ]); + if (e) + throw e; + + this._methodObject = methodObject; + + this._param = paramValue; + + this._invokeCompleteCallback = invokeCompleteCallback; + + this._eventHandlerProxyList = eventHandlerProxyList; + + this._conversationId = conversationId; + + this._eventName = eventName; + this._serializerVersion = serializerVersion; +}; +Microsoft.Office.Common.Invoker.prototype = { + invoke: function Microsoft_Office_Common_Invoker$invoke() { + try { + var result; + switch (this._methodObject.getInvokeType()) { + case Microsoft.Office.Common.InvokeType.async: + this._methodObject.getMethod()(this._param, this._invokeCompleteCallback.getSend()); + break; + case Microsoft.Office.Common.InvokeType.sync: + result = this._methodObject.getMethod()(this._param); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncRegisterEvent: + var eventHandlerProxy = this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + result = this._methodObject.getMethod()(eventHandlerProxy.getSend(), this._param); + + this._eventHandlerProxyList[this._conversationId + this._eventName] = eventHandlerProxy.getSend(); + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.syncUnregisterEvent: + var eventHandler = this._eventHandlerProxyList[this._conversationId + this._eventName]; + + result = this._methodObject.getMethod()(eventHandler, this._param); + + delete this._eventHandlerProxyList[this._conversationId + this._eventName]; + + this._invokeCompleteCallback.getSend()(result); + break; + case Microsoft.Office.Common.InvokeType.asyncRegisterEvent: + var eventHandlerProxyAsync = this._createEventHandlerProxyObject(this._invokeCompleteCallback); + + this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(), this._invokeCompleteCallback.getSend(), this._param); + + this._eventHandlerProxyList[this._callerId + this._eventName] = eventHandlerProxyAsync.getSend(); + + break; + case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: + var eventHandlerAsync = this._eventHandlerProxyList[this._callerId + this._eventName]; + + this._methodObject.getMethod()(eventHandlerAsync, this._invokeCompleteCallback.getSend(), this._param); + + delete this._eventHandlerProxyList[this._callerId + this._eventName]; + + break; + default: + break; + } + } catch (ex) { + this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse); + this._invokeCompleteCallback.getSend()(ex); + } + }, + getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() { + return this._methodObject.getBlockingFlag(); + }, + _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) { + return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(), invokeCompleteObject.getRequesterUrl(), invokeCompleteObject.getActionName(), invokeCompleteObject.getConversationId(), invokeCompleteObject.getCorrelationId(), Microsoft.Office.Common.ResponseType.forEventing, this._serializerVersion); + } +}; + +OSF.OUtil.setNamespace("WAC", OSF.DDA); + +OSF.DDA.WAC.UniqueArguments = { + Data: "Data", + Properties: "Properties", + BindingRequest: "DdaBindingsMethod", + BindingResponse: "Bindings", + SingleBindingResponse: "singleBindingResponse", + GetData: "DdaGetBindingData", + AddRowsColumns: "DdaAddRowsColumns", + SetData: "DdaSetBindingData", + ClearFormats: "DdaClearBindingFormats", + SetFormats: "DdaSetBindingFormats", + SettingsRequest: "DdaSettingsMethod", + BindingEventSource: "ddaBinding", + ArrayData: "ArrayData" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.Delegate.SpecialProcessor = function OSF_DDA_WAC_Delegate_SpecialProcessor() { + var complexTypes = [ + OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + OSF.DDA.WAC.UniqueArguments.BindingRequest, + OSF.DDA.WAC.UniqueArguments.BindingResponse, + OSF.DDA.WAC.UniqueArguments.GetData, + OSF.DDA.WAC.UniqueArguments.AddRowsColumns, + OSF.DDA.WAC.UniqueArguments.SetData, + OSF.DDA.WAC.UniqueArguments.ClearFormats, + OSF.DDA.WAC.UniqueArguments.SetFormats, + OSF.DDA.WAC.UniqueArguments.SettingsRequest, + OSF.DDA.WAC.UniqueArguments.BindingEventSource + ]; + var dynamicTypes = {}; + OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); +}; + +OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.WAC.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor(), []); +OSF.OUtil.setNamespace("WAC", OSF.DDA); +OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC); +OSF.DDA.WAC.getDelegateMethods = function OSF_DDA_WAC_getDelegateMethods() { + var delegateMethods = {}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.WAC.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.WAC.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.WAC.Delegate.unregisterEventAsync; + return delegateMethods; +}; +OSF.DDA.WAC.Delegate.version = 1; +OSF.DDA.WAC.Delegate.executeAsync = function OSF_DDA_WAC_Delegate$executeAsync(args) { + if (!args.hostCallArgs) { + args.hostCallArgs = {}; + } + args.hostCallArgs["DdaMethod"] = { + "ControlId": OSF._OfficeAppFactory.getId(), + "Version": OSF.DDA.WAC.Delegate.version, + "DispatchId": args.dispId + }; + + args.hostCallArgs["__timeout__"] = -1; + + if (args.onCalling) { + args.onCalling(); + } + var startTime = (new Date()).getTime(); + OSF.getClientEndPoint().invoke("executeMethod", function OSF_DDA_WAC_Delegate$OMFacade$OnResponse(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var error; + if (xdmStatus == Microsoft.Office.Common.InvokeResultCode.noError) { + OSF.DDA.WAC.Delegate.version = payload["Version"]; + error = payload["Error"]; + } else { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + error = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + error = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(error, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, null, Math.abs((new Date()).getTime() - startTime), error); + } + }, args.hostCallArgs); +}; +OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent = function OSF_DDA_WAC_Delegate$GetOnAfterRegisterEvent(register, args) { + var startTime = (new Date()).getTime(); + return function OSF_DDA_WAC_Delegate$OnAfterRegisterEvent(xdmStatus, payload) { + if (args.onReceiving) { + args.onReceiving(); + } + var status; + if (xdmStatus != Microsoft.Office.Common.InvokeResultCode.noError) { + switch (xdmStatus) { + case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + default: + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } else { + if (payload) { + if (payload["Error"]) { + status = payload["Error"]; + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } + } else { + status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.WAC.Delegate.registerEventAsync = function OSF_DDA_WAC_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), function OSF_DDA_WACOMFacade$OnEvent(payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.DDA.WAC.Delegate.unregisterEventAsync = function OSF_DDA_WAC_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args), { + "controlId": OSF._OfficeAppFactory.getId(), + "eventDispId": args.dispId, + "targetId": args.targetId + }); +}; +OSF.OUtil.setNamespace("WebApp", OSF); + +OSF.WebApp.AddHostInfoAndXdmInfo = function OSF_WebApp$AddHostInfoAndXdmInfo(url) { + if (OSF._OfficeAppFactory.getWindowLocationSearch && OSF._OfficeAppFactory.getWindowLocationHash) { + return url + OSF._OfficeAppFactory.getWindowLocationSearch() + OSF._OfficeAppFactory.getWindowLocationHash(); + } else { + return url; + } +}; + +OSF.WebApp._UpdateLinksForHostAndXdmInfo = function OSF_WebApp$_UpdateLinksForHostAndXdmInfo() { + var links = document.querySelectorAll("a[data-officejs-navigate]"); + for (var i = 0; i < links.length; i++) { + if (OSF.WebApp._isGoodUrl(links[i].href)) { + links[i].href = OSF.WebApp.AddHostInfoAndXdmInfo(links[i].href); + } + } + + var forms = document.querySelectorAll("form[data-officejs-navigate]"); + for (var i = 0; i < forms.length; i++) { + var form = forms[i]; + if (OSF.WebApp._isGoodUrl(form.action)) { + form.action = OSF.WebApp.AddHostInfoAndXdmInfo(form.action); + } + } +}; + +OSF.WebApp._isGoodUrl = function OSF_WebApp$_isGoodUrl(url) { + if (typeof url == 'undefined') + return false; + url = url.trim(); + var colonIndex = url.indexOf(':'); + var protocol = colonIndex > 0 ? url.substr(0, colonIndex) : null; + + var goodUrl = protocol !== null ? protocol.toLowerCase() === "http" || protocol.toLowerCase() === "https" : true; + + goodUrl = goodUrl && url != "#" && url != "/" && url != "" && url != OSF._OfficeAppFactory.getWebAppState().webAppUrl; + return goodUrl; +}; + +OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo = hostInfo; + this._webAppState = webAppState; + this._context = context; + this._settings = settings; + this._hostFacade = hostFacade; + this._initializeSettings = function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) { + var settings; + var serializedSettings = appContext.get_settings(); + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings = typeof (JSON) !== "undefined" ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings = typeof (JSON) !== "undefined" ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings = new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings = new OSF.DDA.Settings(deserializedSettings); + } + return settings; + }; + + var windowOpen = function OSF_InitializationHelper$windowOpen(windowObj) { + var proxy = window.open; + windowObj.open = function (strUrl, strWindowName, strWindowFeatures) { + var windowObject = null; + try { + windowObject = proxy(strUrl, strWindowName, strWindowFeatures); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen." + ex); + } + } + if (!windowObject) { + var params = { + "strUrl": strUrl, + "strWindowName": strWindowName, + "strWindowFeatures": strWindowFeatures + }; + OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost", null, params); + } + return windowObject; + }; + }; + windowOpen(window); +}; +OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var getInvocationCallbackWebApp = function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) { + var settings; + if (appContext._appName === OSF.AppName.ExcelWebApp) { + var serializedSettings = appContext._settings; + settings = {}; + for (var index in serializedSettings) { + var setting = serializedSettings[index]; + settings[setting[0]] = setting[1]; + } + } else { + settings = appContext._settings; + } + if (errorCode === 0 && appContext._id != undefined && appContext._appName != undefined && appContext._appVersion != undefined && appContext._appUILocale != undefined && appContext._dataLocale != undefined && appContext._docUrl != undefined && appContext._clientMode != undefined && appContext._settings != undefined && appContext._reason != undefined) { + var appInstanceId = appContext._id; + + var touchEnabled = false; + + var commerceAllowed = true; + var minorVersion = 0; + if (appContext._minorVersion != undefined) { + minorVersion = appContext._minorVersion; + } + var requirementMatrix = undefined; + if (appContext._requirementMatrix != undefined) { + requirementMatrix = appContext._requirementMatrix; + } + var returnedContext = new OSF.OfficeAppContext(appContext._id, appContext._appName, appContext._appVersion, appContext._appUILocale, appContext._dataLocale, appContext._docUrl, appContext._clientMode, settings, appContext._reason, appContext._osfControlType, appContext._eToken, appContext._correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + } else { + var errorMsg = "Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is " + errorCode + ", exception: " + appContext; + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException(errorMsg); + } + throw errorMsg; + } + }; + try { + this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync", getInvocationCallbackWebApp, this._webAppState.id); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:[" + ex + "]"); + } + throw ex; + } +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() { + try { + var me = this; + var xdmInfoValue = OSF.OUtil.parseXdmInfoWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + if (xdmInfoValue) { + var xdmItems = OSF.OUtil.getInfoItems(xdmInfoValue); + if (xdmItems != undefined && xdmItems.length >= 3) { + me._webAppState.conversationID = xdmItems[0]; + me._webAppState.id = xdmItems[1]; + me._webAppState.webAppUrl = xdmItems[2]; + } + } + me._webAppState.serializerVersion = OSF.OUtil.parseSerializerVersionWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash()); + me._webAppState.clientEndPoint = Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID, me._webAppState.wnd, me._webAppState.webAppUrl, me._webAppState.serializerVersion); + me._webAppState.serviceEndPoint = Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id); + var notificationConversationId = me._webAppState.conversationID + OSF.SharedConstants.NotificationConversationIdSuffix; + me._webAppState.serviceEndPoint.registerConversation(notificationConversationId, me._webAppState.webAppUrl); + var focusFirstItem = function OSF_OfficeAppFactory_initialize$focusFirstItem() { + if (!me._webAppState.focused) { + me._webAppState.focused = true; + var list = document.querySelectorAll('input,a,button'); + for (var i = 0; i < list.length; i++) { + var node = list[i]; + if (node instanceof HTMLElement) { + var element = node; + element.focus(); + break; + } + } + } + }; + var notifyAgave = function OSF__OfficeAppFactory_initialize$notifyAgave(actionId) { + switch (actionId) { + case OSF.AgaveHostAction.Select: + me._webAppState.focused = true; + break; + case OSF.AgaveHostAction.UnSelect: + me._webAppState.focused = false; + break; + case OSF.AgaveHostAction.CtrlF6In: + focusFirstItem(); + default: + OsfMsAjaxFactory.msAjaxDebug.trace("actionId " + actionId + " notifyAgave is wrong."); + break; + } + }; + me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave", notifyAgave, Microsoft.Office.Common.InvokeType.async, false); + OSF.OUtil.addEventListener(window, "focus", function () { + if (!me._webAppState.focused) { + me._webAppState.focused = true; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.Select]); + }); + OSF.OUtil.addEventListener(window, "blur", function () { + if (me._webAppState.focused) { + me._webAppState.focused = false; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.UnSelect]); + }); + + OSF.OUtil.addEventListener(window, "keydown", function (e) { + if (e.keyCode == 117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + var actionId = OSF.AgaveHostAction.CtrlF6Exit; + if (e.shiftKey) { + actionId = OSF.AgaveHostAction.CtrlF6ExitShift; + } + me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, actionId]); + } + }); + + OSF.OUtil.addEventListener(window, "keypress", function (e) { + if (e.keyCode == 117 && e.ctrlKey) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + } + }); + } catch (ex) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:[" + ex + "]"); + } + throw ex; + } +}; +OSF.getClientEndPoint = function OSF$getClientEndPoint() { + var initializationHelper = OSF._OfficeAppFactory.getInitializationHelper(); + return initializationHelper._webAppState.clientEndPoint; +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData = (function () { + function BaseUsageData(table) { + this._table = table; + this._fields = {}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields = function () { + }; + BaseUsageData.prototype.SetSerializedField = function (key, value) { + if (typeof (value) !== "undefined" && value !== null) { + this._serializedFields[key] = value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow = function () { + this._serializedFields = {}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData = BaseUsageData; + var AppActivatedUsageData = (function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"] = value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData = AppActivatedUsageData; + var ScriptLoadUsageData = (function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData = ScriptLoadUsageData; + var AppClosedUsageData = (function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"] = value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData = AppClosedUsageData; + var APIUsageUsageData = (function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"] = value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData = APIUsageUsageData; + var AppInitializationUsageData = (function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"] = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"] = value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields = function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData = AppInitializationUsageData; +})(OSFLog || (OSFLog = {})); + + +var Logger; +(function (Logger) { + "use strict"; + + + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"] = 0] = "info"; + TraceLevel[TraceLevel["warning"] = 1] = "warning"; + TraceLevel[TraceLevel["error"] = 2] = "error"; + })(Logger.TraceLevel || (Logger.TraceLevel = {})); + var TraceLevel = Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"] = 0] = "none"; + SendFlag[SendFlag["flush"] = 1] = "flush"; + })(Logger.SendFlag || (Logger.SendFlag = {})); + var SendFlag = Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData = allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs = JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog = sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy = (function () { + function ULSEndpointProxy() { + var _this = this; + this.proxyFrame = null; + this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer = []; + this.proxyFrameReady = false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog = function (log) { + if (this.proxyFrameReady === true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame = function () { + if (this.proxyFrame == null) { + this.proxyFrame = document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) { + var _this = this; + if (e.data === "ProxyFrameReadyToLog") { + this.proxyFrameReady = true; + for (var i = 0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length = 0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data === "ProxyFrameReadyToInit") { + var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr = JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger = Logger; + } + + Logger.ulsEndpoint = creatULSEndpoint(); +})(Logger || (Logger = {})); + + + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId = OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId = ""; + + + ; + + var AppInfo = (function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event = (function () { + function Event(name, handler) { + this.name = name; + this.handler = handler; + } + return Event; + })(); + var AppStorage = (function () { + function AppStorage() { + this.clientIDKey = "Office API client"; + this.logIdSetKey = "Office App Log Id Set"; + } + AppStorage.prototype.getClientId = function () { + var clientId = this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <= 0 || clientId.length > 40) { + clientId = OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog = function (logId, log) { + var logIdSet = this.getValue(this.logIdSetKey); + logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog = function (callback, clean) { + var logIdSet = this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids = logIdSet.split(";"); + for (var id in ids) { + var logId = ids[id]; + var log = this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + var value = ""; + if (osfLocalStorage) { + value = osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue = function (key, value) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove = function (key) { + var osfLocalStorage = OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger = (function () { + function AppLogger() { + } + AppLogger.prototype.LogData = function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData = function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo = new AppInfo(); + appInfo.hostVersion = context.get_appVersion(); + appInfo.appId = context.get_id(); + appInfo.host = context.get_appName(); + appInfo.browser = window.navigator.userAgent; + appInfo.correlationId = context.get_correlationId(); + appInfo.clientId = (new AppStorage()).getClientId(); + var index = location.href.indexOf("?"); + appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId = ""; + appInfo.userId = ""; + try { + xmlContent = decodeURIComponent(token); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent = null; + xmlDoc = null; + parser = null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime = new Date(); + + var lastFocus = null; + + var focusTime = 0; + var finished = false; + var adjustFocusTime = function () { + if (document.hasFocus()) { + if (lastFocus == null) { + lastFocus = new Date(); + } + } else if (lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + }; + var eventList = []; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction = function () { + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length = 0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus = null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished = true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i = 0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize = initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data = new OSFLog.AppActivatedUsageData(); + data.SessionId = sessionId; + data.AppId = appInfo.appId; + data.AssetId = appInfo.assetId; + data.AppURL = appInfo.appURL; + data.UserId = appInfo.userId; + data.ClientId = appInfo.clientId; + data.Browser = appInfo.browser; + data.Host = appInfo.host; + data.HostVersion = appInfo.hostVersion; + data.CorrelationId = appInfo.correlationId; + data.AppSizeWidth = window.innerWidth; + data.AppSizeHeight = window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated = onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data = new OSFLog.ScriptLoadUsageData(); + data.CorrelationId = appCorrelationId; + data.SessionId = sessionId; + data.ScriptId = scriptId; + data.StartTime = msStartTime; + data.ResponseTime = msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone = onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data = new OSFLog.APIUsageUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.APIType = apiType; + data.APIID = id; + data.Parameters = parameters; + data.ResponseTime = msResponseTime; + data.ErrorType = errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone = onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters = null; + if (args) { + if (typeof args == "number") { + parameters = String(args); + } else if (typeof args === "object") { + for (var index in args) { + if (parameters !== null) { + parameters += ","; + } else { + parameters = ""; + } + if (typeof args[index] == "number") { + parameters += String(args[index]); + } + } + } else { + parameters = ""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone = onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone = onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone = onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone = onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data = new OSFLog.AppClosedUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.FocusTime = focusTime; + data.OpenTime = openTime; + data.AppSizeFinalWidth = window.innerWidth; + data.AppSizeFinalHeight = window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed = onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId = correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data = new OSFLog.AppInitializationUsageData(); + data.CorrelationId = osfControlAppCorrelationId; + data.SessionId = sessionId; + data.SuccessCode = isException ? 1 : 0; + data.Message = message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException = logAppException; + OSF.AppTelemetry = OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry = {})); + +Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data == null || data == undefined) { + return null; + } + try { + for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data = [data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers = fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ? [] : fixData(value); + } + } + }); + this.headers = headers; + this.rows = rows; +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; + +Microsoft.Office.WebExtension.CoercionType = { + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim = 0; + for (var index = 0; index < obj.length; index++) { + dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim + 1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data == null || data == undefined) + return null; + var sourceType = null; + var runtimeType = typeof data; + if (data.rows !== undefined) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) { + sourceType = Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType != destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length == 1 && matrix[0].length == 1) + return "" + matrix[0][0]; + var val = ""; + for (var i = 0; i < matrix.length; i++) { + val += matrix[i].join("\t") + "\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret = text.split("\n"); + for (var i = 0; i < ret.length; i++) + ret[i] = ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers = ""; + if (table.headers != null) { + headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n"; + } + + var rows = OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows == "") { + headers = headers.substring(0, headers.length - 1); + } + return headers + rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix = table.rows; + if (table.headers != null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value = null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value == null) { + value = OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType == undefined) { + sourceType = OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value = data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value = new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Ooxml: "ooxml" }); +Microsoft.Office.WebExtension.EventType = {}; + +OSF.EventDispatch = function OSF_EventDispatch(eventTypes) { + this._eventHandlers = {}; + for (var entry in eventTypes) { + var eventType = eventTypes[entry]; + this._eventHandlers[eventType] = []; + } +}; +OSF.EventDispatch.prototype = { + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events = []; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported = false; + for (var eventName in this._eventHandlers) { + if (event == eventName) { + isSupported = true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h] === handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler != "function") { + return false; + } + var handlers = this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers = this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index = 0; index < handlers.length; index++) { + if (handlers[index] === handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType] = []; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type == undefined) + return false; + var eventType = eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers = this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args = new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args = new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args = new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args = new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args = new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.DDA.DataPartProperties = { + Id: Microsoft.Office.WebExtension.Parameters.Id, + BuiltIn: "DataPartBuiltIn" +}; +OSF.DDA.DataNodeProperties = { + Handle: "DataNodeHandle", + BaseName: "DataNodeBaseName", + NamespaceUri: "DataNodeNamespaceUri", + NodeType: "DataNodeType" +}; +OSF.DDA.DataNodeEventProperties = { + OldNode: "OldNode", + NewNode: "NewNode", + NextSiblingNode: "NextSiblingNode", + InUndoRedo: "InUndoRedo" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + DataPartProperties: "DataPartProperties", + DataNodeProperties: "DataNodeProperties" +}); +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { + DataPartList: "DataPartList", + DataNodeList: "DataNodeList" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataPartList, OSF.DDA.PropertyDescriptors.DataPartProperties); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataNodeList, OSF.DDA.PropertyDescriptors.DataNodeProperties); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { + DataNodeInsertedEvent: "DataNodeInsertedEvent", + DataNodeReplacedEvent: "DataNodeReplacedEvent", + DataNodeDeletedEvent: "DataNodeDeletedEvent" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + DataNodeDeleted: "nodeDeleted", + DataNodeInserted: "nodeInserted", + DataNodeReplaced: "nodeReplaced" +}); + +OSF.DDA.CustomXmlParts = function OSF_DDA_CustomXmlParts() { + this._eventDispatches = []; + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; + +OSF.DDA.CustomXmlPart = function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + + var customXmlPartEventDispatches = customXmlParts._eventDispatches; + var dispatch = customXmlPartEventDispatches[id]; + if (!dispatch) { + var et = Microsoft.Office.WebExtension.EventType; + dispatch = new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id] = dispatch; + } + + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; + +OSF.DDA.CustomXmlPrefixMappings = function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], partId); +}; + +OSF.DDA.CustomXmlNode = function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], handle); +}; + +OSF.DDA.NodeInsertedEventArgs = function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs = function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs = function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureDataNode = function OSF_DDA_OMFactory$manufactureDataNode(nodeProperties) { + if (nodeProperties) { + return new OSF.DDA.CustomXmlNode(nodeProperties[OSF.DDA.DataNodeProperties.Handle], nodeProperties[OSF.DDA.DataNodeProperties.NodeType], nodeProperties[OSF.DDA.DataNodeProperties.NamespaceUri], nodeProperties[OSF.DDA.DataNodeProperties.BaseName]); + } +}; +OSF.DDA.OMFactory.manufactureDataPart = function OSF_DDA_OMFactory$manufactureDataPart(partProperties, containingCustomXmlParts) { + return new OSF.DDA.CustomXmlPart(containingCustomXmlParts, partProperties[OSF.DDA.DataPartProperties.Id], partProperties[OSF.DDA.DataPartProperties.BuiltIn]); +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddDataPartAsync: "addAsync", + GetDataPartByIdAsync: "getByIdAsync", + GetDataPartsByNameSpaceAsync: "getByNamespaceAsync", + DeleteDataPartAsync: "deleteAsync", + GetPartNodesAsync: "getNodesAsync", + GetPartXmlAsync: "getXmlAsync", + AddDataPartNamespaceAsync: "addNamespaceAsync", + GetDataPartNamespaceAsync: "getNamespaceAsync", + GetDataPartPrefixAsync: "getPrefixAsync", + GetRelativeNodesAsync: "getNodesAsync", + GetNodeValueAsync: "getNodeValueAsync", + GetNodeXmlAsync: "getXmlAsync", + SetNodeValueAsync: "setNodeValueAsync", + SetNodeXmlAsync: "setXmlAsync" +}); + +(function () { + function processDataPart(dataPartDescriptor) { + return OSF.DDA.OMFactory.manufactureDataPart(dataPartDescriptor, Microsoft.Office.WebExtension.context.document.customXmlParts); + } + function processDataNode(dataNodeDescriptor) { + return OSF.DDA.OMFactory.manufactureDataNode(dataNodeDescriptor); + } + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + return data == undefined ? null : data; + } + function getObjectId(obj) { + return obj.id; + } + function getPartId(part, partId) { + return partId; + } + ; + function getNodeHandle(node, nodeHandle) { + return nodeHandle; + } + ; + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddDataPartAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processDataPart + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processDataPart + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataPartList], processDataPart); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteDataPartAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetPartNodesAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetPartXmlAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetNodeValueAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetNodeXmlAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetNodeValueAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetNodeXmlAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ] + }); +})(); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +OSF.DDA.Marshaling.CustomXmlPartsKeys = { + Id: "id", + Namespace: "namespace", + Xml: "xml", + XPath: "xpath", + Prefix: "prefix" +}; +OSF.DDA.Marshaling.DataPartProperties = { + Id: "id", + BuiltIn: "DataPartBuiltIn" +}; +OSF.DDA.Marshaling.PropertyDescriptors = { + DataPartProperties: "dataPartProperties", + DataNodeProperties: "dataNodeProperties" +}; +OSF.DDA.Marshaling.DataNodeProperties = { + Handle: "DataNodeHandle", + BaseName: "DataNodeBaseName", + NamespaceUri: "DataNodeNamespaceUri", + NodeType: "DataNodeType" +}; +OSF.DDA.Marshaling.ListDescriptors = { + DataPartList: "DataPartList", + DataNodeList: "DataNodeList" +}; + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: OSF.DDA.Marshaling.DataPartProperties.Id }, + { name: OSF.DDA.DataPartProperties.BuiltIn, value: OSF.DDA.Marshaling.DataPartProperties.BuiltIn } + ], + isComplexType: true +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: OSF.DDA.Marshaling.DataNodeProperties.Handle }, + { name: OSF.DDA.DataNodeProperties.BaseName, value: OSF.DDA.Marshaling.DataNodeProperties.BaseName }, + { name: OSF.DDA.DataNodeProperties.NamespaceUri, value: OSF.DDA.Marshaling.DataNodeProperties.NamespaceUri }, + { name: OSF.DDA.DataNodeProperties.NodeType, value: OSF.DDA.Marshaling.DataNodeProperties.NodeType } + ], + isComplexType: true +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.Marshaling.PropertyDescriptors.DataPartProperties } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Xml, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Xml } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.Marshaling.PropertyDescriptors.DataPartProperties } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Id } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: OSF.DDA.Marshaling.ListDescriptors.DataPartList } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartXmlMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Id } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.Marshaling.ListDescriptors.DataNodeList } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Id }, + { name: Microsoft.Office.WebExtension.Parameters.XPath, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.XPath } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidDeleteDataPartMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Id } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodeValueMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: OSF.DDA.Marshaling.DataNodeProperties.Handle } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: OSF.DDA.Marshaling.DataNodeProperties.Handle } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.Marshaling.ListDescriptors.DataNodeList } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: OSF.DDA.Marshaling.DataNodeProperties.Handle }, + { name: Microsoft.Office.WebExtension.Parameters.XPath, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.XPath } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: OSF.DDA.Marshaling.DataNodeProperties.Handle }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: OSF.DDA.Marshaling.DataNodeProperties.Handle }, + { name: Microsoft.Office.WebExtension.Parameters.Xml, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Xml } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddDataNamespaceMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.DataPartProperties.Id }, + { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Prefix }, + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.DataPartProperties.Id }, + { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Prefix } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.DataPartProperties.Id }, + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.GetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: "ValueFormat" }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: "FilterType" }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" }, + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SetData, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }, + { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.SettingsManager = { + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret = {}; + for (var key in settingsCollection) { + var value = settingsCollection[key]; + try { + if (JSON) { + value = JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret = {}; + serializedSettings = serializedSettings || {}; + for (var key in serializedSettings) { + var value = serializedSettings[key]; + try { + if (JSON) { + value = JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) { + d = new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key] = value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings = function OSF_DDA_Settings(settings) { + settings = settings || {}; + + var cacheSessionSettings = function (settings) { + var osfSessionStorage = OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting = settings[name]; + return typeof (setting) === 'undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name] = value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e = Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); +OSF.DDA.WAC.SettingsTranslator = (function () { + var keyIndex = 0; + var valueIndex = 1; + return { + read: function OSF_DDA_WAC_SettingsTranslator$read(payload) { + if (payload.Settings) { + var serializedSettings = {}; + var settingsPayload = payload.Settings; + for (var index in settingsPayload) { + var setting = settingsPayload[index]; + serializedSettings[setting[keyIndex]] = setting[valueIndex]; + } + return serializedSettings; + } else if (typeof window["OSFPPTWAC"] != "undefined") { + return payload; + } else { + var serializedSettings = {}; + return serializedSettings; + } + }, + write: function OSF_DDA_WAC_SettingsTranslator$write(serializedSettings) { + var settingsPayload = []; + for (var key in serializedSettings) { + var setting = []; + setting[keyIndex] = key; + setting[valueIndex] = serializedSettings[key]; + settingsPayload.push(setting); + } + return settingsPayload; + } + }; +})(); +OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings, { + toHost: OSF.DDA.WAC.SettingsTranslator.write, + fromHost: OSF.DDA.WAC.SettingsTranslator.read +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SettingsRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: "OverwriteIfStale" }, + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ], + invertible: true +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SettingsRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs = function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); +OSF.DDA.FilePropertiesDescriptor = { + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties = function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); + +var OSF_DDA_Marshaling_FilePropertiesKeys; +(function (OSF_DDA_Marshaling_FilePropertiesKeys) { + OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Properties"] = 0] = "Properties"; + + OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Url"] = 1] = "Url"; +})(OSF_DDA_Marshaling_FilePropertiesKeys || (OSF_DDA_Marshaling_FilePropertiesKeys = {})); +; +OSF.DDA.Marshaling.FilePropertiesKeys = OSF_DDA_Marshaling_FilePropertiesKeys; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: OSF.DDA.Marshaling.FilePropertiesKeys.Url } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.Marshaling.FilePropertiesKeys.Properties } + ] +}); +Microsoft.Office.WebExtension.FileType = { + Text: "text", + Compressed: "compressed", + Pdf: "pdf" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FileProperties: "FileProperties", + FileSliceProperties: "FileSliceProperties" +}); +OSF.DDA.FileProperties = { + Handle: "FileHandle", + FileSize: "FileSize", + SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize +}; +OSF.DDA.File = function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState = {}; + privateState[OSF.DDA.FileProperties.Handle] = handle; + privateState[OSF.DDA.FileProperties.SliceSize] = sliceSize; + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], privateState); +}; + +OSF.DDA.FileSliceOffset = "fileSliceoffset"; +OSF.DDA.AsyncMethodNames.addNames({ + GetDocumentCopyAsync: "getFileAsync", + GetDocumentCopyChunkAsync: "getSliceAsync", + ReleaseDocumentCopyAsync: "closeAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.FileType, + "enum": Microsoft.Office.WebExtension.FileType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SliceSize, + value: { + "types": ["number"], + "defaultValue": 4 * 1024 * 1024 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var sliceSize = callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]; + + if (sliceSize <= 0 || sliceSize > (4 * 1024 * 1024)) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize; + } + return callArgs; + }, + onSucceeded: function (fileDescriptor, caller, callArgs) { + return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]); + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.SliceIndex, + "types": ["number"] + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + }, + { + name: OSF.DDA.FileProperties.SliceSize, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.SliceSize]; + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var index = callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]; + + if (index < 0 || index >= caller.sliceCount) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange; + } + + callArgs[OSF.DDA.FileSliceOffset] = parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString()); + return callArgs; + }, + onSucceeded: function (sliceDescriptor, caller, callArgs) { + var slice = {}; + OSF.OUtil.defineEnumerableProperties(slice, { + "data": { + value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data] + }, + "index": { + value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex] + }, + "size": { + value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize] + } + }); + return slice; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync, + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + } + ] +}); +OSF.OUtil.setNamespace("Marshaling", OSF.DDA); +OSF.OUtil.setNamespace("File", OSF.DDA.Marshaling); + +var OSF_DDA_Marshaling_File_FilePropertiesKeys; +(function (OSF_DDA_Marshaling_File_FilePropertiesKeys) { + OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["Handle"] = 0] = "Handle"; + OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["FileSize"] = 1] = "FileSize"; +})(OSF_DDA_Marshaling_File_FilePropertiesKeys || (OSF_DDA_Marshaling_File_FilePropertiesKeys = {})); +; +OSF.DDA.Marshaling.File.FilePropertiesKeys = OSF_DDA_Marshaling_File_FilePropertiesKeys; +var OSF_DDA_Marshaling_File_SlicePropertiesKeys; +(function (OSF_DDA_Marshaling_File_SlicePropertiesKeys) { + OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["Data"] = 0] = "Data"; + OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["SliceSize"] = 1] = "SliceSize"; +})(OSF_DDA_Marshaling_File_SlicePropertiesKeys || (OSF_DDA_Marshaling_File_SlicePropertiesKeys = {})); +; +OSF.DDA.Marshaling.File.SlicePropertiesKeys = OSF_DDA_Marshaling_File_SlicePropertiesKeys; +var OSF_DDA_Marshaling_File_FileType; +(function (OSF_DDA_Marshaling_File_FileType) { + OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Text"] = 0] = "Text"; + OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Compressed"] = 1] = "Compressed"; + OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Pdf"] = 2] = "Pdf"; +})(OSF_DDA_Marshaling_File_FileType || (OSF_DDA_Marshaling_File_FileType = {})); +; +OSF.DDA.Marshaling.File.FileType = OSF_DDA_Marshaling_File_FileType; +var OSF_DDA_Marshaling_File_ParameterKeys; +(function (OSF_DDA_Marshaling_File_ParameterKeys) { + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["FileType"] = 0] = "FileType"; + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceSize"] = 1] = "SliceSize"; + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["Handle"] = 2] = "Handle"; + OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceIndex"] = 3] = "SliceIndex"; +})(OSF_DDA_Marshaling_File_ParameterKeys || (OSF_DDA_Marshaling_File_ParameterKeys = {})); +; +OSF.DDA.Marshaling.File.ParameterKeys = OSF_DDA_Marshaling_File_ParameterKeys; +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties); +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle }, + { name: OSF.DDA.FileProperties.FileSize, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data }, + { name: OSF.DDA.FileProperties.SliceSize, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: Microsoft.Office.WebExtension.FileType.Text, value: OSF.DDA.Marshaling.File.FileType.Text }, + { name: Microsoft.Office.WebExtension.FileType.Compressed, value: OSF.DDA.Marshaling.File.FileType.Compressed }, + { name: Microsoft.Office.WebExtension.FileType.Pdf, value: OSF.DDA.Marshaling.File.FileType.Pdf } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.FileType, value: OSF.DDA.Marshaling.File.ParameterKeys.FileType }, + { name: Microsoft.Office.WebExtension.Parameters.SliceSize, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceSize } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle }, + { name: Microsoft.Office.WebExtension.Parameters.SliceIndex, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle }] +}); +OSF.DDA.AsyncMethodNames.addNames({ + ExecuteRichApiRequestAsync: "executeRichApiRequestAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.Data, + types: ["object"] + } + ], + supportedOptions: [] +}); +OSF.OUtil.setNamespace("RichApi", OSF.DDA); +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.ArrayData } + ], + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ] +}); + +Microsoft.Office.WebExtension.BindingType = { + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties = { + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise = function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id = bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t = typeof onError; + if (t != "undefined" && t != "function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback = onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype = { + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me = this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status == Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args = arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade = function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches = []; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding = function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding = function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am = OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et = Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches = docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id] = new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch = bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId = function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_" + OSF.OUtil.getUniqueId() + "_" + new Date().getTime(); +}; +OSF.DDA.OMFactory = OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding = function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id = bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows = bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols = bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders = bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding = new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding = new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp = function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject = OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject = OSF.DDA.TableBinding; + } + binding = new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding = new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) { + data = OSF.DDA.OMFactory.manufactureTableData(data); + } + data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data == undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id = callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] == 0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] == 0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] != OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.DDA.TextBinding = function OSF_DDA_TextBinding(id, docInstance) { + OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperty(this, "type", { + value: Microsoft.Office.WebExtension.BindingType.Text + }); +}; +OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding); +OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.BindingRequest, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: "ItemName" }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: "BindingType" }, + { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: "PromptText" }, + { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" }, + { name: Microsoft.Office.WebExtension.Parameters.SampleData, value: "SampleData" }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: "FailOnCollision" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 2 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 3 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 1 } + ], + invertible: true +}); +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: "Name" }, + { name: OSF.DDA.BindingProperties.Type, value: "BindingType" }, + { name: OSF.DDA.BindingProperties.RowCount, value: "RowCount" }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: "ColCount" }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: "HasHeaders" } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.WAC.UniqueArguments.BindingResponse } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data } + ], + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WAC.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self } + ] +}); +var OSFWordWAC; +(function (OSFWordWAC) { + var WordDocument = (function () { + function WordDocument(officeAppContext, settings) { + OSF.DDA.WordDocument.uber.constructor.call(this, officeAppContext, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + OSF.DDA.AsyncMethodNames.SaveAsync, + OSF.DDA.AsyncMethodNames.RefreshAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([ + Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + ])); + OSF.OUtil.defineEnumerableProperty(this, "customXmlParts", { + value: new OSF.DDA.CustomXmlParts() + }); + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + value: new OSF.DDA.BindingFacade(this) + }); + OSF.OUtil.finalizeProperties(this); + } + return WordDocument; + })(); + OSFWordWAC.WordDocument = WordDocument; +})(OSFWordWAC || (OSFWordWAC = {})); +OSF.DDA.WordDocument = OSFWordWAC.WordDocument; + +OSF.OUtil.extend(OSF.DDA.WordDocument, OSF.DDA.Document); +OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType, { + Html: "html", + Text: "text", + Ooxml: "ooxml", + Table: "table", + Matrix: "matrix" +}); +OSF.DDA.TableDataProperties = { + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc = new OSF.DDA.WordDocument(appContext, this._initializeSettings(appContext, true)); + OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]); + appReady(); +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + OSF.WebApp._UpdateLinksForHostAndXdmInfo(); + var license = new OSF.DDA.License(appContext.get_eToken()); + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license)); + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.WAC.getDelegateMethods, OSF.DDA.WAC.Delegate.ParameterMap)); + var reason = appContext.get_reason(); + Microsoft.Office.WebExtension.initialize(reason); +}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-web-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-web-16.00.js new file mode 100644 index 000000000..4e3b4a99e --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-web-16.00.js @@ -0,0 +1,11 @@ +/* Word Online Applications specific API library */ +/* Version: 16.0.6207.1000 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +var __extends=this.__extends||function(b,a){for(var c in a)if(a.hasOwnProperty(c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d},OfficeExt;(function(b){var a=function(){var b=null,a=true;function c(){}c.prototype.isMsAjaxLoaded=function(){var b="function",c="undefined";if(typeof Sys!==c&&typeof Type!==c&&Sys.StringBuilder&&typeof Sys.StringBuilder===b&&Type.registerNamespace&&typeof Type.registerNamespace===b&&Type.registerClass&&typeof Type.registerClass===b&&typeof Function._validateParams===b)return a;else return false};c.prototype.loadMsAjaxFull=function(b){var a=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(a,b)};Object.defineProperty(c.prototype,"msAjaxError",{"get":function(){var a=this;if(a._msAjaxError==b&&a.isMsAjaxLoaded())a._msAjaxError=Error;return a._msAjaxError},"set":function(a){this._msAjaxError=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxSerializer",{"get":function(){var a=this;if(a._msAjaxSerializer==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;return a._msAjaxSerializer},"set":function(a){this._msAjaxSerializer=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxString",{"get":function(){var a=this;if(a._msAjaxString==b&&a.isMsAjaxLoaded())a._msAjaxSerializer=String;return a._msAjaxString},"set":function(a){this._msAjaxString=a},enumerable:a,configurable:a});Object.defineProperty(c.prototype,"msAjaxDebug",{"get":function(){var a=this;if(a._msAjaxDebug==b&&a.isMsAjaxLoaded())a._msAjaxDebug=Sys.Debug;return a._msAjaxDebug},"set":function(a){this._msAjaxDebug=a},enumerable:a,configurable:a});return c}();b.MicrosoftAjaxFactory=a})(OfficeExt||(OfficeExt={}));var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{},OfficeExt;(function(b){var a=function(){function a(a){this._internalStorage=a}a.prototype.getItem=function(a){try{return this._internalStorage&&this._internalStorage.getItem(a)}catch(b){return null}};a.prototype.setItem=function(b,a){try{this._internalStorage&&this._internalStorage.setItem(b,a)}catch(c){}};a.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(a){}};a.prototype.removeItem=function(a){try{this._internalStorage&&this._internalStorage.removeItem(a)}catch(b){}};a.prototype.getKeysWithPrefix=function(d){var b=[];try{for(var e=this._internalStorage&&this._internalStorage.length||0,a=0;a1?e[e.length-1]:b,c=r();if(!h&&c){var d=window.name.indexOf(i);if(d>-1){var f=window.name.indexOf(";",d);if(f==-1)f=window.name.length;var g=window.name.substring(d,f);if(a)c.setItem(g,a);else a=c.getItem(g)}}return a},getConversationId:function(){var c=window.location.search,a=b;if(c){var d=c.indexOf("&");a=d>0?c.substring(1,d):c.substr(1);if(a&&a.charAt(a.length-1)==="="){a=a.substring(0,a.length-1);if(a)a=decodeURIComponent(a)}}return a},getInfoItems:function(b){var a=b.split("$");if(typeof a[1]==g)a=b.split("|");return a},getConversationUrl:function(){var b="",d=OSF.OUtil.parseXdmInfo(c);if(d){var a=OSF.OUtil.getInfoItems(d);if(a!=undefined&&a.length>=3)b=a[2]}return b},validateParamObject:function(f,e){var b=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:a},{name:"expectedProperties",type:Object,mayBeNull:a},{name:"callback",type:Function,mayBeNull:c}]);if(b)throw b;for(var d in e){b=Function._validateParameter(f[d],e[d],d);if(b)throw b}},writeProfilerMark:function(a){if(window.msWriteProfilerMark){window.msWriteProfilerMark(a);OsfMsAjaxFactory.msAjaxDebug.trace(a)}},outputDebug:function(a){typeof Sys!==g&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(a)},defineNondefaultProperty:function(e,f,a,b){a=a||{};for(var g in b){var d=b[g];if(a[d]==undefined)a[d]=c}Object.defineProperty(e,f,a);return e},defineNondefaultProperties:function(c,a,d){a=a||{};for(var b in a)OSF.OUtil.defineNondefaultProperty(c,b,a[b],d);return c},defineEnumerableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[d])},defineEnumerableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[d])},defineMutableProperty:function(c,b,a){return OSF.OUtil.defineNondefaultProperty(c,b,a,[i,d,j])},defineMutableProperties:function(b,a){return OSF.OUtil.defineNondefaultProperties(b,a,[i,d,j])},finalizeProperties:function(e,d){d=d||{};for(var g=Object.getOwnPropertyNames(e),i=g.length,f=0;f>8;f=g&255;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63;if(!isNaN(g)){d=g>>8;e=i&255;f=i>>8;b[a++]=d>>2;b[a++]=(d&3)<<4|e>>4;b[a++]=(e&15)<<2|f>>6;b[a++]=f&63}if(isNaN(g))b[a-1]=64;else if(isNaN(i)){b[a-2]=64;b[a-1]=64}for(var k=0;k0;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[d%16];d=Math.floor(d/16)}for(;b<32;b++){if(b==8||b==12||b==16||b==20)c+="-";c+=a[Math.floor(Math.random()*16)]}return c}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(r,n,j,i,l,o,k,m,q,e,p,g,f,h,d,c,b){var a=this;a._id=r;a._appName=n;a._appVersion=j;a._appUILocale=i;a._dataLocale=l;a._docUrl=o;a._clientMode=k;a._settings=m;a._reason=q;a._osfControlType=e;a._eToken=p;a._correlationId=g;a._appInstanceId=f;a._touchEnabled=h;a._commerceAllowed=d;a._appMinorVersion=c;a._requirementMatrix=b;a.get_id=function(){return this._id};a.get_appName=function(){return this._appName};a.get_appVersion=function(){return this._appVersion};a.get_appUILocale=function(){return this._appUILocale};a.get_dataLocale=function(){return this._dataLocale};a.get_docUrl=function(){return this._docUrl};a.get_clientMode=function(){return this._clientMode};a.get_bindings=function(){return this._bindings};a.get_settings=function(){return this._settings};a.get_reason=function(){return this._reason};a.get_osfControlType=function(){return this._osfControlType};a.get_eToken=function(){return this._eToken};a.get_correlationId=function(){return this._correlationId};a.get_appInstanceId=function(){return this._appInstanceId};a.get_touchEnabled=function(){return this._touchEnabled};a.get_commerceAllowed=function(){return this._commerceAllowed};a.get_appMinorVersion=function(){return this._appMinorVersion};a.get_requirementsMatrix=function(){return this._requirementsMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(b,a){if(a==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||a==Microsoft.Office.WebExtension.EventType.BindingDataChanged)return b+"_"+a;else return a};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var a={};return {getErrorArgs:function(b){return a[b]||a[this.errorCodes.ooeInternalError]},addErrorMessage:function(c,b){a[c]=b},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11000,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(b){a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:b.L_DataReadError,message:b.L_GetSelectionNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:b.L_InvalidCoercion,message:b.L_CoercionTypeNotMatchBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:b.L_DataReadError,message:b.L_InvalidGetRowColumnCounts};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:b.L_DataReadError,message:b.L_SelectionNotSupportCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:b.L_DataReadError,message:b.L_InvalidGetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:b.L_DataReadError,message:b.L_NonUniformPartialGetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:b.L_DataReadError,message:b.L_GetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:b.L_DataReadError,message:b.L_FileTypeNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:b.L_DataReadError,message:b.L_GetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:b.L_DataReadError,message:b.L_InvalidGetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:b.L_DataReadError,message:b.L_InvalidGetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:b.L_DataReadError,message:b.L_InvalidReadForBlankRow};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:b.L_DataWriteError,message:b.L_UnsupportedDataObject};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:b.L_DataWriteError,message:b.L_CannotWriteToSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:b.L_DataWriteError,message:b.L_DataNotMatchSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:b.L_DataWriteError,message:b.L_OverwriteWorksheetData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:b.L_DataWriteError,message:b.L_DataNotMatchBindingSize};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:b.L_DataWriteError,message:b.L_InvalidSetStartRowColumn};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:b.L_InvalidFormat,message:b.L_InvalidDataFormat};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchCoercionType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:b.L_InvalidDataObject,message:b.L_DataNotMatchBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:b.L_DataWriteError,message:b.L_SetDataIsTooLarge};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:b.L_DataWriteError,message:b.L_NonUniformPartialSetNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:b.L_DataWriteError,message:b.L_InvalidSetColumns};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:b.L_DataWriteError,message:b.L_InvalidSetRows};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:b.L_DataWriteError,message:b.L_SetDataParametersConflict};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:b.L_BindingCreationError,message:b.L_SelectionCannotBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:b.L_InvalidBindingError,message:b.L_BindingNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:b.L_BindingCreationError,message:b.L_BindingToMultipleSelection};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidSelectionForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnThisBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:b.L_BindingCreationError,message:b.L_NamedItemNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:b.L_BindingCreationError,message:b.L_MultipleNamedItemFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:b.L_BindingCreationError,message:b.L_InvalidNamedItemForBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:b.L_InvalidBinding,message:b.L_UnknownBindingType};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:b.L_InvalidBindingOperation,message:b.L_OperationNotSupportedOnMatrixData};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:b.L_InvalidBinding,message:b.L_InvalidColumnsForBinding};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:b.L_ReadSettingsError,message:b.L_SettingNameNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:b.L_SaveSettingsError,message:b.L_SettingsCannotSave};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:b.L_SettingsStaleError,message:b.L_SettingsAreStale};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:b.L_HostError,message:b.L_OperationNotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:b.L_InternalError,message:b.L_InternalErrorDescription};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:b.L_PermissionDenied,message:b.L_DocumentReadOnly};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:b.L_EventRegistrationError,message:b.L_EventHandlerNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:b.L_InvalidAPICall,message:b.L_InvalidApiCallInContext};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:b.L_ShuttingDown,message:b.L_ShuttingDown};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:b.L_UnsupportedEnumeration,message:b.L_UnsupportedEnumerationMessage};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:b.L_IndexOutOfRange,message:b.L_IndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:b.L_APINotSupported,message:b.L_BrowserAPINotSupported};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:b.L_APICallFailed,message:b.L_RequestTimeout};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:b.L_APICallFailed,message:b.L_TooManyIncompleteRequests};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:b.L_APICallFailed,message:b.L_RequestTokenUnavailable};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:b.L_APICallFailed,message:b.L_ActivityLimitReached};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:b.L_InvalidNode,message:b.L_CustomXmlNodeNotFound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:b.L_CustomXmlError,message:b.L_CustomXmlError};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:b.L_CannotNavigateTo,message:b.L_CannotNavigateTo};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:b.L_SpecifiedIdNotExist,message:b.L_SpecifiedIdNotExist};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:b.L_NavOutOfBound,message:b.L_NavOutOfBound};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:b.L_DataWriteReminder,message:b.L_CellDataAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:b.L_MissingParameter,message:b.L_ElementMissing};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:b.L_PermissionDenied,message:b.L_NoCapability};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:b.L_InvalidValue,message:b.L_InvalidCellsValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:b.L_InvalidValue,message:b.L_InvalidTableOptionValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:b.L_InvalidValue,message:b.L_InvalidFormatValue};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_RowIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:b.L_OutOfRange,message:b.L_ColIndexOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:b.L_OutOfRange,message:b.L_FormatValueOutOfRange};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:b.L_FormattingReminder,message:b.L_CellFormatAmountBeyondLimits};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:b.L_MemoryLimit,message:b.L_CloseFileBeforeRetrieve};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:b.L_NetworkProblem,message:b.L_NetworkProblemRetrieveFile};a[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:b.L_InvalidValue,message:b.L_SliceSizeNotSupported}}}}();var OfficeExt;(function(a){(function(c){var a=1.1,d=function(){function a(a){this.setMap=a}a.prototype.isSetSupported=function(b,a){if(b==undefined)return false;if(a==undefined)a=0;var e=this.setMap,d=e.sets;if(d.hasOwnProperty(b.toLowerCase())){var c=d[b.toLowerCase()];return c>0&&c>=a}else return false};return a}();c.RequirementMatrix=d;var b=function(){function a(a){this.sets=a}return a}();c.DefaultSetRequirement=b;var k=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,excelapi:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelClientDefaultSetRequirement=k;var g=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookClientDefaultSetRequirement=g;var m=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a,wordapi:a})}return b}(b);c.WordClientDefaultSetRequirement=m;var f=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointClientDefaultSetRequirement=f;var j=function(c){__extends(b,c);function b(){c.call(this,{selection:a,textcoercion:a})}return b}(b);c.ProjectClientDefaultSetRequirement=j;var p=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,file:a})}return b}(b);c.ExcelWebDefaultSetRequirement=p;var s=function(c){__extends(b,c);function b(){c.call(this,{customxmlparts:a,documentevents:a,file:a,ooxmlcoercion:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.WordWebDefaultSetRequirement=s;var i=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,settings:a})}return b}(b);c.PowerpointWebDefaultSetRequirement=i;var e=function(b){__extends(a,b);function a(){b.call(this,{mailbox:1.3})}return a}(b);c.OutlookWebDefaultSetRequirement=e;var q=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,documentevents:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.SwayWebDefaultSetRequirement=q;var n=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,partialtablebindings:a,settings:a,tablebindings:a,tablecoercion:a})}return b}(b);c.AccessWebDefaultSetRequirement=n;var o=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,documentevents:a,matrixbindings:a,matrixcoercion:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a})}return b}(b);c.ExcelIOSDefaultSetRequirement=o;var r=function(c){__extends(b,c);function b(){c.call(this,{bindingevents:a,compressedfile:a,customxmlparts:a,documentevents:a,file:a,htmlcoercion:a,matrixbindings:a,matrixcoercion:a,ooxmlcoercion:a,pdffile:a,selection:a,settings:a,tablebindings:a,tablecoercion:a,textbindings:a,textcoercion:a,textfile:a})}return b}(b);c.WordIOSDefaultSetRequirement=r;var h=function(c){__extends(b,c);function b(){c.call(this,{activeview:a,compressedfile:a,documentevents:a,file:a,pdffile:a,selection:a,settings:a,textcoercion:a})}return b}(b);c.PowerpointIOSDefaultSetRequirement=h;var l=function(c){__extends(b,c);function b(){c.call(this,{mailbox:a})}return b}(b);c.OutlookIOSDefaultSetRequirement=l;var t=function(){function a(){}a.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)};a.getDefaultRequirementMatrix=function(c){this.initializeDefaultSetMatrix();var e=undefined;if(c.requirementMatrix!=undefined&&typeof JSON!=="undefined"){var j=JSON.parse(c.requirementMatrix);e=new d(new b(j))}else{var g=c.get_appMinorVersion(),f="";if(g<10)f="0"+g;else f=""+g;var i=c.get_appVersion()+"."+f,h=c.get_appName()+"-"+i;if(a.DefaultSetArrayMatrix!=undefined&&a.DefaultSetArrayMatrix[h]!=undefined)e=new d(a.DefaultSetArrayMatrix[h]);else e=new d(new b({}))}return e};a.initializeDefaultSetMatrix=function(){a.DefaultSetArrayMatrix[a.Excel_RCLIENT_1600]=new k;a.DefaultSetArrayMatrix[a.Word_RCLIENT_1600]=new m;a.DefaultSetArrayMatrix[a.PowerPoint_RCLIENT_1600]=new f;a.DefaultSetArrayMatrix[a.Outlook_RCLIENT_1600]=new g;a.DefaultSetArrayMatrix[a.Excel_WAC_1600]=new p;a.DefaultSetArrayMatrix[a.Word_WAC_1600]=new s;a.DefaultSetArrayMatrix[a.Outlook_WAC_1600]=new e;a.DefaultSetArrayMatrix[a.Outlook_WAC_1601]=new e;a.DefaultSetArrayMatrix[a.Project_RCLIENT_1600]=new j;a.DefaultSetArrayMatrix[a.Access_WAC_1600]=new n;a.DefaultSetArrayMatrix[a.PowerPoint_WAC_1600]=new i;a.DefaultSetArrayMatrix[a.Excel_IOS_1600]=new o;a.DefaultSetArrayMatrix[a.SWAY_WAC_1600]=new q;a.DefaultSetArrayMatrix[a.Word_IOS_1600]=new r;a.DefaultSetArrayMatrix[a.PowerPoint_IOS_1600]=new h;a.DefaultSetArrayMatrix[a.Outlook_IOS_1600]=new l};a.Excel_RCLIENT_1600="1-16.00";a.Word_RCLIENT_1600="2-16.00";a.PowerPoint_RCLIENT_1600="4-16.00";a.Outlook_RCLIENT_1600="8-16.00";a.Excel_WAC_1600="16-16.00";a.Word_WAC_1600="32-16.00";a.Outlook_WAC_1600="64-16.00";a.Outlook_WAC_1601="64-16.01";a.Project_RCLIENT_1600="128-16.00";a.Access_WAC_1600="256-16.00";a.PowerPoint_WAC_1600="512-16.00";a.Excel_IOS_1600="1024-16.01";a.SWAY_WAC_1600="2048-16.00";a.Word_IOS_1600="4096-16.00";a.PowerPoint_IOS_1600="8192-16.00";a.Outlook_IOS_1600="65536-16.00";a.DefaultSetArrayMatrix={};return a}();c.RequirementsMatrixFactory=t})(a.Requirement||(a.Requirement={}));var b=a.Requirement})(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var b,a=false;return {enableShortcut:function(){if(!a){if(window.Office)b=window.Office;else OSF.OUtil.setNamespace("Office",window);window.Office=Microsoft.Office.WebExtension;a=true}},disableShortcut:function(){if(a){if(b)window.Office=b;else OSF.OUtil.unsetNamespace("Office",window);a=false}}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(a){if(a)OSF.NamespaceManager.enableShortcut();else OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(a,b){var c;if(a&&typeof a=="string"){var d=a.indexOf("#");if(d!=-1){var h=a.substring(0,d),g=a.substring(d+1);switch(h){case "binding":case "bindings":if(g)c=new OSF.DDA.BindingPromise(g)}}}if(!c){if(b){var e=typeof b;if(e=="function"){var f={};f[Microsoft.Office.WebExtension.Parameters.Callback]=b;OSF.DDA.issueAsyncResult(f,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,e)}}else{c.onFail=b;return c}};OSF.DDA.Context=function(b,e,f,c,d){var a=this;OSF.OUtil.defineEnumerableProperties(a,{contentLanguage:{value:b.get_dataLocale()},displayLanguage:{value:b.get_appUILocale()},touchEnabled:{value:b.get_touchEnabled()},commerceAllowed:{value:b.get_commerceAllowed()}});e&&OSF.OUtil.defineEnumerableProperty(a,"document",{value:e});f&&OSF.OUtil.defineEnumerableProperty(a,"license",{value:f});if(c){var h=c.displayName||"appOM";delete c.displayName;OSF.OUtil.defineEnumerableProperty(a,h,{value:c})}d&&OSF.OUtil.defineEnumerableProperty(a,"officeTheme",{"get":function(){return d()}});var g=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(b);OSF.OUtil.defineEnumerableProperty(a,"requirements",{value:g})};OSF.DDA.OutlookContext=function(c,a,d,e,b){OSF.DDA.OutlookContext.uber.constructor.call(this,c,null,d,e,b);a&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:a})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(b,c){var a;switch(b.get_clientMode()){case OSF.ClientMode.ReadOnly:a=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:a=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}c&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:c});OSF.OUtil.defineMutableProperties(this,{mode:{value:a},url:{value:b.get_docUrl()}})};OSF.DDA.JsomDocument=function(d,b,e){var a=this;OSF.DDA.JsomDocument.uber.constructor.call(a,d,e);b&&OSF.OUtil.defineEnumerableProperty(a,"bindings",{"get":function(){return b}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(a,[c.GetSelectedDataAsync,c.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{"get":function(){var a;if(OSF&&OSF._OfficeAppFactory)a=OSF._OfficeAppFactory.getContext();return a}});OSF.DDA.License=function(a){OSF.OUtil.defineEnumerableProperty(this,"value",{value:a})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(b){for(var a in b){var c={};OSF.OUtil.defineEnumerableProperties(c,{id:{value:a},displayName:{value:b[a]}});OSF.DDA.AsyncMethodNames[a]=c}};OSF.DDA.AsyncMethodCall=function(d,e,g,i,j,h,m){var b="function",a=d.length,c=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,m)});function f(d,f){for(var e in d){var a=d[e],b=f[e];if(a["enum"])switch(typeof b){case "string":if(OSF.OUtil.listContainsValue(a["enum"],b))break;case "undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw c()}if(a["types"])if(!OSF.OUtil.listContainsValue(a["types"],typeof b))throw c()}}function k(h,m,k){if(h.lengtha+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var c,d,l=k.length-1;l>=a;l--){var j=k[l];switch(typeof j){case "object":if(c)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else c=j;break;case b:if(d)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else d=j;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}c=c||{};for(var i in e)if(!OSF.OUtil.listContainsKey(c,i)){var h=undefined,g=e[i];if(g.calculate&&m)h=g.calculate(m,o,n);if(!h&&g.defaultValue!==undefined)h=g.defaultValue;c[i]=h}if(d)if(c[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else c[Microsoft.Office.WebExtension.Parameters.Callback]=d;f(e,c);return c}this.verifyAndExtractCall=function(e,c,b){var d=k(e,c,b),f=l(e,d,c,b),a={};for(var j in d)a[j]=d[j];for(var i in f)a[i]=f[i];for(var m in g)a[m]=g[m](c,b);if(h)a=h(a,c,b);return a};this.processResponse=function(c,b,e,d){var a;if(c==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)if(i)a=i(b,e,d);else a=b;else if(j)a=j(c,b);else a=OSF.DDA.ErrorCodeManager.getErrorArgs(c);return a};this.getCallArgs=function(g){for(var c,d,f=g.length-1;f>=a;f--){var e=g[f];switch(typeof e){case "object":c=e;break;case b:d=e}}c=c||{};if(d)c[Microsoft.Office.WebExtension.Parameters.Callback]=d;return c}};OSF.DDA.AsyncMethodCallFactory=function(){function a(a){var c=null;if(a){c={};for(var d=a.length,b=0;b=1)return true;b=a.deserialize;a.deserialize=function(a){return i(a,true,b)};a.__patchVersion=1;return true}!c()&&k(a,"load",function(){c()})})(window);Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5};Microsoft.Office.Common.InvokeResultCode={noError:0,errorInRequest:-1,errorHandlingRequest:-2,errorInResponse:-3,errorHandlingResponse:-4,errorHandlingRequestAccessDenied:-5,errorHandlingMethodCallTimedout:-6};Microsoft.Office.Common.MessageType={request:0,response:1};Microsoft.Office.Common.ActionType={invoke:0,registerEvent:1,unregisterEvent:2};Microsoft.Office.Common.ResponseType={forCalling:0,forEventing:1};Microsoft.Office.Common.MethodObject=function(c,b,a){this._method=c;this._invokeType=b;this._blockingOthers=a};Microsoft.Office.Common.MethodObject.prototype={getMethod:function(){return this._method},getInvokeType:function(){return this._invokeType},getBlockingFlag:function(){return this._blockingOthers}};Microsoft.Office.Common.EventMethodObject=function(b,a){this._registerMethodObject=b;this._unregisterMethodObject=a};Microsoft.Office.Common.EventMethodObject.prototype={getRegisterMethodObject:function(){return this._registerMethodObject},getUnregisterMethodObject:function(){return this._unregisterMethodObject}};Microsoft.Office.Common.ServiceEndPoint=function(c){var a=this,b=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:false}]);if(b)throw b;a._methodObjectList={};a._eventHandlerProxyList={};a._Id=c;a._conversations={};a._policyManager=null;a._appDomains={}};Microsoft.Office.Common.ServiceEndPoint.prototype={registerMethod:function(g,h,b,e){var c="invokeType",a=false,d=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:a},{name:"method",type:Function,mayBeNull:a},{name:c,type:Number,mayBeNull:a},{name:"blockingOthers",type:Boolean,mayBeNull:a}]);if(d)throw d;if(b!==Microsoft.Office.Common.InvokeType.async&&b!==Microsoft.Office.Common.InvokeType.sync)throw OsfMsAjaxFactory.msAjaxError.argument(c);var f=new Microsoft.Office.Common.MethodObject(h,b,e);this._methodObjectList[g]=f},unregisterMethod:function(b){var a=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:false}]);if(a)throw a;delete this._methodObjectList[b]},registerEvent:function(f,d,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a}]);if(b)throw b;var e=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(d,Microsoft.Office.Common.InvokeType.syncRegisterEvent,a),new Microsoft.Office.Common.MethodObject(c,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,a));this._methodObjectList[f]=e},registerEventEx:function(h,f,d,e,c){var a=false,b=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:a},{name:"registerMethod",type:Function,mayBeNull:a},{name:"registerMethodInvokeType",type:Number,mayBeNull:a},{name:"unregisterMethod",type:Function,mayBeNull:a},{name:"unregisterMethodInvokeType",type:Number,mayBeNull:a}]);if(b)throw b;var g=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(f,d,a),new Microsoft.Office.Common.MethodObject(e,c,a));this._methodObjectList[h]=g},unregisterEvent:function(b){var a=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:false}]);if(a)throw a;this.unregisterMethod(b)},registerConversation:function(c,g,b,f){var d="appDomains",a=true,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false},{name:"conversationUrl",type:String,mayBeNull:false,optional:a},{name:d,type:Object,mayBeNull:a,optional:a},{name:"serializerVersion",type:Number,mayBeNull:a,optional:a}]);if(e)throw e;if(b){if(!(b instanceof Array))throw OsfMsAjaxFactory.msAjaxError.argument(d);this._appDomains[c]=b}this._conversations[c]={url:g,serializerVersion:f}},unregisterConversation:function(b){var a=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false}]);if(a)throw a;delete this._conversations[b]},setPolicyManager:function(a){var b="policyManager",c=Function._validateParams(arguments,[{name:b,type:Object,mayBeNull:false}]);if(c)throw c;if(!a.checkPermission)throw OsfMsAjaxFactory.msAjaxError.argument(b);this._policyManager=a},getPolicyManager:function(){return this._policyManager}};Microsoft.Office.Common.ClientEndPoint=function(f,c,g,b){var d="targetWindow",a=this,e=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:false},{name:d,mayBeNull:false},{name:"targetUrl",type:String,mayBeNull:false},{name:"serializerVersion",type:Number,mayBeNull:true,optional:true}]);if(e)throw e;if(!c.postMessage)throw OsfMsAjaxFactory.msAjaxError.argument(d);a._conversationId=f;a._targetWindow=c;a._targetUrl=g;a._callingIndex=0;a._callbackList={};a._eventHandlerList={};if(b!=null)a._serializerVersion=b;else a._serializerVersion=OSF.SerializerVersion.MsAjax};Microsoft.Office.Common.ClientEndPoint.prototype={invoke:function(h,d,b){var a=this,g=Function._validateParams(arguments,[{name:"targetMethodName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"param",mayBeNull:true}]);if(g)throw g;var c=a._callingIndex++,k=new Date,e={callback:d,createdOn:k.getTime()};if(b&&typeof b==="object"&&typeof b.__timeout__==="number"){e.timeout=b.__timeout__;delete b.__timeout__}a._callbackList[c]=e;try{var i=new Microsoft.Office.Common.Request(h,Microsoft.Office.Common.ActionType.invoke,a._conversationId,c,b),j=Microsoft.Office.Common.MessagePackager.envelope(i,a._serializerVersion);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(f){try{d!==null&&d(Microsoft.Office.Common.InvokeResultCode.errorInRequest,f)}finally{delete a._callbackList[c]}}},registerForEvent:function(d,g,c,i){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"eventHandler",type:Function,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,k=new Date;a._callbackList[b]={callback:c,createdOn:k.getTime()};try{var h=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.registerEvent,a._conversationId,b,i),j=Microsoft.Office.Common.MessagePackager.envelope(h,a._serializerVersion);a._targetWindow.postMessage(j,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();a._eventHandlerList[d]=g}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}},unregisterForEvent:function(d,c,h){var a=this,f=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:false},{name:"callback",type:Function,mayBeNull:true},{name:"data",mayBeNull:true,optional:true}]);if(f)throw f;var b=a._callingIndex++,j=new Date;a._callbackList[b]={callback:c,createdOn:j.getTime()};try{var g=new Microsoft.Office.Common.Request(d,Microsoft.Office.Common.ActionType.unregisterEvent,a._conversationId,b,h),i=Microsoft.Office.Common.MessagePackager.envelope(g,a._serializerVersion);a._targetWindow.postMessage(i,a._targetUrl);Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(e){try{c!==null&&c(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete a._callbackList[b]}}finally{delete a._eventHandlerList[d]}}};Microsoft.Office.Common.XdmCommunicationManager=function(){var d=true,k="channel is not ready.",c="conversationId",j="Unknown conversation Id.",b=false,a=null,m=[],l=a,f=a,o=10,i=b,g=a,v=2e3,n=65000,q=n,h={},e={},s=b;function x(b){for(var a in h)if(h[a]._conversations[b])return h[a];OsfMsAjaxFactory.msAjaxDebug.trace(j);throw OsfMsAjaxFactory.msAjaxError.argument(c)}function y(b){var a=e[b];if(!a){OsfMsAjaxFactory.msAjaxDebug.trace(j);throw OsfMsAjaxFactory.msAjaxError.argument(c)}return a}function B(e,c){var b=e._methodObjectList[c._actionName];if(!b){OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+c._actionName);throw OsfMsAjaxFactory.msAjaxError.argument("messageObject")}var d=a;if(c._actionType===Microsoft.Office.Common.ActionType.invoke)d=b;else if(c._actionType===Microsoft.Office.Common.ActionType.registerEvent)d=b.getRegisterMethodObject();else d=b.getUnregisterMethodObject();return d}function E(a){m.push(a)}function D(){if(f!==a){if(!i)if(m.length>0){var b=m.shift();p(b)}else{clearInterval(f);f=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(k)}function p(a){i=a.getInvokeBlockingFlag();a.invoke();l=(new Date).getTime()}function A(){if(g){var c,f=0,j=new Date,d;for(var i in e){c=e[i];for(var h in c._callbackList){var b=c._callbackList[h];d=b.timeout?b.timeout:q;if(d>=0&&Math.abs(j.getTime()-b.createdOn)>=d)try{b.callback&&b.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,a)}finally{delete c._callbackList[h]}else f++}}if(f===0){clearInterval(g);g=a}}else OsfMsAjaxFactory.msAjaxDebug.trace(k)}function z(){i=b}function C(a){if(window.addEventListener)window.addEventListener("message",a,b);else if(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent)window.attachEvent("onmessage",a);else{OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API.");throw OsfMsAjaxFactory.msAjaxError.argument("Browser")}}function r(e,f){var g=b;if(e===d)return d;if(!e||!f||!e.length||!f.length)return g;var c,a;c=document.createElement("a");a=document.createElement("a");c.href=e;a.href=f;g=u(c,a);delete c,a;return g}function w(a,g){var c=b;if(!g||!g.length||!a||!(a instanceof Array)||!a.length)return c;var f=document.createElement("a"),e=document.createElement("a");f.href=g;for(var d=0;do)&&!i){p(F);A=b}else f=setInterval(D,o);A&&E(F)}catch(k){var C=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;if(k==m)C=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied;var I=new Microsoft.Office.Common.Response(c._actionName,c._conversationId,c._correlationId,C,Microsoft.Office.Common.ResponseType.forCalling,k),H=Microsoft.Office.Common.MessagePackager.envelope(I,g);e.source&&e.source.postMessage&&e.source.postMessage(H,v)}}else if(c._messageType===Microsoft.Office.Common.MessageType.response){var j=y(c._conversationId);j._serializerVersion=g;if(!r(j._targetUrl,e.origin))throw"Failed orgin check";if(c._responseType===Microsoft.Office.Common.ResponseType.forCalling){var n=j._callbackList[c._correlationId];if(n)try{n.callback&&n.callback(c._errorCode,c._data)}finally{delete j._callbackList[c._correlationId]}}else{var s=j._eventHandlerList[c._actionName];s!==undefined&&s!==a&&s(c._data)}}else return}}function t(){if(!s){C(F);s=d}}return {connect:function(b,d,f,c){var a=e[b];if(!a){t();a=new Microsoft.Office.Common.ClientEndPoint(b,d,f,c);e[b]=a}return a},getClientEndPoint:function(d){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;return e[d]},createServiceEndPoint:function(a){t();var b=new Microsoft.Office.Common.ServiceEndPoint(a);h[a]=b;return b},getServiceEndPoint:function(c){var a=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:b}]);if(a)throw a;return h[c]},deleteClientEndPoint:function(d){var a=Function._validateParams(arguments,[{name:c,type:String,mayBeNull:b}]);if(a)throw a;delete e[d]},_setMethodTimeout:function(a){var c=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:b}]);if(c)throw c;q=a<=0?n:a},_startMethodTimeoutTimer:function(){if(!g)g=setInterval(A,v)}}}();Microsoft.Office.Common.Message=function(g,h,e,f,c){var b=false,a=this,d=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:b},{name:"actionName",type:String,mayBeNull:b},{name:"conversationId",type:String,mayBeNull:b},{name:"correlationId",mayBeNull:b},{name:"data",mayBeNull:true,optional:true}]);if(d)throw d;a._messageType=g;a._actionName=h;a._conversationId=e;a._correlationId=f;a._origin=window.location.href;if(typeof c=="undefined")a._data=null;else a._data=c};Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}};Microsoft.Office.Common.Request=function(c,d,a,b,e){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,c,a,b,e);this._actionType=d};OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message);Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType};Microsoft.Office.Common.Response=function(d,a,b,e,c,f){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,d,a,b,f);this._errorCode=e;this._responseType=c};OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message);Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode};Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType};Microsoft.Office.Common.MessagePackager={envelope:function(a,b){if(b==OSF.SerializerVersion.Browser&&typeof JSON!=="undefined"){if(typeof a==="object")a._serializerVersion=b;return JSON.stringify(a)}else{if(typeof a==="object")a._serializerVersion=OSF.SerializerVersion.MsAjax;return OsfMsAjaxFactory.msAjaxSerializer.serialize(a)}},unenvelope:function(a,b){if(b==OSF.SerializerVersion.Browser&&typeof JSON!=="undefined")return JSON.parse(a);else return OsfMsAjaxFactory.msAjaxSerializer.deserialize(a,true)}};Microsoft.Office.Common.ResponseSender=function(f,i,k,g,h,j,e){var c=false,a=this,d=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:c},{name:"requesterUrl",type:String,mayBeNull:c},{name:"actionName",type:String,mayBeNull:c},{name:"conversationId",type:String,mayBeNull:c},{name:"correlationId",mayBeNull:c},{name:"responsetype",type:Number,maybeNull:c},{name:"serializerVersion",type:Number,maybeNull:true,optional:true}]);if(d)throw d;a._requesterWindow=f;a._requesterUrl=i;a._actionName=k;a._conversationId=g;a._correlationId=h;a._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;a._responseType=j;var b=a;a._send=function(f){try{var d=new Microsoft.Office.Common.Response(b._actionName,b._conversationId,b._correlationId,b._invokeResultCode,b._responseType,f),c=Microsoft.Office.Common.MessagePackager.envelope(d,e);b._requesterWindow.postMessage(c,b._requesterUrl)}catch(a){OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+a.message)}}};Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(a){this._invokeResultCode=a}};Microsoft.Office.Common.InvokeCompleteCallback=function(e,h,i,f,g,d,c){var b=this;Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(b,e,h,i,f,g,Microsoft.Office.Common.ResponseType.forCalling,c);b._postCallbackHandler=d;var a=b;b._send=function(f){try{var e=new Microsoft.Office.Common.Response(a._actionName,a._conversationId,a._correlationId,a._invokeResultCode,a._responseType,f),d=Microsoft.Office.Common.MessagePackager.envelope(e,c);a._requesterWindow.postMessage(d,a._requesterUrl);a._postCallbackHandler()}catch(b){OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+b.message)}}};OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender);Microsoft.Office.Common.Invoker=function(i,j,e,f,h,k,g){var c=true,b=false,a=this,d=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:b},{name:"paramValue",mayBeNull:c},{name:"invokeCompleteCallback",mayBeNull:b},{name:"eventHandlerProxyList",mayBeNull:c},{name:"conversationId",type:String,mayBeNull:b},{name:"eventName",type:String,mayBeNull:b},{name:"serializerVersion",type:Number,mayBeNull:c,optional:c}]);if(d)throw d;a._methodObject=i;a._param=j;a._invokeCompleteCallback=e;a._eventHandlerProxyList=f;a._conversationId=h;a._eventName=k;a._serializerVersion=g};Microsoft.Office.Common.Invoker.prototype={invoke:function(){var a=this;try{var b;switch(a._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:a._methodObject.getMethod()(a._param,a._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:b=a._methodObject.getMethod()(a._param);a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent:var d=a._createEventHandlerProxyObject(a._invokeCompleteCallback);b=a._methodObject.getMethod()(d.getSend(),a._param);a._eventHandlerProxyList[a._conversationId+a._eventName]=d.getSend();a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:var g=a._eventHandlerProxyList[a._conversationId+a._eventName];b=a._methodObject.getMethod()(g,a._param);delete a._eventHandlerProxyList[a._conversationId+a._eventName];a._invokeCompleteCallback.getSend()(b);break;case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:var c=a._createEventHandlerProxyObject(a._invokeCompleteCallback);a._methodObject.getMethod()(c.getSend(),a._invokeCompleteCallback.getSend(),a._param);a._eventHandlerProxyList[a._callerId+a._eventName]=c.getSend();break;case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:var f=a._eventHandlerProxyList[a._callerId+a._eventName];a._methodObject.getMethod()(f,a._invokeCompleteCallback.getSend(),a._param);delete a._eventHandlerProxyList[a._callerId+a._eventName]}}catch(e){a._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);a._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(a){return new Microsoft.Office.Common.ResponseSender(a.getRequesterWindow(),a.getRequesterUrl(),a.getActionName(),a.getConversationId(),a.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing,this._serializerVersion)}};OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"};OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var a=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource],b={};OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,a,b)};OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]);OSF.OUtil.setNamespace("WAC",OSF.DDA);OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC);OSF.DDA.WAC.getDelegateMethods=function(){var a={};a[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync;a[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync;a[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync;return a};OSF.DDA.WAC.Delegate.version=1;OSF.DDA.WAC.Delegate.executeAsync=function(a){if(!a.hostCallArgs)a.hostCallArgs={};a.hostCallArgs["DdaMethod"]={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:a.dispId};a.hostCallArgs["__timeout__"]=-1;a.onCalling&&a.onCalling();var b=(new Date).getTime();OSF.getClientEndPoint().invoke("executeMethod",function(e,d){a.onReceiving&&a.onReceiving();var c;if(e==Microsoft.Office.Common.InvokeResultCode.noError){OSF.DDA.WAC.Delegate.version=d["Version"];c=d["Error"]}else switch(e){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:c=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:c=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}a.onComplete&&a.onComplete(c,d);OSF.AppTelemetry&&OSF.AppTelemetry.onMethodDone(a.dispId,null,Math.abs((new Date).getTime()-b),c)},a.hostCallArgs)};OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(c,a){var b=(new Date).getTime();return function(f,e){a.onReceiving&&a.onReceiving();var d;if(f!=Microsoft.Office.Common.InvokeResultCode.noError)switch(f){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:d=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:d=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else if(e)if(e["Error"])d=e["Error"];else d=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;else d=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;a.onComplete&&a.onComplete(d);OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(c,a.dispId,Math.abs((new Date).getTime()-b),d)}};OSF.DDA.WAC.Delegate.registerEventAsync=function(a){a.onCalling&&a.onCalling();OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(a.targetId,a.eventType),function(b){a.onEvent&&a.onEvent(b);OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(a.dispId)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true,a),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:a.dispId,targetId:a.targetId})};OSF.DDA.WAC.Delegate.unregisterEventAsync=function(a){a.onCalling&&a.onCalling();OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(a.targetId,a.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false,a),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:a.dispId,targetId:a.targetId})};OSF.OUtil.setNamespace("WebApp",OSF);OSF.WebApp.AddHostInfoAndXdmInfo=function(a){if(OSF._OfficeAppFactory.getWindowLocationSearch&&OSF._OfficeAppFactory.getWindowLocationHash)return a+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash();else return a};OSF.WebApp._UpdateLinksForHostAndXdmInfo=function(){for(var b=document.querySelectorAll("a[data-officejs-navigate]"),a=0;a0?a.substr(0,d):null,c=b!==null?b.toLowerCase()==="http"||b.toLowerCase()==="https":true;c=c&&a!="#"&&a!="/"&&a!=""&&a!=OSF._OfficeAppFactory.getWebAppState().webAppUrl;return c};OSF.InitializationHelper=function(e,b,g,f,c){var a=this;a._hostInfo=e;a._webAppState=b;a._context=g;a._settings=f;a._hostFacade=c;a._initializeSettings=function(h,g){var c="undefined",e,b=h.get_settings(),d=OSF.OUtil.getSessionStorage();if(d){var a=d.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());if(a)b=typeof JSON!==c?JSON.parse(a):OsfMsAjaxFactory.msAjaxSerializer.deserialize(a,true);else{a=typeof JSON!==c?JSON.stringify(b):OsfMsAjaxFactory.msAjaxSerializer.serialize(b);d.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),a)}}var f=OSF.DDA.SettingsManager.deserializeSettings(b);if(g)e=new OSF.DDA.RefreshableSettings(f);else e=new OSF.DDA.Settings(f);return e};var d=function(a){var b=window.open;a.open=function(e,d,c){var a=null;try{a=b(e,d,c)}catch(f){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+f)}if(!a){var g={strUrl:e,strWindowName:d,strWindowFeatures:c};OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,g)}return a}};d(window)};OSF.InitializationHelper.prototype.getAppContext=function(d,c){var b=function(h,a){var b;if(a._appName===OSF.AppName.ExcelWebApp){var d=a._settings;b={};for(var n in d){var j=d[n];b[j[0]]=j[1]}}else b=a._settings;if(h===0&&a._id!=undefined&&a._appName!=undefined&&a._appVersion!=undefined&&a._appUILocale!=undefined&&a._dataLocale!=undefined&&a._docUrl!=undefined&&a._clientMode!=undefined&&a._settings!=undefined&&a._reason!=undefined){var l=a._id,m=false,k=true,g=0;if(a._minorVersion!=undefined)g=a._minorVersion;var e=undefined;if(a._requirementMatrix!=undefined)e=a._requirementMatrix;var f=new OSF.OfficeAppContext(a._id,a._appName,a._appVersion,a._appUILocale,a._dataLocale,a._docUrl,a._clientMode,b,a._reason,a._osfControlType,a._eToken,a._correlationId,l,m,k,g,e);OSF.AppTelemetry&&OSF.AppTelemetry.initialize(f);c(f)}else{var i="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+h+", exception: "+a;OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(i);throw i}};try{this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",b,this._webAppState.id)}catch(a){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+a+"]");throw a}};OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){var c="ContextActivationManager_notifyHost",b=false;try{var a=this,f=OSF.OUtil.parseXdmInfoWithGivenFragment(b,OSF._OfficeAppFactory.getWindowLocationHash());if(f){var d=OSF.OUtil.getInfoItems(f);if(d!=undefined&&d.length>=3){a._webAppState.conversationID=d[0];a._webAppState.id=d[1];a._webAppState.webAppUrl=d[2]}}a._webAppState.serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(b,OSF._OfficeAppFactory.getWindowLocationHash());a._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(a._webAppState.conversationID,a._webAppState.wnd,a._webAppState.webAppUrl,a._webAppState.serializerVersion);a._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(a._webAppState.id);var g=a._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;a._webAppState.serviceEndPoint.registerConversation(g,a._webAppState.webAppUrl);var h=function(){if(!a._webAppState.focused){a._webAppState.focused=true;for(var c=document.querySelectorAll("input,a,button"),b=0;b40){a=OSF.OUtil.Guid.generateNewGuid();b.setValue(b.clientIDKey,a)}return a};a.prototype.saveLog=function(c,d){var b=this,a=b.getValue(b.logIdSetKey);a=(a&&a.length>0?a+";":"")+c;b.setValue(b.logIdSetKey,a);b.setValue(c,d)};a.prototype.enumerateLog=function(c,e){var a=this,d=a.getValue(a.logIdSetKey);if(d){var f=d.split(";");for(var h in f){var b=f[h],g=a.getValue(b);if(g){c&&c(b,g);e&&a.remove(b)}}e&&a.remove(a.logIdSetKey)}};a.prototype.getValue=function(c){var a=OSF.OUtil.getLocalStorage(),b="";if(a)b=a.getItem(c);return b};a.prototype.setValue=function(c,b){var a=OSF.OUtil.getLocalStorage();a&&a.setItem(c,b)};a.prototype.remove=function(b){var a=OSF.OUtil.getLocalStorage();if(a)try{a.removeItem(b)}catch(c){}};return a}(),f=function(){function a(){}a.prototype.LogData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a.SerializeRow(),OSF.Logger.SendFlag.none)};a.prototype.LogRawData=function(a){if(!OSF.Logger)return;OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,a,OSF.Logger.SendFlag.none)};return a}();function t(d){if(!OSF.Logger)return;if(b)return;b=new v;b.hostVersion=d.get_appVersion();b.appId=d.get_id();b.host=d.get_appName();b.browser=window.navigator.userAgent;b.correlationId=d.get_correlationId();b.clientId=(new i).getClientId();var f=location.href.indexOf("?");b.appURL=f==-1?location.href:location.href.substring(0,f);(function(f,b){var d,e,c;b.assetId="";b.userId="";try{d=decodeURIComponent(f);e=new DOMParser;c=e.parseFromString(d,"text/xml");b.userId=c.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;b.assetId=c.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(g){}finally{d=a;c=a;e=a}})(d.get_eToken(),b);(function(){var k=new Date,d=a,h=0,j=false,f=function(){if(document.hasFocus()){if(d==a)d=new Date}else if(d){h+=Math.abs((new Date).getTime()-d.getTime());d=a}},b=[];b.push(new e("focus",f));b.push(new e("blur",f));b.push(new e("focusout",f));b.push(new e("focusin",f));var i=function(){for(var e=0;e0)for(var d in a)if(a[d]===c)return true;return false},addEventHandler:function(b,a){if(typeof a!="function")return false;var c=this._eventHandlers[b];if(c&&!this.hasEventHandler(b,a)){c.push(a);return true}else return false},removeEventHandler:function(c,d){var a=this._eventHandlers[c];if(a&&a.length>0)for(var b=0;b0){this._eventHandlers[a]=[];return true}return false},getEventHandlerCount:function(a){return this._eventHandlers[a]!=undefined?this._eventHandlers[a].length:-1},fireEvent:function(a){if(a.type==undefined)return false;var b=a.type;if(b&&this._eventHandlers[b]){var c=this._eventHandlers[b];for(var d in c)c[d](a);return true}else return false}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(e,c,a){var d=this,b;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:b=new OSF.DDA.DocumentSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:b=new OSF.DDA.BindingSelectionChangedEventArgs(d.manufactureBinding(a,c.document),a[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:b=new OSF.DDA.BindingDataChangedEventArgs(d.manufactureBinding(a,c.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:b=new OSF.DDA.SettingsChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:b=new OSF.DDA.ActiveViewChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:b=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:b=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(a);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:b=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(a);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:b=new OSF.DDA.NodeInsertedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:b=new OSF.DDA.NodeReplacedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NewNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:b=new OSF.DDA.NodeDeletedEventArgs(d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.OldNode]),d.manufactureDataNode(a[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),a[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:b=new OSF.DDA.TaskSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:b=new OSF.DDA.ResourceSelectionChangedEventArgs(c);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:b=new OSF.DDA.ViewSelectionChangedEventArgs(c);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return b};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(b,c,a){return a.supportsEvent(b)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.DDA.DataPartProperties={Id:Microsoft.Office.WebExtension.Parameters.Id,BuiltIn:"DataPartBuiltIn"};OSF.DDA.DataNodeProperties={Handle:"DataNodeHandle",BaseName:"DataNodeBaseName",NamespaceUri:"DataNodeNamespaceUri",NodeType:"DataNodeType"};OSF.DDA.DataNodeEventProperties={OldNode:"OldNode",NewNode:"NewNode",NextSiblingNode:"NextSiblingNode",InUndoRedo:"InUndoRedo"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{DataPartProperties:"DataPartProperties",DataNodeProperties:"DataNodeProperties"});OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{DataPartList:"DataPartList",DataNodeList:"DataNodeList"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataPartList,OSF.DDA.PropertyDescriptors.DataPartProperties);OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataNodeList,OSF.DDA.PropertyDescriptors.DataNodeProperties);OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DataNodeInsertedEvent:"DataNodeInsertedEvent",DataNodeReplacedEvent:"DataNodeReplacedEvent",DataNodeDeletedEvent:"DataNodeDeletedEvent"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DataNodeDeleted:"nodeDeleted",DataNodeInserted:"nodeInserted",DataNodeReplaced:"nodeReplaced"});OSF.DDA.CustomXmlParts=function(){this._eventDispatches=[];var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartAsync,a.GetDataPartByIdAsync,a.GetDataPartsByNameSpaceAsync])};OSF.DDA.CustomXmlPart=function(f,b,g){OSF.OUtil.defineEnumerableProperties(this,{builtIn:{value:g},id:{value:b},namespaceManager:{value:new OSF.DDA.CustomXmlPrefixMappings(b)}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[c.DeleteDataPartAsync,c.GetPartNodesAsync,c.GetPartXmlAsync]);var e=f._eventDispatches,a=e[b];if(!a){var d=Microsoft.Office.WebExtension.EventType;a=new OSF.EventDispatch([d.DataNodeDeleted,d.DataNodeInserted,d.DataNodeReplaced]);e[b]=a}OSF.DDA.DispIdHost.addEventSupport(this,a)};OSF.DDA.CustomXmlPrefixMappings=function(b){var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartNamespaceAsync,a.GetDataPartNamespaceAsync,a.GetDataPartPrefixAsync],b)};OSF.DDA.CustomXmlNode=function(d,c,e,b){OSF.OUtil.defineEnumerableProperties(this,{baseName:{value:b},namespaceUri:{value:e},nodeType:{value:c}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.GetRelativeNodesAsync,a.GetNodeValueAsync,a.GetNodeXmlAsync,a.SetNodeValueAsync,a.SetNodeXmlAsync],d)};OSF.DDA.NodeInsertedEventArgs=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeInserted},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeReplacedEventArgs=function(c,b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeReplaced},oldNode:{value:c},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeDeletedEventArgs=function(c,a,b){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeDeleted},oldNode:{value:c},oldNextSibling:{value:a},inUndoRedo:{value:b}})};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureDataNode=function(a){if(a)return new OSF.DDA.CustomXmlNode(a[OSF.DDA.DataNodeProperties.Handle],a[OSF.DDA.DataNodeProperties.NodeType],a[OSF.DDA.DataNodeProperties.NamespaceUri],a[OSF.DDA.DataNodeProperties.BaseName])};OSF.DDA.OMFactory.manufactureDataPart=function(a,b){return new OSF.DDA.CustomXmlPart(b,a[OSF.DDA.DataPartProperties.Id],a[OSF.DDA.DataPartProperties.BuiltIn])};OSF.DDA.AsyncMethodNames.addNames({AddDataPartAsync:"addAsync",GetDataPartByIdAsync:"getByIdAsync",GetDataPartsByNameSpaceAsync:"getByNamespaceAsync",DeleteDataPartAsync:"deleteAsync",GetPartNodesAsync:"getNodesAsync",GetPartXmlAsync:"getXmlAsync",AddDataPartNamespaceAsync:"addNamespaceAsync",GetDataPartNamespaceAsync:"getNamespaceAsync",GetDataPartPrefixAsync:"getPrefixAsync",GetRelativeNodesAsync:"getNodesAsync",GetNodeValueAsync:"getNodeValueAsync",GetNodeXmlAsync:"getXmlAsync",SetNodeValueAsync:"setNodeValueAsync",SetNodeXmlAsync:"setXmlAsync"});(function(){var a="string";function d(a){return OSF.DDA.OMFactory.manufactureDataPart(a,Microsoft.Office.WebExtension.context.document.customXmlParts)}function g(a){return OSF.DDA.OMFactory.manufactureDataNode(a)}function c(b){var a=b[Microsoft.Office.WebExtension.Parameters.Data];return a==undefined?null:a}function e(a){return a.id}function f(b,a){return a}function b(b,a){return a}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddDataPartAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Xml,types:[a]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:d});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[a]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:d});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:[a]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.DataPartList],d)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteDataPartAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:e}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetPartNodesAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.XPath,types:[a]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:e}],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.DataNodeList],g)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetPartXmlAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:e}],onSucceeded:c});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Prefix,types:[a]},{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:[a]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:f}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Prefix,types:[a]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:f}],onSucceeded:c});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:[a]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:f}],onSucceeded:c});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.XPath,types:[a]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:b}],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.DataNodeList],g)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetNodeValueAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:b}],onSucceeded:c});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetNodeXmlAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:b}],onSucceeded:c});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetNodeValueAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[a]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:b}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetNodeXmlAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Xml,types:[a]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:b}]})})();OSF.OUtil.setNamespace("Marshaling",OSF.DDA);OSF.DDA.Marshaling.CustomXmlPartsKeys={Id:"id",Namespace:"namespace",Xml:"xml",XPath:"xpath",Prefix:"prefix"};OSF.DDA.Marshaling.DataPartProperties={Id:"id",BuiltIn:"DataPartBuiltIn"};OSF.DDA.Marshaling.PropertyDescriptors={DataPartProperties:"dataPartProperties",DataNodeProperties:"dataNodeProperties"};OSF.DDA.Marshaling.DataNodeProperties={Handle:"DataNodeHandle",BaseName:"DataNodeBaseName",NamespaceUri:"DataNodeNamespaceUri",NodeType:"DataNodeType"};OSF.DDA.Marshaling.ListDescriptors={DataPartList:"DataPartList",DataNodeList:"DataNodeList"};OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.DataPartProperties,fromHost:[{name:OSF.DDA.DataPartProperties.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:OSF.DDA.DataPartProperties.BuiltIn,value:OSF.DDA.Marshaling.DataPartProperties.BuiltIn}],isComplexType:true});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.DataNodeProperties,fromHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:OSF.DDA.DataNodeProperties.BaseName,value:OSF.DDA.Marshaling.DataNodeProperties.BaseName},{name:OSF.DDA.DataNodeProperties.NamespaceUri,value:OSF.DDA.Marshaling.DataNodeProperties.NamespaceUri},{name:OSF.DDA.DataNodeProperties.NodeType,value:OSF.DDA.Marshaling.DataNodeProperties.NodeType}],isComplexType:true});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddDataPartMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.DataPartProperties,value:OSF.DDA.Marshaling.PropertyDescriptors.DataPartProperties}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Xml,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Xml}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartByIdMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.DataPartProperties,value:OSF.DDA.Marshaling.PropertyDescriptors.DataPartProperties}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartsByNamespaceMethod,fromHost:[{name:OSF.DDA.ListDescriptors.DataPartList,value:OSF.DDA.Marshaling.ListDescriptors.DataPartList}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartXmlMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartNodesMethod,fromHost:[{name:OSF.DDA.ListDescriptors.DataNodeList,value:OSF.DDA.Marshaling.ListDescriptors.DataNodeList}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id},{name:Microsoft.Office.WebExtension.Parameters.XPath,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.XPath}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidDeleteDataPartMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataNodeValueMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataNodeXmlMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataNodesMethod,fromHost:[{name:OSF.DDA.ListDescriptors.DataNodeList,value:OSF.DDA.Marshaling.ListDescriptors.DataNodeList}],toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:Microsoft.Office.WebExtension.Parameters.XPath,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.XPath}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetDataNodeValueMethod,toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetDataNodeXmlMethod,toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:Microsoft.Office.WebExtension.Parameters.Xml,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Xml}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddDataNamespaceMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:Microsoft.Office.WebExtension.Parameters.Prefix,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Prefix},{name:Microsoft.Office.WebExtension.Parameters.Namespace,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataUriByPrefixMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:Microsoft.Office.WebExtension.Parameters.Prefix,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Prefix}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPrefixByUriMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:Microsoft.Office.WebExtension.Parameters.Namespace,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace}]});OSF.DDA.AsyncMethodNames.addNames({GetSelectedDataAsync:"getSelectedDataAsync",SetSelectedDataAsync:"setSelectedDataAsync"});(function(){function a(b,d,c){var a=b[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&a&&(a[OSF.DDA.TableDataProperties.TableRows]!=undefined||a[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))a=OSF.DDA.OMFactory.manufactureTableData(a);a=OSF.DDA.DataCoercion.coerceData(a,c[Microsoft.Office.WebExtension.Parameters.CoercionType]);return a==undefined?null:a}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,"enum":Microsoft.Office.WebExtension.CoercionType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}}],privateStateCallbacks:[],onSucceeded:a});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}}],privateStateCallbacks:[]})})();OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.GetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:"ValueFormat"},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:"FilterType"},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.SettingsManager={SerializedSettings:"serializedSettings",DateJSONPrefix:"Date(",DataJSONSuffix:")",serializeSettings:function(b){var d={};for(var c in b){var a=b[c];try{if(JSON)a=JSON.stringify(a,function(a,b){return OSF.OUtil.isDate(this[a])?OSF.DDA.SettingsManager.DateJSONPrefix+this[a].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix:b});else a=Sys.Serialization.JavaScriptSerializer.serialize(a);d[c]=a}catch(e){}}return d},deserializeSettings:function(b){var d={};b=b||{};for(var c in b){var a=b[c];try{if(JSON)a=JSON.parse(a,function(c,a){var b;if(typeof a==="string"&&a&&a.length>6&&a.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&a.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix){b=new Date(parseInt(a.slice(5,-1)));if(b)return b}return a});else a=Sys.Serialization.JavaScriptSerializer.deserialize(a,true);d[c]=a}catch(e){}}return d}};OSF.DDA.Settings=function(a){var b="name";a=a||{};var c=function(d){var b=OSF.OUtil.getSessionStorage();if(b){var a=OSF.DDA.SettingsManager.serializeSettings(d),c=JSON?JSON.stringify(a):Sys.Serialization.JavaScriptSerializer.serialize(a);b.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),c)}};OSF.OUtil.defineEnumerableProperties(this,{"get":{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;var c=a[e];return typeof c==="undefined"?null:c}},"set":{value:function(f,e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false},{name:"value",mayBeNull:true}]);if(d)throw d;a[f]=e;c(a)}},remove:{value:function(e){var d=Function._validateParams(arguments,[{name:b,type:String,mayBeNull:false}]);if(d)throw d;delete a[e];c(a)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],a)};OSF.DDA.RefreshableSettings=function(a){OSF.DDA.RefreshableSettings.uber.constructor.call(this,a);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],a);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:a}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){var b=a[OSF.DDA.SettingsManager.SerializedSettings],c=OSF.DDA.SettingsManager.deserializeSettings(b);return c}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:true}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(b,a){return OSF.DDA.SettingsManager.serializeSettings(a)}}]});OSF.DDA.WAC.SettingsTranslator=function(){var b=0,a=1;return {read:function(d){if(d.Settings){var c={},e=d.Settings;for(var g in e){var f=e[g];c[f[b]]=f[a]}return c}else if(typeof window["OSFPPTWAC"]!="undefined")return d;else{var c={};return c}},write:function(d){var e=[];for(var f in d){var c=[];c[b]=f;c[a]=d[f];e.push(c)}return e}}}();OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings,{toHost:OSF.DDA.WAC.SettingsTranslator.write,fromHost:OSF.DDA.WAC.SettingsTranslator.read});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SettingsRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:"OverwriteIfStale"},{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}],invertible:true});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SettingsRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"});OSF.DDA.DocumentSelectionChangedEventArgs=function(a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:a}})};OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent});OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"});Microsoft.Office.WebExtension.FileProperties=function(a){OSF.OUtil.defineEnumerableProperties(this,{url:{value:a[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(a){return new Microsoft.Office.WebExtension.FileProperties(a)}});OSF.OUtil.setNamespace("Marshaling",OSF.DDA);var OSF_DDA_Marshaling_FilePropertiesKeys;(function(a){var b="Properties";a[a[b]=0]=b;a[a["Url"]=1]="Url"})(OSF_DDA_Marshaling_FilePropertiesKeys||(OSF_DDA_Marshaling_FilePropertiesKeys={}));OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys;OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:OSF.DDA.FilePropertiesDescriptor.Url,value:OSF.DDA.Marshaling.FilePropertiesKeys.Url}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:OSF.DDA.Marshaling.FilePropertiesKeys.Properties}]});Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed",Pdf:"pdf"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FileProperties:"FileProperties",FileSliceProperties:"FileSliceProperties"});OSF.DDA.FileProperties={Handle:"FileHandle",FileSize:"FileSize",SliceSize:Microsoft.Office.WebExtension.Parameters.SliceSize};OSF.DDA.File=function(e,c,b){OSF.OUtil.defineEnumerableProperties(this,{size:{value:c},sliceCount:{value:Math.ceil(c/b)}});var a={};a[OSF.DDA.FileProperties.Handle]=e;a[OSF.DDA.FileProperties.SliceSize]=b;var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDocumentCopyChunkAsync,d.ReleaseDocumentCopyAsync],a)};OSF.DDA.FileSliceOffset="fileSliceoffset";OSF.DDA.AsyncMethodNames.addNames({GetDocumentCopyAsync:"getFileAsync",GetDocumentCopyChunkAsync:"getSliceAsync",ReleaseDocumentCopyAsync:"closeAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.FileType,"enum":Microsoft.Office.WebExtension.FileType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:{types:["number"],defaultValue:4*1024*1024}}],checkCallArgs:function(b){var a=b[Microsoft.Office.WebExtension.Parameters.SliceSize];if(a<=0||a>4*1024*1024)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return b},onSucceeded:function(a,c,b){return new OSF.DDA.File(a[OSF.DDA.FileProperties.Handle],a[OSF.DDA.FileProperties.FileSize],b[Microsoft.Office.WebExtension.Parameters.SliceSize])}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(b,a){return a[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(a,d,c){var b=a[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(b<0||b>=d.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;a[OSF.DDA.FileSliceOffset]=parseInt((b*c[OSF.DDA.FileProperties.SliceSize]).toString());return a},onSucceeded:function(a,d,c){var b={};OSF.OUtil.defineEnumerableProperties(b,{data:{value:a[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:c[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:a[OSF.DDA.FileProperties.SliceSize]}});return b}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(b,a){return a[OSF.DDA.FileProperties.Handle]}}]});OSF.OUtil.setNamespace("Marshaling",OSF.DDA);OSF.OUtil.setNamespace("File",OSF.DDA.Marshaling);var OSF_DDA_Marshaling_File_FilePropertiesKeys;(function(a){var b="FileSize";a[a["Handle"]=0]="Handle";a[a[b]=1]=b})(OSF_DDA_Marshaling_File_FilePropertiesKeys||(OSF_DDA_Marshaling_File_FilePropertiesKeys={}));OSF.DDA.Marshaling.File.FilePropertiesKeys=OSF_DDA_Marshaling_File_FilePropertiesKeys;var OSF_DDA_Marshaling_File_SlicePropertiesKeys;(function(a){var b="SliceSize";a[a["Data"]=0]="Data";a[a[b]=1]=b})(OSF_DDA_Marshaling_File_SlicePropertiesKeys||(OSF_DDA_Marshaling_File_SlicePropertiesKeys={}));OSF.DDA.Marshaling.File.SlicePropertiesKeys=OSF_DDA_Marshaling_File_SlicePropertiesKeys;var OSF_DDA_Marshaling_File_FileType;(function(a){var b="Compressed";a[a["Text"]=0]="Text";a[a[b]=1]=b;a[a["Pdf"]=2]="Pdf"})(OSF_DDA_Marshaling_File_FileType||(OSF_DDA_Marshaling_File_FileType={}));OSF.DDA.Marshaling.File.FileType=OSF_DDA_Marshaling_File_FileType;var OSF_DDA_Marshaling_File_ParameterKeys;(function(a){var d="SliceIndex",c="SliceSize",b="FileType";a[a[b]=0]=b;a[a[c]=1]=c;a[a["Handle"]=2]="Handle";a[a[d]=3]=d})(OSF_DDA_Marshaling_File_ParameterKeys||(OSF_DDA_Marshaling_File_ParameterKeys={}));OSF.DDA.Marshaling.File.ParameterKeys=OSF_DDA_Marshaling_File_ParameterKeys;OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties);OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle},{name:OSF.DDA.FileProperties.FileSize,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data},{name:OSF.DDA.FileProperties.SliceSize,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:OSF.DDA.Marshaling.File.FileType.Text},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:OSF.DDA.Marshaling.File.FileType.Compressed},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:OSF.DDA.Marshaling.File.FileType.Pdf}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:OSF.DDA.Marshaling.File.ParameterKeys.FileType},{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceSize}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle},{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle}]});OSF.DDA.AsyncMethodNames.addNames({ExecuteRichApiRequestAsync:"executeRichApiRequestAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[]});OSF.OUtil.setNamespace("RichApi",OSF.DDA);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.ArrayData}],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]});Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType};OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.BindingPromise=function(b,a){this._id=b;OSF.OUtil.defineEnumerableProperty(this,"onFail",{"get":function(){return a},"set":function(c){var b=typeof c;if(b!="undefined"&&b!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,b);a=c}})};OSF.DDA.BindingPromise.prototype={_fetch:function(b){var a=this;if(a.binding)b&&b(a.binding);else if(!a._binding){var c=a;Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(a._id,function(a){if(a.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded){OSF.OUtil.defineEnumerableProperty(c,"binding",{value:a.value});b&&b(c.binding)}else c.onFail&&c.onFail(a)})}return a},getDataAsync:function(){var a=arguments;this._fetch(function(b){b.getDataAsync.apply(b,a)});return this},setDataAsync:function(){var a=arguments;this._fetch(function(b){b.setDataAsync.apply(b,a)});return this},addHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.addHandlerAsync.apply(b,a)});return this},removeHandlerAsync:function(){var a=arguments;this._fetch(function(b){b.removeHandlerAsync.apply(b,a)});return this}};OSF.DDA.BindingFacade=function(b){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:b});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddFromSelectionAsync,a.AddFromNamedItemAsync,a.GetAllAsync,a.GetByIdAsync,a.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{document:{value:a},id:{value:b}})};OSF.DDA.Binding=function(a,c){OSF.OUtil.defineEnumerableProperties(this,{document:{value:c},id:{value:a}});var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDataAsync,d.SetDataAsync]);var e=Microsoft.Office.WebExtension.EventType,b=c.bindings._eventDispatches;if(!b[a])b[a]=new OSF.EventDispatch([e.BindingSelectionChanged,e.BindingDataChanged]);var f=b[a];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.generateBindingId=function(){return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureBinding=function(a,c){var d=a[OSF.DDA.BindingProperties.Id],g=a[OSF.DDA.BindingProperties.RowCount],f=a[OSF.DDA.BindingProperties.ColumnCount],h=a[OSF.DDA.BindingProperties.HasHeaders],b;switch(a[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:b=new OSF.DDA.TextBinding(d,c);break;case Microsoft.Office.WebExtension.BindingType.Matrix:b=new OSF.DDA.MatrixBinding(d,c,g,f);break;case Microsoft.Office.WebExtension.BindingType.Table:var i=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument},e;if(i()&&OSF.DDA.ExcelTableBinding)e=OSF.DDA.ExcelTableBinding;else e=OSF.DDA.TableBinding;b=new e(d,c,g,f,h);break;default:b=new OSF.DDA.UnknownBinding(d,c)}return b};OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"});(function(){var d="number",c="object",b="string",a=null;function e(a){return OSF.DDA.OMFactory.manufactureBinding(a,Microsoft.Office.WebExtension.context.document)}function f(a){return a.id}function g(c,e,d){var b=c[Microsoft.Office.WebExtension.Parameters.Data];if(OSF.DDA.TableDataProperties&&b&&(b[OSF.DDA.TableDataProperties.TableRows]!=undefined||b[OSF.DDA.TableDataProperties.TableHeaders]!=undefined))b=OSF.DDA.OMFactory.manufactureTableData(b);b=OSF.DDA.DataCoercion.coerceData(b,d[Microsoft.Office.WebExtension.Parameters.CoercionType]);return b==undefined?a:b}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[b]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[b],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return true}}],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(a){return OSF.OUtil.mapList(a[OSF.DDA.ListDescriptors.BindingList],e)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[b]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(d,b,a){var c=a[Microsoft.Office.WebExtension.Parameters.Id];delete b._eventDispatches[c]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(b,a){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(a.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&a[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&a[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn];delete a[Microsoft.Office.WebExtension.Parameters.RowCount];delete a[Microsoft.Office.WebExtension.Parameters.ColumnCount]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]||a[Microsoft.Office.WebExtension.Parameters.RowCount]||a[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}],onSucceeded:g});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[b,c,d,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(a){return OSF.DDA.DataCoercion.determineCoercionType(a[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[c,b],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[c],defaultValue:a}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[d],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[d],defaultValue:0}}],checkCallArgs:function(a,b){if(a[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&a[Microsoft.Office.WebExtension.Parameters.StartColumn]==0){delete a[Microsoft.Office.WebExtension.Parameters.StartRow];delete a[Microsoft.Office.WebExtension.Parameters.StartColumn]}if(a[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(b.type)&&(a[Microsoft.Office.WebExtension.Parameters.StartRow]||a[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return a},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}]})})();OSF.DDA.TextBinding=function(b,a){OSF.DDA.TextBinding.uber.constructor.call(this,b,a);OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})};OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding);OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.BindingRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:"ItemName"},{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:"BindingType"},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:"PromptText"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:"SampleData"},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:"FailOnCollision"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:2},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:3},{name:Microsoft.Office.WebExtension.BindingType.Table,value:1}],invertible:true});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:"Name"},{name:OSF.DDA.BindingProperties.Type,value:"BindingType"},{name:OSF.DDA.BindingProperties.RowCount,value:"RowCount"},{name:OSF.DDA.BindingProperties.ColumnCount,value:"ColCount"},{name:OSF.DDA.BindingProperties.HasHeaders,value:"HasHeaders"}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});var OSFWordWAC;(function(b){var a=function(){function a(b,c){var a=this;OSF.DDA.WordDocument.uber.constructor.call(a,b,c);OSF.DDA.DispIdHost.addAsyncMethods(a,[OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,OSF.DDA.AsyncMethodNames.SaveAsync,OSF.DDA.AsyncMethodNames.RefreshAsync]);OSF.DDA.DispIdHost.addEventSupport(a,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]));OSF.OUtil.defineEnumerableProperty(a,"customXmlParts",{value:new OSF.DDA.CustomXmlParts});OSF.OUtil.defineEnumerableProperty(a,"bindings",{value:new OSF.DDA.BindingFacade(a)});OSF.OUtil.finalizeProperties(a)}return a}();b.WordDocument=a})(OSFWordWAC||(OSFWordWAC={}));OSF.DDA.WordDocument=OSFWordWAC.WordDocument;OSF.OUtil.extend(OSF.DDA.WordDocument,OSF.DDA.Document);OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType,{Html:"html",Text:"text",Ooxml:"ooxml",Table:"table",Matrix:"matrix"});OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(a,b){OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);a.doc=new OSF.DDA.WordDocument(a,this._initializeSettings(a,true));OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi,[OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);b()};OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function(a){OSF.WebApp._UpdateLinksForHostAndXdmInfo();var b=new OSF.DDA.License(a.get_eToken());OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(a,a.doc,b));OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.WAC.getDelegateMethods,OSF.DDA.WAC.Delegate.ParameterMap));var c=a.get_reason();Microsoft.Office.WebExtension.initialize(c)} \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-win32-16.00.debug.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-win32-16.00.debug.js new file mode 100644 index 000000000..f11633139 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-win32-16.00.debug.js @@ -0,0 +1,10451 @@ +/* Word specific JavaScript API library */ +/* Version: 16.0.6216.3006 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/* +* @overview es6-promise - a tiny implementation of Promises/A+. +* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) +* @license Licensed under MIT license +* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE +* @version 2.3.0 +*/ + +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var OfficeExt; +(function (OfficeExt) { + var MicrosoftAjaxFactory=(function () { + function MicrosoftAjaxFactory() { + } + MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function () { + if (typeof (Sys) !=='undefined' && typeof (Type) !=='undefined' && Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" && Type.registerNamespace && typeof (Type.registerNamespace)==="function" && Type.registerClass && typeof (Type.registerClass)==="function" && typeof (Function._validateParams)==="function") { + return true; + } else { + return false; + } + }; + MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OSF.OUtil.loadScript(msAjaxCDNPath, callback); + }; + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", { + get: function () { + if (this._msAjaxError==null && this.isMsAjaxLoaded()) { + this._msAjaxError=Error; + } + return this._msAjaxError; + }, + set: function (errorClass) { + this._msAjaxError=errorClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", { + get: function () { + if (this._msAjaxSerializer==null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer; + } + return this._msAjaxSerializer; + }, + set: function (serializerClass) { + this._msAjaxSerializer=serializerClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", { + get: function () { + if (this._msAjaxString==null && this.isMsAjaxLoaded()) { + this._msAjaxSerializer=String; + } + return this._msAjaxString; + }, + set: function (stringClass) { + this._msAjaxString=stringClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", { + get: function () { + if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) { + this._msAjaxDebug=Sys.Debug; + } + return this._msAjaxDebug; + }, + set: function (debugClass) { + this._msAjaxDebug=debugClass; + }, + enumerable: true, + configurable: true + }); + return MicrosoftAjaxFactory; + })(); + OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory; +})(OfficeExt || (OfficeExt={})); +var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory(); +var OSF=OSF || {}; +var OfficeExt; +(function (OfficeExt) { + var SafeStorage=(function () { + function SafeStorage(_internalStorage) { + this._internalStorage=_internalStorage; + } + SafeStorage.prototype.getItem=function (key) { + try { + return this._internalStorage && this._internalStorage.getItem(key); + } catch (e) { + return null; + } + }; + SafeStorage.prototype.setItem=function (key, data) { + try { + this._internalStorage && this._internalStorage.setItem(key, data); + } catch (e) { + } + }; + SafeStorage.prototype.clear=function () { + try { + this._internalStorage && this._internalStorage.clear(); + } catch (e) { + } + }; + SafeStorage.prototype.removeItem=function (key) { + try { + this._internalStorage && this._internalStorage.removeItem(key); + } catch (e) { + } + }; + SafeStorage.prototype.getKeysWithPrefix=function (keyPrefix) { + var keyList=[]; + try { + var len=this._internalStorage && this._internalStorage.length || 0; + for (var i=0; i < len; i++) { + var key=this._internalStorage.key(i); + if (key.indexOf(keyPrefix)===0) { + keyList.push(key); + } + } + } catch (e) { + } + return keyList; + }; + return SafeStorage; + })(); + OfficeExt.SafeStorage=SafeStorage; +})(OfficeExt || (OfficeExt={})); +OSF.OUtil=(function () { + var _uniqueId=-1; + var _xdmInfoKey='&_xdm_Info='; + var _serializerVersionKey='&_serializer_version='; + var _xdmSessionKeyPrefix='_xdm_'; + var _serializerVersionKeyPrefix='_serializer_version='; + var _fragmentSeparator='#'; + var _loadedScripts={}; + var _defaultScriptLoadingTimeout=30000; + var _safeSessionStorage=null; + var _safeLocalStorage=null; + + var _rndentropy=new Date().getTime(); + function _random() { + var nextrand=0x7fffffff * (Math.random()); + nextrand ^=_rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10))); + + return nextrand.toString(16); + } + ; + function _getSessionStorage() { + if (!_safeSessionStorage) { + try { + var sessionStorage=window.sessionStorage; + } catch (ex) { + sessionStorage=null; + } + _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage); + } + return _safeSessionStorage; + } + ; + return { + set_entropy: function OSF_OUtil$set_entropy(entropy) { + if (typeof entropy=="string") { + for (var i=0; i < entropy.length; i+=4) { + var temp=0; + for (var j=0; j < 4 && i+j < entropy.length; j++) { + temp=(temp << 8)+entropy.charCodeAt(i+j); + } + _rndentropy ^=temp; + } + } else if (typeof entropy=="number") { + _rndentropy ^=entropy; + } else { + _rndentropy ^=0x7fffffff * Math.random(); + } + _rndentropy &=0x7fffffff; + }, + extend: function OSF_OUtil$extend(child, parent) { + var F=function () { + }; + F.prototype=parent.prototype; + child.prototype=new F(); + child.prototype.constructor=child; + child.uber=parent.prototype; + if (parent.prototype.constructor===Object.prototype.constructor) { + parent.prototype.constructor=parent; + } + }, + setNamespace: function OSF_OUtil$setNamespace(name, parent) { + if (parent && name && !parent[name]) { + parent[name]={}; + } + }, + unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) { + if (parent && name && parent[name]) { + delete parent[name]; + } + }, + loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) { + if (url && callback) { + var doc=window.document; + var _loadedScriptEntry=_loadedScripts[url]; + if (!_loadedScriptEntry) { + var script=doc.createElement("script"); + script.type="text/javascript"; + _loadedScriptEntry={ loaded: false, pendingCallbacks: [callback], timer: null }; + _loadedScripts[url]=_loadedScriptEntry; + var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback() { + if (_loadedScriptEntry.timer !=null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + _loadedScriptEntry.loaded=true; + var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length; + for (var i=0; i < pendingCallbackCount; i++) { + var currentCallback=_loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + var onLoadError=function OSF_OUtil_loadScript$onLoadError() { + delete _loadedScripts[url]; + if (_loadedScriptEntry.timer !=null) { + clearTimeout(_loadedScriptEntry.timer); + delete _loadedScriptEntry.timer; + } + var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length; + for (var i=0; i < pendingCallbackCount; i++) { + var currentCallback=_loadedScriptEntry.pendingCallbacks.shift(); + currentCallback(); + } + }; + if (script.readyState) { + script.onreadystatechange=function () { + if (script.readyState=="loaded" || script.readyState=="complete") { + script.onreadystatechange=null; + onLoadCallback(); + } + }; + } else { + script.onload=onLoadCallback; + } + script.onerror=onLoadError; + + timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout; + _loadedScriptEntry.timer=setTimeout(onLoadError, timeoutInMs); + script.src=url; + doc.getElementsByTagName("head")[0].appendChild(script); + } else if (_loadedScriptEntry.loaded) { + callback(); + } else { + _loadedScriptEntry.pendingCallbacks.push(callback); + } + } + }, + loadCSS: function OSF_OUtil$loadCSS(url) { + if (url) { + var doc=window.document; + var link=doc.createElement("link"); + link.type="text/css"; + link.rel="stylesheet"; + link.href=url; + doc.getElementsByTagName("head")[0].appendChild(link); + } + }, + parseEnum: function OSF_OUtil$parseEnum(str, enumObject) { + var parsed=enumObject[str.trim()]; + if (typeof (parsed)=='undefined') { + OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str); + throw OsfMsAjaxFactory.msAjaxError.argument("str"); + } + return parsed; + }, + delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() { + var obj={ calc: arguments[0] }; + return function () { + if (obj.calc) { + obj.val=obj.calc.apply(this, arguments); + delete obj.calc; + } + return obj.val; + }; + }, + getUniqueId: function OSF_OUtil$getUniqueId() { + _uniqueId=_uniqueId+1; + return _uniqueId.toString(); + }, + formatString: function OSF_OUtil$formatString() { + var args=arguments; + var source=args[0]; + return source.replace(/{(\d+)}/gm, function (match, number) { + var index=parseInt(number, 10)+1; + return args[index]===undefined ? '{'+number+'}' : args[index]; + }); + }, + generateConversationId: function OSF_OUtil$generateConversationId() { + return [_random(), _random(), (new Date()).getTime().toString()].join('_'); + }, + getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame) { + var frameName=_xdmSessionKeyPrefix+cacheKey+this.generateConversationId(); + frame.setAttribute("name", frameName); + return this.generateConversationId(); + }, + addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) { + return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue); + }, + addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) { + return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion); + }, + addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue) { + url=url.trim() || ''; + var urlParts=url.split(_fragmentSeparator); + var urlWithoutFragment=urlParts.shift(); + var fragment=urlParts.join(_fragmentSeparator); + return [urlWithoutFragment, _fragmentSeparator, fragment, keyName, infoValue].join(''); + }, + parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) { + return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) { + return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, skipSessionStorage, fragment); + }, + parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) { + return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash); + }, + parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) { + return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, skipSessionStorage, fragment)); + }, + parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment) { + var fragmentParts=fragment.split(infoKey); + var xdmInfoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null; + var osfSessionStorage=_getSessionStorage(); + if (!skipSessionStorage && osfSessionStorage) { + var sessionKeyStart=window.name.indexOf(infoKeyPrefix); + if (sessionKeyStart > -1) { + var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart); + if (sessionKeyEnd==-1) { + sessionKeyEnd=window.name.length; + } + var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd); + if (xdmInfoValue) { + osfSessionStorage.setItem(sessionKey, xdmInfoValue); + } else { + xdmInfoValue=osfSessionStorage.getItem(sessionKey); + } + } + } + return xdmInfoValue; + }, + getConversationId: function OSF_OUtil$getConversationId() { + var searchString=window.location.search; + var conversationId=null; + if (searchString) { + var index=searchString.indexOf("&"); + + conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1); + if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') { + conversationId=conversationId.substring(0, conversationId.length - 1); + if (conversationId) { + conversationId=decodeURIComponent(conversationId); + } + } + } + return conversationId; + }, + getInfoItems: function OSF_OUtil$getInfoItems(strInfo) { + var items=strInfo.split("$"); + if (typeof items[1]=="undefined") { + items=strInfo.split("|"); + } + return items; + }, + getConversationUrl: function OSF_OUtil$getConversationUrl() { + var conversationUrl=''; + var xdmInfoValue=OSF.OUtil.parseXdmInfo(true); + if (xdmInfoValue) { + var items=OSF.OUtil.getInfoItems(xdmInfoValue); + if (items !=undefined && items.length >=3) { + conversationUrl=items[2]; + } + } + return conversationUrl; + }, + validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) { + var e=Function._validateParams(arguments, [ + { name: "params", type: Object, mayBeNull: false }, + { name: "expectedProperties", type: Object, mayBeNull: false }, + { name: "callback", type: Function, mayBeNull: true } + ]); + if (e) + throw e; + for (var p in expectedProperties) { + e=Function._validateParameter(params[p], expectedProperties[p], p); + if (e) + throw e; + } + }, + writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) { + if (window.msWriteProfilerMark) { + window.msWriteProfilerMark(text); + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + outputDebug: function OSF_OUtil$outputDebug(text) { + if (typeof (Sys) !=='undefined' && Sys && Sys.Debug) { + OsfMsAjaxFactory.msAjaxDebug.trace(text); + } + }, + defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) { + descriptor=descriptor || {}; + for (var nd in attributes) { + var attribute=attributes[nd]; + if (descriptor[attribute]==undefined) { + descriptor[attribute]=true; + } + } + Object.defineProperty(obj, prop, descriptor); + return obj; + }, + defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) { + descriptors=descriptors || {}; + for (var prop in descriptors) { + OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes); + } + return obj; + }, + defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]); + }, + defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]); + }, + defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) { + return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]); + }, + defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) { + return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]); + }, + finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) { + descriptor=descriptor || {}; + var props=Object.getOwnPropertyNames(obj); + var propsLength=props.length; + for (var i=0; i < propsLength; i++) { + var prop=props[i]; + var desc=Object.getOwnPropertyDescriptor(obj, prop); + if (!desc.get && !desc.set) { + desc.writable=descriptor.writable || false; + } + desc.configurable=descriptor.configurable || false; + desc.enumerable=descriptor.enumerable || true; + Object.defineProperty(obj, prop, desc); + } + return obj; + }, + mapList: function OSF_OUtil$MapList(list, mapFunction) { + var ret=[]; + if (list) { + for (var item in list) { + ret.push(mapFunction(list[item])); + } + } + return ret; + }, + listContainsKey: function OSF_OUtil$listContainsKey(list, key) { + for (var item in list) { + if (key==item) { + return true; + } + } + return false; + }, + listContainsValue: function OSF_OUtil$listContainsElement(list, value) { + for (var item in list) { + if (value==list[item]) { + return true; + } + } + return false; + }, + augmentList: function OSF_OUtil$augmentList(list, addenda) { + var add=list.push ? function (key, value) { + list.push(value); + } : function (key, value) { + list[key]=value; + }; + for (var key in addenda) { + add(key, addenda[key]); + } + }, + redefineList: function OSF_Outil$redefineList(oldList, newList) { + for (var key1 in oldList) { + delete oldList[key1]; + } + for (var key2 in newList) { + oldList[key2]=newList[key2]; + } + }, + isArray: function OSF_OUtil$isArray(obj) { + return Object.prototype.toString.apply(obj)==="[object Array]"; + }, + isFunction: function OSF_OUtil$isFunction(obj) { + return Object.prototype.toString.apply(obj)==="[object Function]"; + }, + isDate: function OSF_OUtil$isDate(obj) { + return Object.prototype.toString.apply(obj)==="[object Date]"; + }, + addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) { + if (element.addEventListener) { + element.addEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) { + element.attachEvent("on"+eventName, listener); + } else { + element["on"+eventName]=listener; + } + }, + removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) { + if (element.removeEventListener) { + element.removeEventListener(eventName, listener, false); + } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) { + element.detachEvent("on"+eventName, listener); + } else { + element["on"+eventName]=null; + } + }, + xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) { + var xmlhttp; + try { + xmlhttp=new XMLHttpRequest(); + xmlhttp.onreadystatechange=function () { + if (xmlhttp.readyState==4) { + if (xmlhttp.status==200) { + onSuccess(xmlhttp.responseText); + } else { + onError(xmlhttp.status); + } + } + }; + xmlhttp.open("GET", url, true); + xmlhttp.send(); + } catch (ex) { + onError(ex); + } + }, + encodeBase64: function OSF_Outil$encodeBase64(input) { + if (!input) + return input; + var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/="; + var output=[]; + var temp=[]; + var index=0; + var c1, c2, c3, a, b, c; + var i; + var length=input.length; + do { + c1=input.charCodeAt(index++); + c2=input.charCodeAt(index++); + c3=input.charCodeAt(index++); + i=0; + a=c1 & 255; + b=c1 >> 8; + c=c2 & 255; + temp[i++]=a >> 2; + temp[i++]=((a & 3) << 4) | (b >> 4); + temp[i++]=((b & 15) << 2) | (c >> 6); + temp[i++]=c & 63; + if (!isNaN(c2)) { + a=c2 >> 8; + b=c3 & 255; + c=c3 >> 8; + temp[i++]=a >> 2; + temp[i++]=((a & 3) << 4) | (b >> 4); + temp[i++]=((b & 15) << 2) | (c >> 6); + temp[i++]=c & 63; + } + if (isNaN(c2)) { + temp[i - 1]=64; + } else if (isNaN(c3)) { + temp[i - 2]=64; + temp[i - 1]=64; + } + for (var t=0; t < i; t++) { + output.push(codex.charAt(temp[t])); + } + } while(index < length); + return output.join(""); + }, + getSessionStorage: function OSF_Outil$getSessionStorage() { + return _getSessionStorage(); + }, + getLocalStorage: function OSF_Outil$getLocalStorage() { + if (!_safeLocalStorage) { + try { + var localStorage=window.localStorage; + } catch (ex) { + localStorage=null; + } + _safeLocalStorage=new OfficeExt.SafeStorage(localStorage); + } + return _safeLocalStorage; + }, + convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) { + var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6); + return hex; + }, + attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) { + element.onclick=function (e) { + handler(); + }; + element.ontouchend=function (e) { + handler(); + e.preventDefault(); + }; + }, + getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) { + var e=Function._validateParams(arguments, [ + { name: "queryString", type: String, mayBeNull: false }, + { name: "paramName", type: String, mayBeNull: false } + ]); + if (e) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."); + return ""; + } + var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i"); + if (!queryExp.test(queryString)) { + OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."); + return ""; + } + return queryExp.exec(queryString)[1]; + }, + isiOS: function OSF_Outil$isiOS() { + return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); + }, + shallowCopy: function OSF_Outil$shallowCopy(sourceObj) { + var copyObj=sourceObj.constructor(); + for (var property in sourceObj) { + if (sourceObj.hasOwnProperty(property)) { + copyObj[property]=sourceObj[property]; + } + } + return copyObj; + } + }; +})(); + +OSF.OUtil.Guid=(function () { + var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + return { + generateNewGuid: function OSF_Outil_Guid$generateNewGuid() { + var result=""; + var tick=(new Date()).getTime(); + var index=0; + + for (; index < 32 && tick > 0; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[tick % 16]; + tick=Math.floor(tick / 16); + } + + for (; index < 32; index++) { + if (index==8 || index==12 || index==16 || index==20) { + result+="-"; + } + result+=hexCode[Math.floor(Math.random() * 16)]; + } + return result; + } + }; +})(); +window.OSF=OSF; +OSF.OUtil.setNamespace("OSF", window); + +OSF.AppName={ + Unsupported: 0, + Excel: 1, + Word: 2, + PowerPoint: 4, + Outlook: 8, + ExcelWebApp: 16, + WordWebApp: 32, + OutlookWebApp: 64, + Project: 128, + AccessWebApp: 256, + PowerpointWebApp: 512, + ExcelIOS: 1024, + Sway: 2048, + WordIOS: 4096, + PowerPointIOS: 8192, + Access: 16384, + Lync: 32768, + OutlookIOS: 65536, + OneNoteWebApp: 131072 +}; +OSF.InternalPerfMarker={ + DataCoercionBegin: "Agave.HostCall.CoerceDataStart", + DataCoercionEnd: "Agave.HostCall.CoerceDataEnd" +}; +OSF.HostCallPerfMarker={ + IssueCall: "Agave.HostCall.IssueCall", + ReceiveResponse: "Agave.HostCall.ReceiveResponse", + RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised" +}; + +OSF.AgaveHostAction={ + "Select": 0, + "UnSelect": 1, + "CancelDialog": 2, + "InsertAgave": 3, + "CtrlF6In": 4, + "CtrlF6Exit": 5, + "CtrlF6ExitShift": 6, + "SelectWithError": 7, + "NotifyHostError": 8 +}; + +OSF.SharedConstants={ + "NotificationConversationIdSuffix": '_ntf' +}; + +OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) { + this._id=id; + this._appName=appName; + this._appVersion=appVersion; + this._appUILocale=appUILocale; + this._dataLocale=dataLocale; + this._docUrl=docUrl; + this._clientMode=clientMode; + this._settings=settings; + this._reason=reason; + this._osfControlType=osfControlType; + this._eToken=eToken; + this._correlationId=correlationId; + this._appInstanceId=appInstanceId; + this._touchEnabled=touchEnabled; + this._commerceAllowed=commerceAllowed; + this._appMinorVersion=appMinorVersion; + this._requirementMatrix=requirementMatrix; + this.get_id=function get_id() { + return this._id; + }; + this.get_appName=function get_appName() { + return this._appName; + }; + this.get_appVersion=function get_appVersion() { + return this._appVersion; + }; + this.get_appUILocale=function get_appUILocale() { + return this._appUILocale; + }; + this.get_dataLocale=function get_dataLocale() { + return this._dataLocale; + }; + this.get_docUrl=function get_docUrl() { + return this._docUrl; + }; + this.get_clientMode=function get_clientMode() { + return this._clientMode; + }; + this.get_bindings=function get_bindings() { + return this._bindings; + }; + this.get_settings=function get_settings() { + return this._settings; + }; + this.get_reason=function get_reason() { + return this._reason; + }; + this.get_osfControlType=function get_osfControlType() { + return this._osfControlType; + }; + this.get_eToken=function get_eToken() { + return this._eToken; + }; + this.get_correlationId=function get_correlationId() { + return this._correlationId; + }; + this.get_appInstanceId=function get_appInstanceId() { + return this._appInstanceId; + }; + this.get_touchEnabled=function get_touchEnabled() { + return this._touchEnabled; + }; + this.get_commerceAllowed=function get_commerceAllowed() { + return this._commerceAllowed; + }; + this.get_appMinorVersion=function get_appMinorVersion() { + return this._appMinorVersion; + }; + this.get_requirementMatrix=function get_requirementMatrix() { + return this._requirementMatrix; + }; +}; +OSF.OsfControlType={ + DocumentLevel: 0, + ContainerLevel: 1 +}; + +OSF.ClientMode={ + ReadOnly: 0, + ReadWrite: 1 +}; + +OSF.OUtil.setNamespace("Microsoft", window); +OSF.OUtil.setNamespace("Office", Microsoft); +OSF.OUtil.setNamespace("Client", Microsoft.Office); +OSF.OUtil.setNamespace("WebExtension", Microsoft.Office); + +Microsoft.Office.WebExtension.InitializationReason={ + Inserted: "inserted", + DocumentOpened: "documentOpened" +}; + +Microsoft.Office.WebExtension.ValueFormat={ + Unformatted: "unformatted", + Formatted: "formatted" +}; +Microsoft.Office.WebExtension.FilterType={ + All: "all" +}; + +Microsoft.Office.WebExtension.Parameters={ + BindingType: "bindingType", + CoercionType: "coercionType", + ValueFormat: "valueFormat", + FilterType: "filterType", + Columns: "columns", + SampleData: "sampleData", + GoToType: "goToType", + SelectionMode: "selectionMode", + Id: "id", + PromptText: "promptText", + ItemName: "itemName", + FailOnCollision: "failOnCollision", + StartRow: "startRow", + StartColumn: "startColumn", + RowCount: "rowCount", + ColumnCount: "columnCount", + Callback: "callback", + AsyncContext: "asyncContext", + Data: "data", + Rows: "rows", + OverwriteIfStale: "overwriteIfStale", + FileType: "fileType", + EventType: "eventType", + Handler: "handler", + SliceSize: "sliceSize", + SliceIndex: "sliceIndex", + ActiveView: "activeView", + Status: "status", + Xml: "xml", + Namespace: "namespace", + Prefix: "prefix", + XPath: "xPath", + ImageLeft: "imageLeft", + ImageTop: "imageTop", + ImageWidth: "imageWidth", + ImageHeight: "imageHeight", + TaskId: "taskId", + FieldId: "fieldId", + FieldValue: "fieldValue", + ServerUrl: "serverUrl", + ListName: "listName", + ResourceId: "resourceId", + ViewType: "viewType", + ViewName: "viewName", + GetRawValue: "getRawValue", + CellFormat: "cellFormat", + TableOptions: "tableOptions", + TaskIndex: "taskIndex", + ResourceIndex: "resourceIndex" +}; +OSF.OUtil.setNamespace("DDA", OSF); + +OSF.DDA.DocumentMode={ + ReadOnly: 1, + ReadWrite: 0 +}; + +OSF.DDA.PropertyDescriptors={ + AsyncResultStatus: "AsyncResultStatus" +}; +OSF.DDA.EventDescriptors={}; +OSF.DDA.ListDescriptors={}; + +OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) { + if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) { + return bindingId+"_"+eventType; + } else { + return eventType; + } +}; +OSF.DDA.MethodDispId={ + dispidMethodMin: 64, + dispidGetSelectedDataMethod: 64, + dispidSetSelectedDataMethod: 65, + dispidAddBindingFromSelectionMethod: 66, + dispidAddBindingFromPromptMethod: 67, + dispidGetBindingMethod: 68, + dispidReleaseBindingMethod: 69, + dispidGetBindingDataMethod: 70, + dispidSetBindingDataMethod: 71, + dispidAddRowsMethod: 72, + dispidClearAllRowsMethod: 73, + dispidGetAllBindingsMethod: 74, + dispidLoadSettingsMethod: 75, + dispidSaveSettingsMethod: 76, + dispidGetDocumentCopyMethod: 77, + dispidAddBindingFromNamedItemMethod: 78, + dispidAddColumnsMethod: 79, + dispidGetDocumentCopyChunkMethod: 80, + dispidReleaseDocumentCopyMethod: 81, + dispidNavigateToMethod: 82, + dispidGetActiveViewMethod: 83, + dispidGetDocumentThemeMethod: 84, + dispidGetOfficeThemeMethod: 85, + dispidGetFilePropertiesMethod: 86, + dispidClearFormatsMethod: 87, + dispidSetTableOptionsMethod: 88, + dispidSetFormatsMethod: 89, + dispidExecuteRichApiRequestMethod: 93, + dispidAppCommandInvocationCompletedMethod: 94, + dispidAddDataPartMethod: 128, + dispidGetDataPartByIdMethod: 129, + dispidGetDataPartsByNamespaceMethod: 130, + dispidGetDataPartXmlMethod: 131, + dispidGetDataPartNodesMethod: 132, + dispidDeleteDataPartMethod: 133, + dispidGetDataNodeValueMethod: 134, + dispidGetDataNodeXmlMethod: 135, + dispidGetDataNodesMethod: 136, + dispidSetDataNodeValueMethod: 137, + dispidSetDataNodeXmlMethod: 138, + dispidAddDataNamespaceMethod: 139, + dispidGetDataUriByPrefixMethod: 140, + dispidGetDataPrefixByUriMethod: 141, + dispidMethodMax: 141, + dispidGetSelectedTaskMethod: 110, + dispidGetSelectedResourceMethod: 111, + dispidGetTaskMethod: 112, + dispidGetResourceFieldMethod: 113, + dispidGetWSSUrlMethod: 114, + dispidGetTaskFieldMethod: 115, + dispidGetProjectFieldMethod: 116, + dispidGetSelectedViewMethod: 117, + dispidGetTaskByIndexMethod: 118, + dispidGetResourceByIndexMethod: 119, + dispidSetTaskFieldMethod: 120, + dispidSetResourceFieldMethod: 121, + dispidGetMaxTaskIndexMethod: 122, + dispidGetMaxResourceIndexMethod: 123 +}; +OSF.DDA.EventDispId={ + dispidEventMin: 0, + dispidInitializeEvent: 0, + dispidSettingsChangedEvent: 1, + dispidDocumentSelectionChangedEvent: 2, + dispidBindingSelectionChangedEvent: 3, + dispidBindingDataChangedEvent: 4, + dispidDocumentOpenEvent: 5, + dispidDocumentCloseEvent: 6, + dispidActiveViewChangedEvent: 7, + dispidDocumentThemeChangedEvent: 8, + dispidOfficeThemeChangedEvent: 9, + dispidActivationStatusChangedEvent: 32, + dispidAppCommandInvokedEvent: 39, + dispidTaskSelectionChangedEvent: 56, + dispidResourceSelectionChangedEvent: 57, + dispidViewSelectionChangedEvent: 58, + dispidDataNodeAddedEvent: 60, + dispidDataNodeReplacedEvent: 61, + dispidDataNodeDeletedEvent: 62, + dispidEventMax: 63 +}; +OSF.DDA.ErrorCodeManager=(function () { + var _errorMappings={}; + return { + getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) { + return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError]; + }, + addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) { + _errorMappings[errorCode]=errorNameMessage; + }, + errorCodes: { + ooeSuccess: 0, + ooeChunkResult: 1, + ooeCoercionTypeNotSupported: 1000, + ooeGetSelectionNotMatchDataType: 1001, + ooeCoercionTypeNotMatchBinding: 1002, + ooeInvalidGetRowColumnCounts: 1003, + ooeSelectionNotSupportCoercionType: 1004, + ooeInvalidGetStartRowColumn: 1005, + ooeNonUniformPartialGetNotSupported: 1006, + ooeGetDataIsTooLarge: 1008, + ooeFileTypeNotSupported: 1009, + ooeGetDataParametersConflict: 1010, + ooeInvalidGetColumns: 1011, + ooeInvalidGetRows: 1012, + ooeInvalidReadForBlankRow: 1013, + ooeUnsupportedDataObject: 2000, + ooeCannotWriteToSelection: 2001, + ooeDataNotMatchSelection: 2002, + ooeOverwriteWorksheetData: 2003, + ooeDataNotMatchBindingSize: 2004, + ooeInvalidSetStartRowColumn: 2005, + ooeInvalidDataFormat: 2006, + ooeDataNotMatchCoercionType: 2007, + ooeDataNotMatchBindingType: 2008, + ooeSetDataIsTooLarge: 2009, + ooeNonUniformPartialSetNotSupported: 2010, + ooeInvalidSetColumns: 2011, + ooeInvalidSetRows: 2012, + ooeSetDataParametersConflict: 2013, + ooeCellDataAmountBeyondLimits: 2014, + ooeSelectionCannotBound: 3000, + ooeBindingNotExist: 3002, + ooeBindingToMultipleSelection: 3003, + ooeInvalidSelectionForBindingType: 3004, + ooeOperationNotSupportedOnThisBindingType: 3005, + ooeNamedItemNotFound: 3006, + ooeMultipleNamedItemFound: 3007, + ooeInvalidNamedItemForBindingType: 3008, + ooeUnknownBindingType: 3009, + ooeOperationNotSupportedOnMatrixData: 3010, + ooeInvalidColumnsForBinding: 3011, + ooeSettingNameNotExist: 4000, + ooeSettingsCannotSave: 4001, + ooeSettingsAreStale: 4002, + ooeOperationNotSupported: 5000, + ooeInternalError: 5001, + ooeDocumentReadOnly: 5002, + ooeEventHandlerNotExist: 5003, + ooeInvalidApiCallInContext: 5004, + ooeShuttingDown: 5005, + ooeUnsupportedEnumeration: 5007, + ooeIndexOutOfRange: 5008, + ooeBrowserAPINotSupported: 5009, + ooeInvalidParam: 5010, + ooeRequestTimeout: 5011, + ooeTooManyIncompleteRequests: 5100, + ooeRequestTokenUnavailable: 5101, + ooeActivityLimitReached: 5102, + ooeCustomXmlNodeNotFound: 6000, + ooeCustomXmlError: 6100, + ooeCustomXmlExceedQuota: 6101, + ooeCustomXmlOutOfDate: 6102, + ooeNoCapability: 7000, + ooeCannotNavTo: 7001, + ooeSpecifiedIdNotExist: 7002, + ooeNavOutOfBound: 7004, + ooeElementMissing: 8000, + ooeProtectedError: 8001, + ooeInvalidCellsValue: 8010, + ooeInvalidTableOptionValue: 8011, + ooeInvalidFormatValue: 8012, + ooeRowIndexOutOfRange: 8020, + ooeColIndexOutOfRange: 8021, + ooeFormatValueOutOfRange: 8022, + ooeCellFormatAmountBeyondLimits: 8023, + ooeMemoryFileLimit: 11000, + ooeNetworkProblemRetrieveFile: 11001, + ooeInvalidSliceSize: 11002, + ooeInvalidCallback: 11101 + }, + initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) { + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits }; + + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile }; + _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported }; + } + }; +})(); +var OfficeExt; +(function (OfficeExt) { + (function (Requirement) { + var RequirementMatrix=(function () { + function RequirementMatrix(_setMap) { + this.isSetSupported=function _isSetSupported(name, minVersion) { + if (name==undefined) { + return false; + } + if (minVersion==undefined) { + minVersion=0; + } + var setSupportArray=this._setMap; + var sets=setSupportArray._sets; + if (sets.hasOwnProperty(name.toLowerCase())) { + var setMaxVersion=sets[name.toLowerCase()]; + return setMaxVersion > 0 && setMaxVersion >=minVersion; + } else { + return false; + } + }; + this._setMap=_setMap; + } + return RequirementMatrix; + })(); + Requirement.RequirementMatrix=RequirementMatrix; + var DefaultSetRequirement=(function () { + function DefaultSetRequirement(setMap) { + this._sets=setMap; + } + return DefaultSetRequirement; + })(); + Requirement.DefaultSetRequirement=DefaultSetRequirement; + + var ExcelClientDefaultSetRequirement=(function (_super) { + __extends(ExcelClientDefaultSetRequirement, _super); + function ExcelClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "excelapi": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement; + var OutlookClientDefaultSetRequirement=(function (_super) { + __extends(OutlookClientDefaultSetRequirement, _super); + function OutlookClientDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement; + var WordClientDefaultSetRequirement=(function (_super) { + __extends(WordClientDefaultSetRequirement, _super); + function WordClientDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1, + "wordapi": 1.1 + }); + } + return WordClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement; + var PowerpointClientDefaultSetRequirement=(function (_super) { + __extends(PowerpointClientDefaultSetRequirement, _super); + function PowerpointClientDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement; + var ProjectClientDefaultSetRequirement=(function (_super) { + __extends(ProjectClientDefaultSetRequirement, _super); + function ProjectClientDefaultSetRequirement() { + _super.call(this, { + "selection": 1.1, + "textcoercion": 1.1 + }); + } + return ProjectClientDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement; + var ExcelWebDefaultSetRequirement=(function (_super) { + __extends(ExcelWebDefaultSetRequirement, _super); + function ExcelWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "file": 1.1 + }); + } + return ExcelWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement; + var WordWebDefaultSetRequirement=(function (_super) { + __extends(WordWebDefaultSetRequirement, _super); + function WordWebDefaultSetRequirement() { + _super.call(this, { + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "ooxmlcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return WordWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement; + var PowerpointWebDefaultSetRequirement=(function (_super) { + __extends(PowerpointWebDefaultSetRequirement, _super); + function PowerpointWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "settings": 1.1 + }); + } + return PowerpointWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement; + var OutlookWebDefaultSetRequirement=(function (_super) { + __extends(OutlookWebDefaultSetRequirement, _super); + function OutlookWebDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.3 + }); + } + return OutlookWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement; + var SwayWebDefaultSetRequirement=(function (_super) { + __extends(SwayWebDefaultSetRequirement, _super); + function SwayWebDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "documentevents": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return SwayWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement; + var AccessWebDefaultSetRequirement=(function (_super) { + __extends(AccessWebDefaultSetRequirement, _super); + function AccessWebDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "partialtablebindings": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1 + }); + } + return AccessWebDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement; + var ExcelIOSDefaultSetRequirement=(function (_super) { + __extends(ExcelIOSDefaultSetRequirement, _super); + function ExcelIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "documentevents": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1 + }); + } + return ExcelIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement; + var WordIOSDefaultSetRequirement=(function (_super) { + __extends(WordIOSDefaultSetRequirement, _super); + function WordIOSDefaultSetRequirement() { + _super.call(this, { + "bindingevents": 1.1, + "compressedfile": 1.1, + "customxmlparts": 1.1, + "documentevents": 1.1, + "file": 1.1, + "htmlcoercion": 1.1, + "matrixbindings": 1.1, + "matrixcoercion": 1.1, + "ooxmlcoercion": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "tablebindings": 1.1, + "tablecoercion": 1.1, + "textbindings": 1.1, + "textcoercion": 1.1, + "textfile": 1.1 + }); + } + return WordIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement; + var PowerpointIOSDefaultSetRequirement=(function (_super) { + __extends(PowerpointIOSDefaultSetRequirement, _super); + function PowerpointIOSDefaultSetRequirement() { + _super.call(this, { + "activeview": 1.1, + "compressedfile": 1.1, + "documentevents": 1.1, + "file": 1.1, + "pdffile": 1.1, + "selection": 1.1, + "settings": 1.1, + "textcoercion": 1.1 + }); + } + return PowerpointIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement; + var OutlookIOSDefaultSetRequirement=(function (_super) { + __extends(OutlookIOSDefaultSetRequirement, _super); + function OutlookIOSDefaultSetRequirement() { + _super.call(this, { + "mailbox": 1.1 + }); + } + return OutlookIOSDefaultSetRequirement; + })(DefaultSetRequirement); + Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement; + + var RequirementsMatrixFactory=(function () { + function RequirementsMatrixFactory() { + } + RequirementsMatrixFactory.initializeOsfDda=function () { + OSF.OUtil.setNamespace("Requirement", OSF.DDA); + }; + + RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) { + this.initializeDefaultSetMatrix(); + var defaultRequirementMatrix=undefined; + if (appContext.get_requirementMatrix() !=undefined && typeof (JSON) !=="undefined") { + var matrixItem=JSON.parse(appContext.get_requirementMatrix()); + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem)); + } else { + var appMinorVersion=appContext.get_appMinorVersion(); + var appMinorVersionString=""; + if (appMinorVersion < 10) { + appMinorVersionString="0"+appMinorVersion; + } else { + appMinorVersionString=""+appMinorVersion; + } + + var appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString; + var appLocator=appContext.get_appName()+"-"+appFullVersion; + if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) { + defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]); + } else { + defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({})); + } + } + return defaultRequirementMatrix; + }; + RequirementsMatrixFactory.initializeDefaultSetMatrix=function () { + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement(); + RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement(); + }; + RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00"; + RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00"; + RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00"; + RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00"; + RequirementsMatrixFactory.Excel_WAC_1600="16-16.00"; + RequirementsMatrixFactory.Word_WAC_1600="32-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00"; + RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01"; + RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00"; + RequirementsMatrixFactory.Access_WAC_1600="256-16.00"; + RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00"; + RequirementsMatrixFactory.Excel_IOS_1600="1024-16.01"; + RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00"; + RequirementsMatrixFactory.Word_IOS_1600="4096-16.00"; + RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00"; + + RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00"; + + RequirementsMatrixFactory.DefaultSetArrayMatrix={}; + return RequirementsMatrixFactory; + })(); + Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory; + })(OfficeExt.Requirement || (OfficeExt.Requirement={})); + var Requirement=OfficeExt.Requirement; +})(OfficeExt || (OfficeExt={})); + +OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(); + +Microsoft.Office.WebExtension.ApplicationMode={ + WebEditor: "webEditor", + WebViewer: "webViewer", + Client: "client" +}; + +Microsoft.Office.WebExtension.DocumentMode={ + ReadOnly: "readOnly", + ReadWrite: "readWrite" +}; + +OSF.NamespaceManager=(function OSF_NamespaceManager() { + var _userOffice; + var _useShortcut=false; + return { + enableShortcut: function OSF_NamespaceManager$enableShortcut() { + if (!_useShortcut) { + if (window.Office) { + _userOffice=window.Office; + } else { + OSF.OUtil.setNamespace("Office", window); + } + window.Office=Microsoft.Office.WebExtension; + _useShortcut=true; + } + }, + disableShortcut: function OSF_NamespaceManager$disableShortcut() { + if (_useShortcut) { + if (_userOffice) { + window.Office=_userOffice; + } else { + OSF.OUtil.unsetNamespace("Office", window); + } + _useShortcut=false; + } + } + }; +})(); + +OSF.NamespaceManager.enableShortcut(); + +Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) { + if (useShortcut) { + OSF.NamespaceManager.enableShortcut(); + } else { + OSF.NamespaceManager.disableShortcut(); + } +}; + +Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) { + var promise; + if (str && typeof str=="string") { + var index=str.indexOf("#"); + if (index !=-1) { + var op=str.substring(0, index); + var target=str.substring(index+1); + switch (op) { + case "binding": + case "bindings": + if (target) { + promise=new OSF.DDA.BindingPromise(target); + } + break; + } + } + } + if (!promise) { + if (errorCallback) { + var callbackType=typeof errorCallback; + if (callbackType=="function") { + var callArgs={}; + callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback; + OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext)); + } else { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType); + } + } + } else { + promise.onFail=errorCallback; + return promise; + } +}; + +OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) { + OSF.OUtil.defineEnumerableProperties(this, { + "contentLanguage": { + value: officeAppContext.get_dataLocale() + }, + "displayLanguage": { + value: officeAppContext.get_appUILocale() + }, + "touchEnabled": { + value: officeAppContext.get_touchEnabled() + }, + "commerceAllowed": { + value: officeAppContext.get_commerceAllowed() + } + }); + if (document) { + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: document + }); + } + if (license) { + OSF.OUtil.defineEnumerableProperty(this, "license", { + value: license + }); + } + if (appOM) { + var displayName=appOM.displayName || "appOM"; + delete appOM.displayName; + OSF.OUtil.defineEnumerableProperty(this, displayName, { + value: appOM + }); + } + if (getOfficeTheme) { + OSF.OUtil.defineEnumerableProperty(this, "officeTheme", { + get: function () { + return getOfficeTheme(); + } + }); + } + var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext); + + OSF.OUtil.defineEnumerableProperty(this, "requirements", { + value: requirements + }); +}; + +OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) { + OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme); + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", { + value: settings + }); + } +}; + +OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context); + +OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) { +}; + +OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) { + var mode; + switch (officeAppContext.get_clientMode()) { + case OSF.ClientMode.ReadOnly: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly; + break; + case OSF.ClientMode.ReadWrite: + mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite; + break; + } + ; + if (settings) { + OSF.OUtil.defineEnumerableProperty(this, "settings", { + value: settings + }); + } + ; + OSF.OUtil.defineMutableProperties(this, { + "mode": { + value: mode + }, + "url": { + value: officeAppContext.get_docUrl() + } + }); +}; + +OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) { + OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings); + + if (bindingFacade) { + OSF.OUtil.defineEnumerableProperty(this, "bindings", { + get: function OSF_DDA_Document$GetBindings() { + return bindingFacade; + } + }); + } + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetSelectedDataAsync, + am.SetSelectedDataAsync + ]); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document); + +OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", { + get: function Microsoft_Office_WebExtension$GetContext() { + var context; + if (OSF && OSF._OfficeAppFactory) { + context=OSF._OfficeAppFactory.getContext(); + } + return context; + } +}); + +OSF.DDA.License=function OSF_DDA_License(eToken) { + OSF.OUtil.defineEnumerableProperty(this, "value", { + value: eToken + }); +}; + +OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA); +OSF.DDA.AsyncResultEnum.Properties={ + Context: "Context", + Value: "Value", + Status: "Status", + Error: "Error" +}; +Microsoft.Office.WebExtension.AsyncResultStatus={ + Succeeded: "succeeded", + Failed: "failed" +}; + +OSF.DDA.AsyncResultEnum.ErrorCode={ + Success: 0, + Failed: 1 +}; +OSF.DDA.AsyncResultEnum.ErrorProperties={ + Name: "Name", + Message: "Message", + Code: "Code" +}; +OSF.DDA.AsyncMethodNames={}; +OSF.DDA.AsyncMethodNames.addNames=function (methodNames) { + for (var entry in methodNames) { + var am={}; + OSF.OUtil.defineEnumerableProperties(am, { + "id": { + value: entry + }, + "displayName": { + value: methodNames[entry] + } + }); + OSF.DDA.AsyncMethodNames[entry]=am; + } +}; +OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) { + var requiredCount=requiredParameters.length; + var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () { + return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName); + }); + + function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) { + for (var name in params) { + var param=params[name]; + var arg=args[name]; + + if (param["enum"]) { + switch (typeof arg) { + case "string": + if (OSF.OUtil.listContainsValue(param["enum"], arg)) { + break; + } + + case "undefined": + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration; + break; + default: + throw getInvalidParameterString(); + } + } + + if (param["types"]) { + if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) { + throw getInvalidParameterString(); + } + } + } + } + ; + function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) { + if (userArgs.length < requiredCount) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments); + } + + var requiredArgs=[]; + var index; + for (index=0; index < requiredCount; index++) { + requiredArgs.push(userArgs[index]); + } + OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs); + var ret={}; + for (index=0; index < requiredCount; index++) { + var param=requiredParameters[index]; + var arg=requiredArgs[index]; + if (param.verify) { + var isValid=param.verify(arg, caller, stateInfo); + if (!isValid) { + throw getInvalidParameterString(); + } + } + ret[param.name]=arg; + } + return ret; + } + ; + function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) { + if (userArgs.length > requiredCount+2) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments); + } + var options, parameterCallback; + + for (var i=userArgs.length - 1; i >=requiredCount; i--) { + var argument=userArgs[i]; + switch (typeof argument) { + case "object": + if (options) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects); + } else { + options=argument; + } + break; + case "function": + if (parameterCallback) { + throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction); + } else { + parameterCallback=argument; + } + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument); + break; + } + } + options=options || {}; + + for (var optionName in supportedOptions) { + if (!OSF.OUtil.listContainsKey(options, optionName)) { + var value=undefined; + var option=supportedOptions[optionName]; + + if (option.calculate && requiredArgs) { + value=option.calculate(requiredArgs, caller, stateInfo); + } + + if (!value && option.defaultValue !==undefined) { + value=option.defaultValue; + } + options[optionName]=value; + } + } + + if (parameterCallback) { + if (options[Microsoft.Office.WebExtension.Parameters.Callback]) { + throw Strings.OfficeOM.L_RedundantCallbackSpecification; + } else { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + } + OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options); + return options; + } + ; + this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) { + var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo); + var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo); + var callArgs={}; + for (var r in required) { + callArgs[r]=required[r]; + } + for (var o in options) { + callArgs[o]=options[o]; + } + for (var s in privateStateCallbacks) { + callArgs[s]=privateStateCallbacks[s](caller, stateInfo); + } + if (checkCallArgs) { + callArgs=checkCallArgs(callArgs, caller, stateInfo); + } + return callArgs; + }; + this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (onSucceeded) { + payload=onSucceeded(response, caller, callArgs); + } else { + payload=response; + } + } else { + if (onFailed) { + payload=onFailed(status, response); + } else { + payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + } + return payload; + }; + + this.getCallArgs=function (suppliedArgs) { + var options, parameterCallback; + + for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) { + var argument=suppliedArgs[i]; + switch (typeof argument) { + case "object": + options=argument; + break; + case "function": + parameterCallback=argument; + break; + } + } + options=options || {}; + if (parameterCallback) { + options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback; + } + return options; + }; +}; +OSF.DDA.AsyncMethodCallFactory=(function () { + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + return { + manufacture: function (params) { + var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : []; + var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : []; + + return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName); + } + }; +})(); +OSF.DDA.AsyncMethodCalls={}; +OSF.DDA.AsyncMethodCalls.define=function (callDefinition) { + OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition); +}; + +OSF.DDA.Error=function OSF_DDA_Error(name, message, code) { + OSF.OUtil.defineEnumerableProperties(this, { + "name": { + value: name + }, + "message": { + value: message + }, + "code": { + value: code + } + }); +}; + +OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) { + OSF.OUtil.defineEnumerableProperties(this, { + "value": { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value] + }, + "status": { + value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded + } + }); + if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) { + OSF.OUtil.defineEnumerableProperty(this, "asyncContext", { + value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context] + }); + } + if (errorArgs) { + OSF.OUtil.defineEnumerableProperty(this, "error", { + value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]) + }); + } +}; +OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) { + var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback]; + if (callback) { + var asyncInitArgs={}; + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext]; + var errorArgs; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload; + } else { + errorArgs={}; + payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload; + errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload; + } + callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs)); + } +}; +OSF.DDA.ListType=(function () { + var listTypes={}; + return { + setListType: function OSF_DDA_ListType$AddListType(t, prop) { + listTypes[t]=prop; + }, + isListType: function OSF_DDA_ListType$IsListType(t) { + return OSF.OUtil.listContainsKey(listTypes, t); + }, + getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { + return listTypes[t]; + } + }; +})(); +OSF.DDA.HostParameterMap=function (specialProcessor, mappings) { + var toHostMap="toHost"; + var fromHostMap="fromHost"; + + var self="self"; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={ + toHost: function (data) { + if (data !=null && data.rows !==undefined) { + var tableData={}; + tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows; + tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers; + data=tableData; + } + return data; + }, + fromHost: function (args) { + return args; + } + }; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]; + + function mapValues(preimageSet, mapping) { + var ret=preimageSet ? {} : undefined; + for (var entry in preimageSet) { + var preimage=preimageSet[entry]; + var image; + if (OSF.DDA.ListType.isListType(entry)) { + image=[]; + for (var subEntry in preimage) { + image.push(mapValues(preimage[subEntry], mapping)); + } + } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) { + image=dynamicTypes[entry][mapping](preimage); + } else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) { + image=mapValues(preimage, mapping); + } else { + var maps=mappings[entry]; + if (maps) { + var map=maps[mapping]; + if (map) { + image=map[preimage]; + if (image===undefined) { + image=preimage; + } + } + } else { + image=preimage; + } + } + ret[entry]=image; + } + return ret; + } + ; + + function generateArguments(imageSet, parameters) { + var ret; + for (var param in parameters) { + var arg; + if (specialProcessor.isComplexType(param)) { + arg=generateArguments(imageSet, mappings[param][toHostMap]); + } else { + arg=imageSet[param]; + } + if (arg !=undefined) { + if (!ret) { + ret={}; + } + var index=parameters[param]; + + if (index==self) { + index=param; + } + ret[index]=specialProcessor.pack(param, arg); + } + } + return ret; + } + ; + + function extractArguments(source, parameters, extracted) { + if (!extracted) { + extracted={}; + } + for (var param in parameters) { + var index=parameters[param]; + var value; + + if (index==self) { + value=source; + } else { + value=source[index]; + } + if (value===null || value===undefined) { + extracted[param]=undefined; + } else { + value=specialProcessor.unpack(param, value); + var map; + if (specialProcessor.isComplexType(param)) { + map=mappings[param][fromHostMap]; + + if (specialProcessor.preserveNesting(param)) { + extracted[param]=extractArguments(value, map); + } else { + extractArguments(value, map, extracted); + } + } else { + if (OSF.DDA.ListType.isListType(param)) { + map={}; + var entryDescriptor=OSF.DDA.ListType.getDescriptor(param); + map[entryDescriptor]=self; + for (var item in value) { + value[item]=extractArguments(value[item], map); + } + } + extracted[param]=value; + } + } + } + return extracted; + } + ; + function applyMap(mapName, preimage, mapping) { + var parameters=mappings[mapName][mapping]; + var image; + if (mapping=="toHost") { + var imageSet=mapValues(preimage, mapping); + image=generateArguments(imageSet, parameters); + } else if (mapping=="fromHost") { + var argumentSet=extractArguments(preimage, parameters); + image=mapValues(argumentSet, mapping); + } + return image; + } + ; + if (!mappings) { + mappings={}; + } + this.addMapping=function (mapName, description) { + var toHost, fromHost; + if (description.map) { + toHost=description.map; + fromHost={}; + for (var preimage in toHost) { + var image=toHost[preimage]; + + if (image==self) { + image=preimage; + } + fromHost[image]=preimage; + } + } else { + toHost=description.toHost; + fromHost=description.fromHost; + } + var pair=mappings[mapName]; + if (pair) { + var currMap=pair[toHostMap]; + for (var th in currMap) + toHost[th]=currMap[th]; + currMap=pair[fromHostMap]; + for (var fh in currMap) + fromHost[fh]=currMap[fh]; + } else { + pair=mappings[mapName]={}; + } + pair[toHostMap]=toHost; + pair[fromHostMap]=fromHost; + }; + this.toHost=function (mapName, preimage) { + return applyMap(mapName, preimage, toHostMap); + }; + this.fromHost=function (mapName, image) { + return applyMap(mapName, image, fromHostMap); + }; + this.self=self; + this.addComplexType=function (ct) { + specialProcessor.addComplexType(ct); + }; + this.getDynamicType=function (dt) { + return specialProcessor.getDynamicType(dt); + }; + this.setDynamicType=function (dt, handler) { + specialProcessor.setDynamicType(dt, handler); + }; + this.dynamicTypes=dynamicTypes; + this.doMapValues=function (preimageSet, mapping) { + return mapValues(preimageSet, mapping); + }; +}; +OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) { + this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) { + complexTypes.push(ct); + }; + this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) { + return dynamicTypes[dt]; + }; + this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) { + dynamicTypes[dt]=handler; + }; + this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) { + return OSF.OUtil.listContainsValue(complexTypes, t); + }; + this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) { + return OSF.OUtil.listContainsKey(dynamicTypes, p); + }; + this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) { + var pn=[]; + if (OSF.DDA.PropertyDescriptors) + pn.push(OSF.DDA.PropertyDescriptors.Subset); + if (OSF.DDA.DataNodeEventProperties) { + pn=pn.concat([ + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]); + } + return OSF.OUtil.listContainsValue(pn, p); + }; + this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +}; +OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) { + var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor); + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + parameterMap.define=function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + + if (definition.invertible) { + args.map=toHost; + } else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.addMapping(definition.type, args); + if (definition.isComplexType) + parameterMap.addComplexType(definition.type); + }; + for (var id in initialDefs) + parameterMap.define(initialDefs[id]); + return parameterMap; +}; +OSF.OUtil.setNamespace("DispIdHost", OSF.DDA); +OSF.DDA.DispIdHost.Methods={ + InvokeMethod: "invokeMethod", + AddEventHandler: "addEventHandler", + RemoveEventHandler: "removeEventHandler" +}; +OSF.DDA.DispIdHost.Delegates={ + ExecuteAsync: "executeAsync", + RegisterEventAsync: "registerEventAsync", + UnregisterEventAsync: "unregisterEventAsync", + ParameterMap: "parameterMap" +}; +OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) { + var dispIdMap={}; + var jsom=OSF.DDA.AsyncMethodNames; + var did=OSF.DDA.MethodDispId; + + var methodMap={ + "GoToByIdAsync": did.dispidNavigateToMethod, + "GetSelectedDataAsync": did.dispidGetSelectedDataMethod, + "SetSelectedDataAsync": did.dispidSetSelectedDataMethod, + "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod, + "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod, + "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod, + "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod, + "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod, + "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod, + "GetAllAsync": did.dispidGetAllBindingsMethod, + "GetByIdAsync": did.dispidGetBindingMethod, + "ReleaseByIdAsync": did.dispidReleaseBindingMethod, + "GetDataAsync": did.dispidGetBindingDataMethod, + "SetDataAsync": did.dispidSetBindingDataMethod, + "AddRowsAsync": did.dispidAddRowsMethod, + "AddColumnsAsync": did.dispidAddColumnsMethod, + "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod, + "RefreshAsync": did.dispidLoadSettingsMethod, + "SaveAsync": did.dispidSaveSettingsMethod, + "GetActiveViewAsync": did.dispidGetActiveViewMethod, + "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod, + "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod, + "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod, + "ClearFormatsAsync": did.dispidClearFormatsMethod, + "SetTableOptionsAsync": did.dispidSetTableOptionsMethod, + "SetFormatsAsync": did.dispidSetFormatsMethod, + "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod, + "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod, + "AddDataPartAsync": did.dispidAddDataPartMethod, + "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod, + "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod, + "GetPartXmlAsync": did.dispidGetDataPartXmlMethod, + "GetPartNodesAsync": did.dispidGetDataPartNodesMethod, + "DeleteDataPartAsync": did.dispidDeleteDataPartMethod, + "GetNodeValueAsync": did.dispidGetDataNodeValueMethod, + "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod, + "GetRelativeNodesAsync": did.dispidGetDataNodesMethod, + "SetNodeValueAsync": did.dispidSetDataNodeValueMethod, + "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod, + "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod, + "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod, + "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod, + "GetSelectedTask": did.dispidGetSelectedTaskMethod, + "GetTask": did.dispidGetTaskMethod, + "GetWSSUrl": did.dispidGetWSSUrlMethod, + "GetTaskField": did.dispidGetTaskFieldMethod, + "GetSelectedResource": did.dispidGetSelectedResourceMethod, + "GetResourceField": did.dispidGetResourceFieldMethod, + "GetProjectField": did.dispidGetProjectFieldMethod, + "GetSelectedView": did.dispidGetSelectedViewMethod, + "GetTaskByIndex": did.dispidGetTaskByIndexMethod, + "GetResourceByIndex": did.dispidGetResourceByIndexMethod, + "SetTaskField": did.dispidSetTaskFieldMethod, + "SetResourceField": did.dispidSetResourceFieldMethod, + "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod, + "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod + }; + for (var method in methodMap) { + if (jsom[method]) { + dispIdMap[jsom[method].id]=methodMap[method]; + } + } + + jsom=Microsoft.Office.WebExtension.EventType; + did=OSF.DDA.EventDispId; + var eventMap={ + "SettingsChanged": did.dispidSettingsChangedEvent, + "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent, + "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent, + "BindingDataChanged": did.dispidBindingDataChangedEvent, + "ActiveViewChanged": did.dispidActiveViewChangedEvent, + "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent, + "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent, + "AppCommandInvoked": did.dispidAppCommandInvokedEvent, + "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent, + "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent, + "ViewSelectionChanged": did.dispidViewSelectionChangedEvent, + "DataNodeInserted": did.dispidDataNodeAddedEvent, + "DataNodeReplaced": did.dispidDataNodeReplacedEvent, + "DataNodeDeleted": did.dispidDataNodeDeletedEvent + }; + + for (var event in eventMap) { + if (jsom[event]) { + dispIdMap[jsom[event]]=eventMap[event]; + } + } + function onException(ex, asyncMethodCall, suppliedArgs, callArgs) { + if (typeof ex=="number") { + if (!callArgs) { + callArgs=asyncMethodCall.getCallArgs(suppliedArgs); + } + OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex)); + } else { + throw ex; + } + } + ; + this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) { + var callArgs; + try { + var methodName=method.id; + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState); + var dispId=dispIdMap[methodName]; + var delegate=getDelegateMethods(methodName); + var hostCallArgs; + if (parameterMap.toHost) { + hostCallArgs=parameterMap.toHost(dispId, callArgs); + } else { + hostCallArgs=callArgs; + } + delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({ + "dispId": dispId, + "hostCallArgs": hostCallArgs, + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": function (status, hostResponseArgs) { + var responseArgs; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (parameterMap.fromHost) { + responseArgs=parameterMap.fromHost(dispId, hostResponseArgs); + } else { + responseArgs=hostResponseArgs; + } + } else { + responseArgs=hostResponseArgs; + } + var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs); + OSF.DDA.issueAsyncResult(callArgs, status, payload); + } + }); + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + var added=eventDispatch.addEventHandler(eventType, handler); + if (!added) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed; + } + } + var error; + if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + if (eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration, + "onEvent": function handleEvent(hostArgs) { + var args=parameterMap.fromHost(dispId, hostArgs); + eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args)); + } + }); + } else { + onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; + this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) { + var callArgs; + var eventType, handler; + function onEnsureRegistration(status) { + var error; + if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + error=OSF.DDA.ErrorCodeManager.getErrorArgs(status); + } + OSF.DDA.issueAsyncResult(callArgs, status, error); + } + try { + var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id]; + callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch); + + eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType]; + handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler]; + var status, removeSuccess; + + if (handler===null) { + removeSuccess=eventDispatch.clearEventHandlers(eventType); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } else { + removeSuccess=eventDispatch.removeEventHandler(eventType, handler); + status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist; + } + if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) { + var dispId=dispIdMap[eventType]; + var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]; + invoker({ + "eventType": eventType, + "dispId": dispId, + "targetId": caller.id || "", + "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); + }, + "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { + OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); + }, + "onComplete": onEnsureRegistration + }); + } else { + onEnsureRegistration(status); + } + } catch (ex) { + onException(ex, asyncMethodCall, suppliedArguments, callArgs); + } + }; +}; +OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) { + for (var entry in asyncMethodNames) { + var method=asyncMethodNames[entry]; + var name=method.displayName; + if (!target[name]) { + OSF.OUtil.defineEnumerableProperty(target, name, { + value: (function (asyncMethod) { + return function () { + var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod]; + invokeMethod(asyncMethod, arguments, target, privateState); + }; + })(method) + }); + } + } +}; +OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) { + var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName; + var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName; + if (!target[add]) { + OSF.OUtil.defineEnumerableProperty(target, add, { + value: function () { + var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler]; + addEventHandler(arguments, eventDispatch, target); + } + }); + } + if (!target[remove]) { + OSF.OUtil.defineEnumerableProperty(target, remove, { + value: function () { + var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]; + removeEventHandler(arguments, eventDispatch, target); + } + }); + } +}; + +if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) { + var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js'; + OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() { + if (!OsfMsAjaxFactory.isMsAjaxLoaded()) { + throw 'Not able to load MicrosoftAjax.js.'; + } + }); + } +} + +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; + +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +}; +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if (rows==1 && cols==1) { + ret=[vbArr]; + } else { + ret=[]; + for (var row=0; row < rows; row++) { + var rowArr=[]; + for (var col=0; col < cols; col++) { + var datum=vbArr[row * cols+col]; + if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[]; + var dynamicTypes={}; + + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if (dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if (array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + }; + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray; + value=toArraySupported ? arg.toArray() : arg || {}; + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +}; + +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); + +OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [ + { + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 }, + { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 } + ] + }, + { + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 } + ] + } +]); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 }, + { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 } + ] +}); +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + function fromSafeArray(value) { + var ret=value; + if (value !=null && value.toArray) { + var arrayResult=value.toArray(); + for (var i=0; i < arrayResult.length; i++) { + arrayResult[i]=fromSafeArray(arrayResult[i]); + } + ret=arrayResult; + } + return ret; + } + try { + if (args.onCalling) { + args.onCalling(); + } + var startTime=(new Date()).getTime(); + OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) { + var payload=result[OSF.DDA.SafeArray.Response.Payload]; + payload=fromSafeArray(payload); + if (payload !=null) { + if (!args._chunkResultData) { + args._chunkResultData=new Array(); + } + + args._chunkResultData[payload[0]]=payload[1]; + } + } else { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + if (args._chunkResultData) { + payload=fromSafeArray(payload); + if (payload !=null) { + var expectedChunkCount=payload[payload.length - 1]; + if (args._chunkResultData.length==expectedChunkCount) { + payload[payload.length - 1]=args._chunkResultData; + } else { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + } + } + } + } else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + }); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + }; +}; +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback); + } catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; + +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +}; +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; + +OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) { + this._hostInfo=hostInfo; + this._webAppState=webAppState; + this._context=context; + this._settings=settings; + this._hostFacade=hostFacade; + this._initializeSettings=this.initializeSettings; +}; +OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) { + var settings; + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey()); + if (storageSettings) { + serializedSettings=(typeof (JSON) !=="undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true); + } else { + storageSettings=(typeof (JSON) !=="undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + } + var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + if (refreshSupported) { + settings=new OSF.DDA.RefreshableSettings(deserializedSettings); + } else { + settings=new OSF.DDA.Settings(deserializedSettings); + } + return settings; +}; +OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() { +}; +OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) { + this.prepareApiSurface(appContext); + Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext)); +}; +OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) { + var license=new OSF.DDA.License(appContext.get_eToken()); + var getOfficeThemeHandler=(OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null; + OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler)); + var getDelegateMethods, parameterMap; + getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods; + parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap; + OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap)); +}; +OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { + return OSF.DDA.RichInitializationReason[appContext.get_reason()]; +}; + +OSF.DDA.DispIdHost.getClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + + if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) { + var readSerializedSettings=function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings); + } + if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) { + var writeSerializedSettings=function (hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving); + }; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings); + } + return delegateMethods; +}; + +var OSFRichclient; +(function (OSFRichclient) { + var RichClientHostController=(function () { + function RichClientHostController() { + } + RichClientHostController.prototype.execute=function (id, params, callback) { + window.external.Execute(id, params, callback); + }; + RichClientHostController.prototype.registerEvent=function (id, targetId, handler, callback) { + window.external.RegisterEvent(id, targetId, handler, callback); + }; + RichClientHostController.prototype.unregisterEvent=function (id, targetId, callback) { + window.external.UnregisterEvent(id, targetId, callback); + }; + return RichClientHostController; + })(); + OSFRichclient.RichClientHostController=RichClientHostController; +})(OSFRichclient || (OSFRichclient={})); +OSF.ClientHostController=new OSFRichclient.RichClientHostController(); + +var OfficeExt; +(function (OfficeExt) { + (function (OfficeTheme) { + var OfficeThemeManager=(function () { + function OfficeThemeManager() { + this._osfOfficeTheme=null; + this._osfOfficeThemeTimeStamp=null; + } + OfficeThemeManager.prototype.getOfficeTheme=function () { + if (OSF.DDA._OsfControlContext) { + if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) { + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0); + } + } else { + var startTime=(new Date()).getTime(); + var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo(); + var endTime=(new Date()).getTime(); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime)); + } + + this._osfOfficeTheme=JSON.parse(osfOfficeTheme); + for (var color in this._osfOfficeTheme) { + this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]); + } + this._osfOfficeThemeTimeStamp=endTime; + } + return this._osfOfficeTheme; + } + }; + + OfficeThemeManager.instance=function () { + if (OfficeThemeManager._instance==null) { + OfficeThemeManager._instance=new OfficeThemeManager(); + } + return OfficeThemeManager._instance; + }; + OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5000; + + OfficeThemeManager._instance=null; + return OfficeThemeManager; + })(); + OfficeTheme.OfficeThemeManager=OfficeThemeManager; + + OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA); + OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme; + })(OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={})); + var OfficeTheme=OfficeExt.OfficeTheme; +})(OfficeExt || (OfficeExt={})); + +OSF.DDA.ClientSettingsManager={ + getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + try { + response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving); + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess; + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name: Strings.OfficeOM.L_InternalError, message: ex }; + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + }, + read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Read(keys, values); + if (onReceiving) { + onReceiving(); + } + var serializedSettings={}; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + return serializedSettings; + }, + write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) { + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + if (onCalling) { + onCalling(); + } + OSF.DDA._OsfControlContext.GetSettings().Write(keys, values); + if (onReceiving) { + onReceiving(); + } + } +}; + +OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported) { + var serializedSettings=OSF.DDA.ClientSettingsManager.read(); + var settings=this.deserializeSettings(serializedSettings, refreshSupported); + return settings; +}; +OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) { + var returnedContext; + var context=OSF.DDA._OsfControlContext=window.external.GetContext(); + var appType=context.GetAppType(); + var appTypeSupported=false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry]==appType) { + appTypeSupported=true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type "+appType; + } + var id=context.GetSolutionRef(); + var version=context.GetAppVersionMajor(); + var minorVersion=context.GetAppVersionMinor(); + var UILocale=context.GetAppUILocale(); + var dataLocale=context.GetAppDataLocale(); + var docUrl=context.GetDocUrl(); + var clientMode=context.GetAppCapabilities(); + var reason=context.GetActivationMode(); + var osfControlType=context.GetControlIntegrationLevel(); + var settings=[]; + var eToken; + try { + eToken=context.GetSolutionToken(); + } catch (ex) { + } + var correlationId; + + if (typeof context.GetCorrelationId !=="undefined") { + correlationId=context.GetCorrelationId(); + } + var appInstanceId; + if (typeof context.GetInstanceId !=="undefined") { + appInstanceId=context.GetInstanceId(); + } + var touchEnabled; + if (typeof context.GetTouchEnabled !=="undefined") { + touchEnabled=context.GetTouchEnabled(); + } + var commerceAllowed; + if (typeof context.GetCommerceAllowed !=="undefined") { + commerceAllowed=context.GetCommerceAllowed(); + } + var requirementMatrix; + if (typeof context.GetSupportedMatrix !=="undefined") { + requirementMatrix=context.GetSupportedMatrix(); + } + eToken=eToken ? eToken.toString() : ""; + returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); +}; + +var OSFLog; +(function (OSFLog) { + var BaseUsageData=(function () { + function BaseUsageData(table) { + this._table=table; + this._fields={}; + } + Object.defineProperty(BaseUsageData.prototype, "Fields", { + get: function () { + return this._fields; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseUsageData.prototype, "Table", { + get: function () { + return this._table; + }, + enumerable: true, + configurable: true + }); + BaseUsageData.prototype.SerializeFields=function () { + }; + BaseUsageData.prototype.SetSerializedField=function (key, value) { + if (typeof (value) !=="undefined" && value !==null) { + this._serializedFields[key]=value.toString(); + } + }; + BaseUsageData.prototype.SerializeRow=function () { + this._serializedFields={}; + this.SetSerializedField("Table", this._table); + this.SerializeFields(); + return JSON.stringify(this._serializedFields); + }; + return BaseUsageData; + })(); + OSFLog.BaseUsageData=BaseUsageData; + var AppActivatedUsageData=(function (_super) { + __extends(AppActivatedUsageData, _super); + function AppActivatedUsageData() { + _super.call(this, "AppActivated"); + } + Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppId", { + get: function () { + return this.Fields["AppId"]; + }, + set: function (value) { + this.Fields["AppId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", { + get: function () { + return this.Fields["AppURL"]; + }, + set: function (value) { + this.Fields["AppURL"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", { + get: function () { + return this.Fields["AssetId"]; + }, + set: function (value) { + this.Fields["AssetId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Browser", { + get: function () { + return this.Fields["Browser"]; + }, + set: function (value) { + this.Fields["Browser"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "UserId", { + get: function () { + return this.Fields["UserId"]; + }, + set: function (value) { + this.Fields["UserId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "Host", { + get: function () { + return this.Fields["Host"]; + }, + set: function (value) { + this.Fields["Host"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", { + get: function () { + return this.Fields["HostVersion"]; + }, + set: function (value) { + this.Fields["HostVersion"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", { + get: function () { + return this.Fields["ClientId"]; + }, + set: function (value) { + this.Fields["ClientId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", { + get: function () { + return this.Fields["AppSizeWidth"]; + }, + set: function (value) { + this.Fields["AppSizeWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", { + get: function () { + return this.Fields["AppSizeHeight"]; + }, + set: function (value) { + this.Fields["AppSizeHeight"]=value; + }, + enumerable: true, + configurable: true + }); + AppActivatedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("AppId", this.AppId); + this.SetSerializedField("AppURL", this.AppURL); + this.SetSerializedField("AssetId", this.AssetId); + this.SetSerializedField("Browser", this.Browser); + this.SetSerializedField("UserId", this.UserId); + this.SetSerializedField("Host", this.Host); + this.SetSerializedField("HostVersion", this.HostVersion); + this.SetSerializedField("ClientId", this.ClientId); + this.SetSerializedField("AppSizeWidth", this.AppSizeWidth); + this.SetSerializedField("AppSizeHeight", this.AppSizeHeight); + }; + return AppActivatedUsageData; + })(BaseUsageData); + OSFLog.AppActivatedUsageData=AppActivatedUsageData; + var ScriptLoadUsageData=(function (_super) { + __extends(ScriptLoadUsageData, _super); + function ScriptLoadUsageData() { + _super.call(this, "ScriptLoad"); + } + Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", { + get: function () { + return this.Fields["ScriptId"]; + }, + set: function (value) { + this.Fields["ScriptId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", { + get: function () { + return this.Fields["StartTime"]; + }, + set: function (value) { + this.Fields["StartTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + ScriptLoadUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("ScriptId", this.ScriptId); + this.SetSerializedField("StartTime", this.StartTime); + this.SetSerializedField("ResponseTime", this.ResponseTime); + }; + return ScriptLoadUsageData; + })(BaseUsageData); + OSFLog.ScriptLoadUsageData=ScriptLoadUsageData; + var AppClosedUsageData=(function (_super) { + __extends(AppClosedUsageData, _super); + function AppClosedUsageData() { + _super.call(this, "AppClosed"); + } + Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", { + get: function () { + return this.Fields["FocusTime"]; + }, + set: function (value) { + this.Fields["FocusTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", { + get: function () { + return this.Fields["AppSizeFinalWidth"]; + }, + set: function (value) { + this.Fields["AppSizeFinalWidth"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", { + get: function () { + return this.Fields["AppSizeFinalHeight"]; + }, + set: function (value) { + this.Fields["AppSizeFinalHeight"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", { + get: function () { + return this.Fields["OpenTime"]; + }, + set: function (value) { + this.Fields["OpenTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", { + get: function () { + return this.Fields["CloseMethod"]; + }, + set: function (value) { + this.Fields["CloseMethod"]=value; + }, + enumerable: true, + configurable: true + }); + AppClosedUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("FocusTime", this.FocusTime); + this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth); + this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight); + this.SetSerializedField("OpenTime", this.OpenTime); + this.SetSerializedField("CloseMethod", this.CloseMethod); + }; + return AppClosedUsageData; + })(BaseUsageData); + OSFLog.AppClosedUsageData=AppClosedUsageData; + var APIUsageUsageData=(function (_super) { + __extends(APIUsageUsageData, _super); + function APIUsageUsageData() { + _super.call(this, "APIUsage"); + } + Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIType", { + get: function () { + return this.Fields["APIType"]; + }, + set: function (value) { + this.Fields["APIType"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "APIID", { + get: function () { + return this.Fields["APIID"]; + }, + set: function (value) { + this.Fields["APIID"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "Parameters", { + get: function () { + return this.Fields["Parameters"]; + }, + set: function (value) { + this.Fields["Parameters"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", { + get: function () { + return this.Fields["ResponseTime"]; + }, + set: function (value) { + this.Fields["ResponseTime"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", { + get: function () { + return this.Fields["ErrorType"]; + }, + set: function (value) { + this.Fields["ErrorType"]=value; + }, + enumerable: true, + configurable: true + }); + APIUsageUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("APIType", this.APIType); + this.SetSerializedField("APIID", this.APIID); + this.SetSerializedField("Parameters", this.Parameters); + this.SetSerializedField("ResponseTime", this.ResponseTime); + this.SetSerializedField("ErrorType", this.ErrorType); + }; + return APIUsageUsageData; + })(BaseUsageData); + OSFLog.APIUsageUsageData=APIUsageUsageData; + var AppInitializationUsageData=(function (_super) { + __extends(AppInitializationUsageData, _super); + function AppInitializationUsageData() { + _super.call(this, "AppInitialization"); + } + Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", { + get: function () { + return this.Fields["CorrelationId"]; + }, + set: function (value) { + this.Fields["CorrelationId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", { + get: function () { + return this.Fields["SessionId"]; + }, + set: function (value) { + this.Fields["SessionId"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", { + get: function () { + return this.Fields["SuccessCode"]; + }, + set: function (value) { + this.Fields["SuccessCode"]=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AppInitializationUsageData.prototype, "Message", { + get: function () { + return this.Fields["Message"]; + }, + set: function (value) { + this.Fields["Message"]=value; + }, + enumerable: true, + configurable: true + }); + AppInitializationUsageData.prototype.SerializeFields=function () { + this.SetSerializedField("CorrelationId", this.CorrelationId); + this.SetSerializedField("SessionId", this.SessionId); + this.SetSerializedField("SuccessCode", this.SuccessCode); + this.SetSerializedField("Message", this.Message); + }; + return AppInitializationUsageData; + })(BaseUsageData); + OSFLog.AppInitializationUsageData=AppInitializationUsageData; +})(OSFLog || (OSFLog={})); + +var Logger; +(function (Logger) { + "use strict"; + + (function (TraceLevel) { + TraceLevel[TraceLevel["info"]=0]="info"; + TraceLevel[TraceLevel["warning"]=1]="warning"; + TraceLevel[TraceLevel["error"]=2]="error"; + })(Logger.TraceLevel || (Logger.TraceLevel={})); + var TraceLevel=Logger.TraceLevel; + + (function (SendFlag) { + SendFlag[SendFlag["none"]=0]="none"; + SendFlag[SendFlag["flush"]=1]="flush"; + })(Logger.SendFlag || (Logger.SendFlag={})); + var SendFlag=Logger.SendFlag; + function allowUploadingData() { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + OSF.Logger.ulsEndpoint.loadProxyFrame(); + } + } + Logger.allowUploadingData=allowUploadingData; + function sendLog(traceLevel, message, flag) { + if (OSF.Logger && OSF.Logger.ulsEndpoint) { + var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true }; + var logs=JSON.stringify(jsonObj); + OSF.Logger.ulsEndpoint.writeLog(logs); + } + } + Logger.sendLog=sendLog; + + function creatULSEndpoint() { + try { + return new ULSEndpointProxy(); + } catch (e) { + return null; + } + } + + var ULSEndpointProxy=(function () { + function ULSEndpointProxy() { + var _this=this; + this.proxyFrame=null; + this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html"; + this.buffer=[]; + this.proxyFrameReady=false; + OSF.OUtil.addEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + + setTimeout(function () { + _this.loadProxyFrame(); + }, 3000); + } + ULSEndpointProxy.prototype.writeLog=function (log) { + if (this.proxyFrameReady===true) { + this.proxyFrame.contentWindow.postMessage(log, "*"); + } else { + if (this.buffer.length < 128) { + this.buffer.push(log); + } + } + }; + ULSEndpointProxy.prototype.loadProxyFrame=function () { + if (this.proxyFrame==null) { + this.proxyFrame=document.createElement("iframe"); + this.proxyFrame.setAttribute("style", "display:none"); + this.proxyFrame.setAttribute("src", this.telemetryEndPoint); + document.head.appendChild(this.proxyFrame); + } + }; + + ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) { + var _this=this; + if (e.data==="ProxyFrameReadyToLog") { + this.proxyFrameReady=true; + for (var i=0; i < this.buffer.length; i++) { + this.writeLog(this.buffer[i]); + } + + this.buffer.length=0; + + OSF.OUtil.removeEventListener(window, "message", function (e) { + return _this.tellProxyFrameReady(e); + }); + } else if (e.data==="ProxyFrameReadyToInit") { + var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() }; + var initStr=JSON.stringify(initJson); + this.proxyFrame.contentWindow.postMessage(initStr, "*"); + } + }; + return ULSEndpointProxy; + })(); + + if (!OSF.Logger) { + OSF.Logger=Logger; + } + + Logger.ulsEndpoint=creatULSEndpoint(); +})(Logger || (Logger={})); + +var OSFAppTelemetry; +(function (OSFAppTelemetry) { + "use strict"; + var appInfo; + var sessionId=OSF.OUtil.Guid.generateNewGuid(); + var osfControlAppCorrelationId=""; + + ; + + var AppInfo=(function () { + function AppInfo() { + } + return AppInfo; + })(); + + var Event=(function () { + function Event(name, handler) { + this.name=name; + this.handler=handler; + } + return Event; + })(); + var AppStorage=(function () { + function AppStorage() { + this.clientIDKey="Office API client"; + this.logIdSetKey="Office App Log Id Set"; + } + AppStorage.prototype.getClientId=function () { + var clientId=this.getValue(this.clientIDKey); + + if (!clientId || clientId.length <=0 || clientId.length > 40) { + clientId=OSF.OUtil.Guid.generateNewGuid(); + + this.setValue(this.clientIDKey, clientId); + } + return clientId; + }; + + AppStorage.prototype.saveLog=function (logId, log) { + var logIdSet=this.getValue(this.logIdSetKey); + logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId; + this.setValue(this.logIdSetKey, logIdSet); + this.setValue(logId, log); + }; + + AppStorage.prototype.enumerateLog=function (callback, clean) { + var logIdSet=this.getValue(this.logIdSetKey); + if (logIdSet) { + var ids=logIdSet.split(";"); + for (var id in ids) { + var logId=ids[id]; + var log=this.getValue(logId); + if (log) { + if (callback) { + callback(logId, log); + } + if (clean) { + this.remove(logId); + } + } + } + if (clean) { + this.remove(this.logIdSetKey); + } + } + }; + AppStorage.prototype.getValue=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + var value=""; + if (osfLocalStorage) { + value=osfLocalStorage.getItem(key); + } + return value; + }; + AppStorage.prototype.setValue=function (key, value) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + osfLocalStorage.setItem(key, value); + } + }; + AppStorage.prototype.remove=function (key) { + var osfLocalStorage=OSF.OUtil.getLocalStorage(); + if (osfLocalStorage) { + try { + osfLocalStorage.removeItem(key); + } catch (ex) { + } + } + }; + return AppStorage; + })(); + + var AppLogger=(function () { + function AppLogger() { + } + AppLogger.prototype.LogData=function (data) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none); + }; + AppLogger.prototype.LogRawData=function (log) { + if (!OSF.Logger) { + return; + } + OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none); + }; + return AppLogger; + })(); + + function initialize(context) { + if (!OSF.Logger) { + return; + } + if (appInfo) { + return; + } + appInfo=new AppInfo(); + appInfo.hostVersion=context.get_appVersion(); + appInfo.appId=context.get_id(); + appInfo.host=context.get_appName(); + appInfo.browser=window.navigator.userAgent; + appInfo.correlationId=context.get_correlationId(); + appInfo.clientId=(new AppStorage()).getClientId(); + var index=location.href.indexOf("?"); + appInfo.appURL=(index==-1) ? location.href : location.href.substring(0, index); + + (function getUserIdAndAssetIdFromToken(token, appInfo) { + var xmlContent; + var parser; + var xmlDoc; + appInfo.assetId=""; + appInfo.userId=""; + try { + xmlContent=decodeURIComponent(token); + parser=new DOMParser(); + xmlDoc=parser.parseFromString(xmlContent, "text/xml"); + appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue; + appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue; + } catch (e) { + } finally { + xmlContent=null; + xmlDoc=null; + parser=null; + } + })(context.get_eToken(), appInfo); + + (function handleLifecycle() { + var startTime=new Date(); + + var lastFocus=null; + + var focusTime=0; + var finished=false; + var adjustFocusTime=function () { + if (document.hasFocus()) { + if (lastFocus==null) { + lastFocus=new Date(); + } + } else if (lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + }; + var eventList=[]; + eventList.push(new Event("focus", adjustFocusTime)); + eventList.push(new Event("blur", adjustFocusTime)); + + eventList.push(new Event("focusout", adjustFocusTime)); + eventList.push(new Event("focusin", adjustFocusTime)); + var exitFunction=function () { + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler); + } + eventList.length=0; + if (!finished) { + if (document.hasFocus() && lastFocus) { + focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime()); + lastFocus=null; + } + OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime); + finished=true; + } + }; + + eventList.push(new Event("beforeunload", exitFunction)); + eventList.push(new Event("unload", exitFunction)); + + for (var i=0; i < eventList.length; i++) { + OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler); + } + + adjustFocusTime(); + })(); + OSFAppTelemetry.onAppActivated(); + } + OSFAppTelemetry.initialize=initialize; + + function onAppActivated() { + if (!appInfo) { + return; + } + + (new AppStorage()).enumerateLog(function (id, log) { + return (new AppLogger()).LogRawData(log); + }, true); + var data=new OSFLog.AppActivatedUsageData(); + data.SessionId=sessionId; + data.AppId=appInfo.appId; + data.AssetId=appInfo.assetId; + data.AppURL=appInfo.appURL; + data.UserId=appInfo.userId; + data.ClientId=appInfo.clientId; + data.Browser=appInfo.browser; + data.Host=appInfo.host; + data.HostVersion=appInfo.hostVersion; + data.CorrelationId=appInfo.correlationId; + data.AppSizeWidth=window.innerWidth; + data.AppSizeHeight=window.innerHeight; + (new AppLogger()).LogData(data); + + setTimeout(function () { + if (!OSF.Logger) { + return; + } + OSF.Logger.allowUploadingData(); + }, 100); + } + OSFAppTelemetry.onAppActivated=onAppActivated; + + function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) { + var data=new OSFLog.ScriptLoadUsageData(); + data.CorrelationId=appCorrelationId; + data.SessionId=sessionId; + data.ScriptId=scriptId; + data.StartTime=msStartTime; + data.ResponseTime=msResponseTime; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onScriptDone=onScriptDone; + + function onCallDone(apiType, id, parameters, msResponseTime, errorType) { + if (!appInfo) { + return; + } + var data=new OSFLog.APIUsageUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.APIType=apiType; + data.APIID=id; + data.Parameters=parameters; + data.ResponseTime=msResponseTime; + data.ErrorType=errorType; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.onCallDone=onCallDone; + ; + + function onMethodDone(id, args, msResponseTime, errorType) { + var parameters=null; + if (args) { + if (typeof args=="number") { + parameters=String(args); + } else if (typeof args==="object") { + for (var index in args) { + if (parameters !==null) { + parameters+=","; + } else { + parameters=""; + } + if (typeof args[index]=="number") { + parameters+=String(args[index]); + } + } + } else { + parameters=""; + } + } + OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType); + } + OSFAppTelemetry.onMethodDone=onMethodDone; + + function onPropertyDone(propertyName, msResponseTime) { + OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime); + } + OSFAppTelemetry.onPropertyDone=onPropertyDone; + + function onEventDone(id, errorType) { + OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType); + } + OSFAppTelemetry.onEventDone=onEventDone; + + function onRegisterDone(register, id, msResponseTime, errorType) { + OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType); + } + OSFAppTelemetry.onRegisterDone=onRegisterDone; + + function onAppClosed(openTime, focusTime) { + if (!appInfo) { + return; + } + var data=new OSFLog.AppClosedUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.FocusTime=focusTime; + data.OpenTime=openTime; + data.AppSizeFinalWidth=window.innerWidth; + data.AppSizeFinalHeight=window.innerHeight; + + (new AppStorage()).saveLog(sessionId, data.SerializeRow()); + } + OSFAppTelemetry.onAppClosed=onAppClosed; + function setOsfControlAppCorrelationId(correlationId) { + osfControlAppCorrelationId=correlationId; + } + OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId; + function doAppInitializationLogging(isException, message) { + var data=new OSFLog.AppInitializationUsageData(); + data.CorrelationId=osfControlAppCorrelationId; + data.SessionId=sessionId; + data.SuccessCode=isException ? 1 : 0; + data.Message=message; + (new AppLogger()).LogData(data); + } + OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging; + + function logAppCommonMessage(message) { + doAppInitializationLogging(false, message); + } + OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage; + + function logAppException(errorMessage) { + doAppInitializationLogging(true, errorMessage); + } + OSFAppTelemetry.logAppException=logAppException; + OSF.AppTelemetry=OSFAppTelemetry; +})(OSFAppTelemetry || (OSFAppTelemetry={})); + +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed", + Pdf: "pdf" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FileProperties: "FileProperties", + FileSliceProperties: "FileSliceProperties" +}); +OSF.DDA.FileProperties={ + Handle: "FileHandle", + FileSize: "FileSize", + SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize +}; +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], privateState); +}; + +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.AsyncMethodNames.addNames({ + GetDocumentCopyAsync: "getFileAsync", + GetDocumentCopyChunkAsync: "getSliceAsync", + ReleaseDocumentCopyAsync: "closeAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.FileType, + "enum": Microsoft.Office.WebExtension.FileType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SliceSize, + value: { + "types": ["number"], + "defaultValue": 4 * 1024 * 1024 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var sliceSize=callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]; + + if (sliceSize <=0 || sliceSize > (4 * 1024 * 1024)) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize; + } + return callArgs; + }, + onSucceeded: function (fileDescriptor, caller, callArgs) { + return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]); + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.SliceIndex, + "types": ["number"] + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + }, + { + name: OSF.DDA.FileProperties.SliceSize, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.SliceSize]; + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + var index=callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]; + + if (index < 0 || index >=caller.sliceCount) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange; + } + + callArgs[OSF.DDA.FileSliceOffset]=parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString()); + return callArgs; + }, + onSucceeded: function (sliceDescriptor, caller, callArgs) { + var slice={}; + OSF.OUtil.defineEnumerableProperties(slice, { + "data": { + value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data] + }, + "index": { + value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex] + }, + "size": { + value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize] + } + }); + return slice; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync, + privateStateCallbacks: [ + { + name: OSF.DDA.FileProperties.Handle, + value: function (caller, stateInfo) { + return stateInfo[OSF.DDA.FileProperties.Handle]; + } + } + ] +}); + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FileType, { + Text: "text", + Pdf: "pdf" +}); + +OSF.DDA.FilePropertiesDescriptor={ + Url: "Url" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + FilePropertiesDescriptor: "FilePropertiesDescriptor" +}); + +Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) { + OSF.OUtil.defineEnumerableProperties(this, { + "url": { + value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url] + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 } + ], + requiredArguments: [], + supportedOptions: [], + onSucceeded: function (filePropertiesDescriptor, caller, callArgs) { + return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor); + } +}); + +Microsoft.Office.WebExtension.GoToType={ + Binding: "binding", + NamedItem: "namedItem", + Slide: "slide", + Index: "index" +}; + +Microsoft.Office.WebExtension.SelectionMode={ + Default: "default", + Selected: "selected", + None: "none" +}; + +Microsoft.Office.WebExtension.Index={ + First: "first", + Last: "last", + Next: "next", + Previous: "previous" +}; +OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" }); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GoToByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string", "number"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.GoToType, + "enum": Microsoft.Office.WebExtension.GoToType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.SelectionMode, + value: { + "enum": Microsoft.Office.WebExtension.SelectionMode, + "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.GoToType, + toHost: [ + { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 }, + { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 }, + { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 }, + { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.SelectionMode, + toHost: [ + { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 }, + { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 }, + { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidNavigateToMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileProperties.FileSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: Microsoft.Office.WebExtension.FileType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.FileType.Compressed, value: 5 }, + { name: Microsoft.Office.WebExtension.FileType.Pdf, value: 6 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod, + toHost: [{ name: Microsoft.Office.WebExtension.Parameters.FileType, value: 0 }], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0 }] +}); +OSF.DDA.AsyncMethodNames.addNames({ + GetSelectedDataAsync: "getSelectedDataAsync", + SetSelectedDataAsync: "setSelectedDataAsync" +}); + +(function () { + function processData(dataDescriptor, caller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) { + data=OSF.DDA.OMFactory.manufactureTableData(data); + } + data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data==undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.CoercionType, + "enum": Microsoft.Office.WebExtension.CoercionType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + } + ], + privateStateCallbacks: [], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageLeft, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageTop, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageWidth, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ImageHeight, + value: { + "types": ["number", "boolean"], + "defaultValue": false + } + } + ], + privateStateCallbacks: [] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 }, + { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 } + ] +}); +OSF.DDA.SettingsManager={ + SerializedSettings: "serializedSettings", + DateJSONPrefix: "Date(", + DataJSONSuffix: ")", + serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) { + var ret={}; + for (var key in settingsCollection) { + var value=settingsCollection[key]; + try { + if (JSON) { + value=JSON.stringify(value, function dateReplacer(k, v) { + return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v; + }); + } else { + value=Sys.Serialization.JavaScriptSerializer.serialize(value); + } + ret[key]=value; + } catch (ex) { + } + } + return ret; + }, + deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) { + var ret={}; + serializedSettings=serializedSettings || {}; + for (var key in serializedSettings) { + var value=serializedSettings[key]; + try { + if (JSON) { + value=JSON.parse(value, function dateReviver(k, v) { + var d; + if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) { + d=new Date(parseInt(v.slice(5, -1))); + if (d) { + return d; + } + } + return v; + }); + } else { + value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true); + } + ret[key]=value; + } catch (ex) { + } + } + return ret; + } +}; + +OSF.DDA.Settings=function OSF_DDA_Settings(settings) { + settings=settings || {}; + + var cacheSessionSettings=function (settings) { + var osfSessionStorage=OSF.OUtil.getSessionStorage(); + if (osfSessionStorage) { + var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings); + var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings); + osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings); + } + }; + OSF.OUtil.defineEnumerableProperties(this, { + "get": { + value: function OSF_DDA_Settings$get(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + var setting=settings[name]; + return typeof (setting)==='undefined' ? null : setting; + } + }, + "set": { + value: function OSF_DDA_Settings$set(name, value) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false }, + { name: "value", mayBeNull: true } + ]); + if (e) + throw e; + settings[name]=value; + cacheSessionSettings(settings); + } + }, + "remove": { + value: function OSF_DDA_Settings$remove(name) { + var e=Function._validateParams(arguments, [ + { name: "name", type: String, mayBeNull: false } + ]); + if (e) + throw e; + delete settings[name]; + cacheSessionSettings(settings); + } + } + }); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings); +}; + +OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) { + OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings); + OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged])); +}; + +OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings); +Microsoft.Office.WebExtension.EventType={}; + +OSF.EventDispatch=function OSF_EventDispatch(eventTypes) { + this._eventHandlers={}; + for (var entry in eventTypes) { + var eventType=eventTypes[entry]; + this._eventHandlers[eventType]=[]; + } +}; +OSF.EventDispatch.prototype={ + getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() { + var events=[]; + for (var eventName in this._eventHandlers) + events.push(eventName); + return events; + }, + supportsEvent: function OSF_EventDispatch$supportsEvent(event) { + var isSupported=false; + for (var eventName in this._eventHandlers) { + if (event==eventName) { + isSupported=true; + break; + } + } + return isSupported; + }, + hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var h in handlers) { + if (handlers[h]===handler) + return true; + } + } + return false; + }, + addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) { + if (typeof handler !="function") { + return false; + } + var handlers=this._eventHandlers[eventType]; + if (handlers && !this.hasEventHandler(eventType, handler)) { + handlers.push(handler); + return true; + } else { + return false; + } + }, + removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) { + var handlers=this._eventHandlers[eventType]; + if (handlers && handlers.length > 0) { + for (var index=0; index < handlers.length; index++) { + if (handlers[index]===handler) { + handlers.splice(index, 1); + return true; + } + } + } + return false; + }, + clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) { + if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) { + this._eventHandlers[eventType]=[]; + return true; + } + return false; + }, + getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) { + return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1; + }, + fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) { + if (eventArgs.type==undefined) + return false; + var eventType=eventArgs.type; + if (eventType && this._eventHandlers[eventType]) { + var eventHandlers=this._eventHandlers[eventType]; + for (var handler in eventHandlers) + eventHandlers[handler](eventArgs); + return true; + } else { + return false; + } + } +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) { + var args; + switch (eventType) { + case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged: + args=new OSF.DDA.DocumentSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged: + args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]); + break; + case Microsoft.Office.WebExtension.EventType.BindingDataChanged: + args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document)); + break; + case Microsoft.Office.WebExtension.EventType.SettingsChanged: + args=new OSF.DDA.SettingsChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ActiveViewChanged: + args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged: + args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged: + args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties); + break; + case Microsoft.Office.WebExtension.EventType.AppCommandInvoked: + args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties); + break; + + case Microsoft.Office.WebExtension.EventType.DataNodeInserted: + args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeReplaced: + args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + case Microsoft.Office.WebExtension.EventType.DataNodeDeleted: + args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]); + break; + + case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged: + args=new OSF.DDA.TaskSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged: + args=new OSF.DDA.ResourceSelectionChangedEventArgs(target); + break; + case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged: + args=new OSF.DDA.ViewSelectionChangedEventArgs(target); + break; + default: + throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType)); + } + return args; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddHandlerAsync: "addHandlerAsync", + RemoveHandlerAsync: "removeHandlerAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Handler, + "types": ["function"] + } + ], + supportedOptions: [], + privateStateCallbacks: [] +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.EventType, + "enum": Microsoft.Office.WebExtension.EventType, + "verify": function (eventType, caller, eventDispatch) { + return eventDispatch.supportsEvent(eventType); + } + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Handler, + value: { + "types": ["function", "object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + SettingsChanged: "settingsChanged" +}); +OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.SettingsChanged + }, + "settings": { + value: settingsInstance + } + }); +}; +OSF.DDA.AsyncMethodNames.addNames({ + RefreshAsync: "refreshAsync", + SaveAsync: "saveAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.RefreshAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) { + var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings]; + var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings); + return newSettings; + } +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SaveAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, + value: { + "types": ["boolean"], + "defaultValue": true + } + } + ], + privateStateCallbacks: [ + { + name: OSF.DDA.SettingsManager.SerializedSettings, + value: function serializeSettings(settingsInstance, settingsCollection) { + return OSF.DDA.SettingsManager.serializeSettings(settingsCollection); + } + } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent }); + +Microsoft.Office.WebExtension.BindingType={ + Table: "table", + Text: "text", + Matrix: "matrix" +}; +OSF.DDA.BindingProperties={ + Id: "BindingId", + Type: Microsoft.Office.WebExtension.Parameters.BindingType +}; +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" }); +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + Subset: "subset", + BindingProperties: "BindingProperties" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties); + +OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) { + this._id=bindingId; + OSF.OUtil.defineEnumerableProperty(this, "onFail", { + get: function () { + return errorCallback; + }, + set: function (onError) { + var t=typeof onError; + if (t !="undefined" && t !="function") { + throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t); + } + errorCallback=onError; + } + }); +}; +OSF.DDA.BindingPromise.prototype={ + _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) { + if (this.binding) { + if (onComplete) + onComplete(this.binding); + } else { + if (!this._binding) { + var me=this; + Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) { + if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) { + OSF.OUtil.defineEnumerableProperty(me, "binding", { + value: asyncResult.value + }); + if (onComplete) + onComplete(me.binding); + } else { + if (me.onFail) + me.onFail(asyncResult); + } + }); + } + } + return this; + }, + getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.getDataAsync.apply(binding, args); + }); + return this; + }, + setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.setDataAsync.apply(binding, args); + }); + return this; + }, + addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.addHandlerAsync.apply(binding, args); + }); + return this; + }, + removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() { + var args=arguments; + this._fetch(function onComplete(binding) { + binding.removeHandlerAsync.apply(binding, args); + }); + return this; + } +}; + +OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) { + this._eventDispatches=[]; + + OSF.OUtil.defineEnumerableProperty(this, "document", { + value: docInstance + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddFromSelectionAsync, + am.AddFromNamedItemAsync, + am.GetAllAsync, + am.GetByIdAsync, + am.ReleaseByIdAsync + ]); +}; + +OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { value: docInstance }, + "id": { value: id } + }); +}; + +OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "document": { + value: docInstance + }, + "id": { + value: id + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetDataAsync, + am.SetDataAsync + ]); + + var et=Microsoft.Office.WebExtension.EventType; + var bindingEventDispatches=docInstance.bindings._eventDispatches; + if (!bindingEventDispatches[id]) { + bindingEventDispatches[id]=new OSF.EventDispatch([ + et.BindingSelectionChanged, + et.BindingDataChanged + ]); + } + var eventDispatch=bindingEventDispatches[id]; + + OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch); +}; +OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() { + return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime(); +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) { + var id=bindingProperties[OSF.DDA.BindingProperties.Id]; + var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount]; + var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount]; + var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders]; + var binding; + switch (bindingProperties[OSF.DDA.BindingProperties.Type]) { + case Microsoft.Office.WebExtension.BindingType.Text: + binding=new OSF.DDA.TextBinding(id, containingDocument); + break; + case Microsoft.Office.WebExtension.BindingType.Matrix: + binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols); + break; + case Microsoft.Office.WebExtension.BindingType.Table: + var isExcelApp=function () { + return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument); + }; + var tableBindingObject; + if (isExcelApp() && OSF.DDA.ExcelTableBinding) { + tableBindingObject=OSF.DDA.ExcelTableBinding; + } else { + tableBindingObject=OSF.DDA.TableBinding; + } + binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders); + break; + default: + binding=new OSF.DDA.UnknownBinding(id, containingDocument); + } + return binding; +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddFromSelectionAsync: "addFromSelectionAsync", + AddFromNamedItemAsync: "addFromNamedItemAsync", + GetAllAsync: "getAllAsync", + GetByIdAsync: "getByIdAsync", + ReleaseByIdAsync: "releaseByIdAsync", + GetDataAsync: "getDataAsync", + SetDataAsync: "setDataAsync" +}); + +(function () { + function processBinding(bindingDescriptor) { + return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); + } + function getObjectId(obj) { + return obj.id; + } + + function processData(dataDescriptor, caller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + + if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) { + data=OSF.DDA.OMFactory.manufactureTableData(data); + } + data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]); + return data==undefined ? null : data; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.ItemName, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.BindingType, + "enum": Microsoft.Office.WebExtension.BindingType + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: { + "types": ["string"], + "calculate": OSF.DDA.generateBindingId + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + } + ], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, + value: function () { + return true; + } + } + ], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetAllAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processBinding + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response, caller, callArgs) { + var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id]; + delete caller._eventDispatches[id]; + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataAsync, + requiredArguments: [], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs, binding) { + return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ValueFormat, + value: { + "enum": Microsoft.Office.WebExtension.ValueFormat, + "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.FilterType, + value: { + "enum": Microsoft.Office.WebExtension.FilterType, + "defaultValue": Microsoft.Office.WebExtension.FilterType.All + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.RowCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.ColumnCount, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetDataAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string", "object", "number", "boolean"] + } + ], + supportedOptions: [ + { + name: Microsoft.Office.WebExtension.Parameters.CoercionType, + value: { + "enum": Microsoft.Office.WebExtension.CoercionType, + "calculate": function (requiredArgs) { + return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); + } + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Rows, + value: { + "types": ["object", "string"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.Columns, + value: { + "types": ["object"], + "defaultValue": null + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartRow, + value: { + "types": ["number"], + "defaultValue": 0 + } + }, + { + name: Microsoft.Office.WebExtension.Parameters.StartColumn, + value: { + "types": ["number"], + "defaultValue": 0 + } + } + ], + checkCallArgs: function (callArgs, caller, stateInfo) { + if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) { + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]; + delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]; + } + if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding; + } + return callArgs; + }, + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); + +OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) { + OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Matrix + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + } + }); +}; +OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: OSF.DDA.BindingProperties.Id, value: 0 }, + { name: OSF.DDA.BindingProperties.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 } + ], + invertible: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 }, + { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: OSF.DDA.BindingProperties.RowCount, value: 0 }, + { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 }, + { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 } + ], + canonical: true, + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddColumnsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) { + function fixData(data) { + if (data==null || data==undefined) { + return null; + } + try { + for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) { + data=[data]; + } + return data; + } catch (ex) { + } + } + ; + OSF.OUtil.defineEnumerableProperties(this, { + "headers": { + get: function () { + return headers; + }, + set: function (value) { + headers=fixData(value); + } + }, + "rows": { + get: function () { + return rows; + }, + set: function (value) { + rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ? [] : fixData(value); + } + } + }); + this.headers=headers; + this.rows=rows; +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) { + return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]); +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" }); +OSF.OUtil.augmentList(OSF.DDA.BindingProperties, { + RowCount: "BindingRowCount", + ColumnCount: "BindingColumnCount", + HasHeaders: "HasHeaders" +}); +OSF.DDA.TableDataProperties={ + TableRows: "TableRows", + TableHeaders: "TableHeaders" +}; + +OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) { + OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.BindingType.Table + }, + "rowCount": { + value: rows ? rows : 0 + }, + "columnCount": { + value: cols ? cols : 0 + }, + "hasHeaders": { + value: hasHeaders ? hasHeaders : false + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddRowsAsync, + am.AddColumnsAsync, + am.DeleteAllDataValuesAsync + ]); +}; +OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding); +OSF.DDA.AsyncMethodNames.addNames({ + AddRowsAsync: "addRowsAsync", + AddColumnsAsync: "addColumnsAsync", + DeleteAllDataValuesAsync: "deleteAllDataValuesAsync" +}); + +(function () { + function getObjectId(obj) { + return obj.id; + } + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddRowsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddColumnsAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["object"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: Microsoft.Office.WebExtension.Parameters.Id, + value: getObjectId + } + ] + }); +})(); + +OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) { + OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance); + OSF.OUtil.defineEnumerableProperty(this, "type", { + value: Microsoft.Office.WebExtension.BindingType.Text + }); +}; +OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" }); +OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged + }, + "document": { + value: docInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent }); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + BindingSelectionChanged: "bindingSelectionChanged", + BindingDataChanged: "bindingDataChanged" +}); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" }); +OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged + }, + "binding": { + value: bindingInstance + } + }); + for (var prop in subset) { + OSF.OUtil.defineEnumerableProperty(this, prop, { + value: subset[prop] + }); + } +}; +OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.BindingDataChanged + }, + "binding": { + value: bindingInstance + } + }); +}; + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + +Microsoft.Office.WebExtension.CoercionType={ + Text: "text", + Matrix: "matrix", + Table: "table" +}; + +OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() { + return { + findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) { + if (OSF.OUtil.isArray(obj)) { + var dim=0; + for (var index=0; index < obj.length; index++) { + dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index])); + } + return dim+1; + } else { + return 0; + } + }, + getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) { + switch (bindingType) { + case Microsoft.Office.WebExtension.BindingType.Matrix: + return Microsoft.Office.WebExtension.CoercionType.Matrix; + case Microsoft.Office.WebExtension.BindingType.Table: + return Microsoft.Office.WebExtension.CoercionType.Table; + case Microsoft.Office.WebExtension.BindingType.Text: + default: + return Microsoft.Office.WebExtension.CoercionType.Text; + } + }, + getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) { + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Matrix: + return Microsoft.Office.WebExtension.BindingType.Matrix; + case Microsoft.Office.WebExtension.CoercionType.Table: + return Microsoft.Office.WebExtension.BindingType.Table; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + return Microsoft.Office.WebExtension.BindingType.Text; + } + }, + determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) { + if (data==null || data==undefined) + return null; + var sourceType=null; + var runtimeType=typeof data; + if (data.rows !==undefined) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Table; + } else if (OSF.OUtil.isArray(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix; + } else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) { + sourceType=Microsoft.Office.WebExtension.CoercionType.Text; + } else { + throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject; + } + return sourceType; + }, + coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) { + sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data); + if (sourceType && sourceType !=destinationType) { + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin); + data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType)); + OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd); + } + return data; + }, + _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) { + if (matrix.length==1 && matrix[0].length==1) + return ""+matrix[0][0]; + var val=""; + for (var i=0; i < matrix.length; i++) { + val+=matrix[i].join("\t")+"\n"; + } + return val.substring(0, val.length - 1); + }, + _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) { + var ret=text.split("\n"); + for (var i=0; i < ret.length; i++) + ret[i]=ret[i].split("\t"); + return ret; + }, + _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) { + var headers=""; + if (table.headers !=null) { + headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n"; + } + + var rows=OSF.DDA.DataCoercion._matrixToText(table.rows); + if (rows=="") { + headers=headers.substring(0, headers.length - 1); + } + return headers+rows; + }, + _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) { + var matrix=table.rows; + if (table.headers !=null) { + matrix.unshift(table.headers); + } + return matrix; + }, + _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) { + var value; + switch (coercionType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=table; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=OSF.DDA.DataCoercion._tableToMatrix(table); + break; + case Microsoft.Office.WebExtension.CoercionType.SlideRange: + value=null; + if (OSF.DDA.OMFactory.manufactureSlideRange) { + value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table)); + } + if (value==null) { + value=OSF.DDA.DataCoercion._tableToText(table); + } + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=OSF.DDA.DataCoercion._tableToText(table); + break; + } + return value; + }, + _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) { + if (sourceType==undefined) { + sourceType=OSF.DDA.DataCoercion.determineCoercionType(data); + } + var value; + switch (sourceType) { + case Microsoft.Office.WebExtension.CoercionType.Table: + value=data; + break; + case Microsoft.Office.WebExtension.CoercionType.Matrix: + value=new Microsoft.Office.WebExtension.TableData(data); + break; + case Microsoft.Office.WebExtension.CoercionType.Text: + case Microsoft.Office.WebExtension.CoercionType.Html: + case Microsoft.Office.WebExtension.CoercionType.Ooxml: + default: + value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data)); + break; + } + return value; + } + }; +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 }, + { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 }, + { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Html: "html" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Html, value: 3 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Ooxml: "ooxml" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.Ooxml, value: 4 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { OoxmlPackage: "ooxmlPackage" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.OoxmlPackage, value: 5 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { PdfFile: "pdf" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: Microsoft.Office.WebExtension.CoercionType.PdfFile, value: 6 } + ] +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" }); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }] +}); +OSF.DDA.DataPartProperties={ + Id: Microsoft.Office.WebExtension.Parameters.Id, + BuiltIn: "DataPartBuiltIn" +}; +OSF.DDA.DataNodeProperties={ + Handle: "DataNodeHandle", + BaseName: "DataNodeBaseName", + NamespaceUri: "DataNodeNamespaceUri", + NodeType: "DataNodeType" +}; +OSF.DDA.DataNodeEventProperties={ + OldNode: "OldNode", + NewNode: "NewNode", + NextSiblingNode: "NextSiblingNode", + InUndoRedo: "InUndoRedo" +}; +OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { + DataPartProperties: "DataPartProperties", + DataNodeProperties: "DataNodeProperties" +}); +OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { + DataPartList: "DataPartList", + DataNodeList: "DataNodeList" +}); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataPartList, OSF.DDA.PropertyDescriptors.DataPartProperties); +OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataNodeList, OSF.DDA.PropertyDescriptors.DataNodeProperties); +OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { + DataNodeInsertedEvent: "DataNodeInsertedEvent", + DataNodeReplacedEvent: "DataNodeReplacedEvent", + DataNodeDeletedEvent: "DataNodeDeletedEvent" +}); +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { + DataNodeDeleted: "nodeDeleted", + DataNodeInserted: "nodeInserted", + DataNodeReplaced: "nodeReplaced" +}); + +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() { + this._eventDispatches=[]; + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; + +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id]=dispatch; + } + + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; + +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], partId); +}; + +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], handle); +}; + +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.OMFactory=OSF.DDA.OMFactory || {}; +OSF.DDA.OMFactory.manufactureDataNode=function OSF_DDA_OMFactory$manufactureDataNode(nodeProperties) { + if (nodeProperties) { + return new OSF.DDA.CustomXmlNode(nodeProperties[OSF.DDA.DataNodeProperties.Handle], nodeProperties[OSF.DDA.DataNodeProperties.NodeType], nodeProperties[OSF.DDA.DataNodeProperties.NamespaceUri], nodeProperties[OSF.DDA.DataNodeProperties.BaseName]); + } +}; +OSF.DDA.OMFactory.manufactureDataPart=function OSF_DDA_OMFactory$manufactureDataPart(partProperties, containingCustomXmlParts) { + return new OSF.DDA.CustomXmlPart(containingCustomXmlParts, partProperties[OSF.DDA.DataPartProperties.Id], partProperties[OSF.DDA.DataPartProperties.BuiltIn]); +}; +OSF.DDA.AsyncMethodNames.addNames({ + AddDataPartAsync: "addAsync", + GetDataPartByIdAsync: "getByIdAsync", + GetDataPartsByNameSpaceAsync: "getByNamespaceAsync", + DeleteDataPartAsync: "deleteAsync", + GetPartNodesAsync: "getNodesAsync", + GetPartXmlAsync: "getXmlAsync", + AddDataPartNamespaceAsync: "addNamespaceAsync", + GetDataPartNamespaceAsync: "getNamespaceAsync", + GetDataPartPrefixAsync: "getPrefixAsync", + GetRelativeNodesAsync: "getNodesAsync", + GetNodeValueAsync: "getNodeValueAsync", + GetNodeXmlAsync: "getXmlAsync", + SetNodeValueAsync: "setNodeValueAsync", + SetNodeXmlAsync: "setXmlAsync" +}); + +(function () { + function processDataPart(dataPartDescriptor) { + return OSF.DDA.OMFactory.manufactureDataPart(dataPartDescriptor, Microsoft.Office.WebExtension.context.document.customXmlParts); + } + function processDataNode(dataNodeDescriptor) { + return OSF.DDA.OMFactory.manufactureDataNode(dataNodeDescriptor); + } + function processData(dataDescriptor, caller, callArgs) { + var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data]; + return data==undefined ? null : data; + } + function getObjectId(obj) { + return obj.id; + } + function getPartId(part, partId) { + return partId; + } + ; + function getNodeHandle(node, nodeHandle) { + return nodeHandle; + } + ; + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddDataPartAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processDataPart + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Id, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: processDataPart + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataPartList], processDataPart); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.DeleteDataPartAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetPartNodesAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetPartXmlAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getObjectId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + }, + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Prefix, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Namespace, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataPartProperties.Id, + value: getPartId + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.XPath, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: function (response) { + return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode); + } + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetNodeValueAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.GetNodeXmlAsync, + requiredArguments: [], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ], + onSucceeded: processData + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetNodeValueAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Data, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ] + }); + + OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.SetNodeXmlAsync, + requiredArguments: [ + { + "name": Microsoft.Office.WebExtension.Parameters.Xml, + "types": ["string"] + } + ], + supportedOptions: [], + privateStateCallbacks: [ + { + name: OSF.DDA.DataNodeProperties.Handle, + value: getNodeHandle + } + ] + }); +})(); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: OSF.DDA.DataPartProperties.BuiltIn, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: OSF.DDA.DataNodeProperties.BaseName, value: 1 }, + { name: OSF.DDA.DataNodeProperties.NamespaceUri, value: 2 }, + { name: OSF.DDA.DataNodeProperties.NodeType, value: 3 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 }, + { name: OSF.DDA.DataNodeEventProperties.NewNode, value: 1 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 }, + { name: OSF.DDA.DataNodeEventProperties.OldNode, value: 1 }, + { name: OSF.DDA.DataNodeEventProperties.NewNode, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 }, + { name: OSF.DDA.DataNodeEventProperties.OldNode, value: 1 }, + { name: OSF.DDA.DataNodeEventProperties.NextSiblingNode, value: 2 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.DataNodeEventProperties.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.DataNodeEventProperties.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.DataNodeEventProperties.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Xml, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartXmlMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.XPath, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidDeleteDataPartMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodeValueMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.XPath, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Xml, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: 1 }, + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 2 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 1 } + ] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.EventDispId.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }] +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, + fromHost: [ + { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 } + ], + isComplexType: true +}); + +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); +OSF.DDA.AsyncMethodNames.addNames({ + ExecuteRichApiRequestAsync: "executeRichApiRequestAsync" +}); + +OSF.DDA.AsyncMethodCalls.define({ + method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync, + requiredArguments: [ + { + name: Microsoft.Office.WebExtension.Parameters.Data, + types: ["object"] + } + ], + supportedOptions: [] +}); +OSF.OUtil.setNamespace("RichApi", OSF.DDA); +OSF.DDA.SafeArray.Delegate.ParameterMap.define({ + type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod, + toHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 } + ], + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self } + ] +}); + +OSF.DDA.WordDocument=function OSF_DDA_WordDocument(officeAppContext, settings) { + OSF.DDA.WordDocument.uber.constructor.call(this, officeAppContext, new OSF.DDA.BindingFacade(this), settings); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GoToByIdAsync, + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync, + OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync + ]); + OSF.OUtil.defineEnumerableProperty(this, "customXmlParts", { + value: new OSF.DDA.CustomXmlParts() + }); + OSF.OUtil.finalizeProperties(this); +}; + +OSF.OUtil.extend(OSF.DDA.WordDocument, OSF.DDA.JsomDocument); + +OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) { + OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM); + appContext.doc=new OSF.DDA.WordDocument(appContext, this._initializeSettings(false)); + OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]); + appReady(); +}; + +var OfficeExtension; +(function (OfficeExtension) { + var Action=(function () { + function Action(actionInfo, isWriteOperation) { + this.m_actionInfo=actionInfo; + this.m_isWriteOperation=isWriteOperation; + } + Object.defineProperty(Action.prototype, "actionInfo", { + get: function () { + return this.m_actionInfo; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Action.prototype, "isWriteOperation", { + get: function () { + return this.m_isWriteOperation; + }, + enumerable: true, + configurable: true + }); + return Action; + })(); + OfficeExtension.Action=Action; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ActionFactory=(function () { + function ActionFactory() { + } + ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 4 , + Name: propertyName, + ObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var args=[value]; + var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args); + OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths); + var ret=new OfficeExtension.Action(actionInfo, true); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths); + return ret; + }; + ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 3 , + Name: methodName, + ObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args); + OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths); + var isWriteOperation=operationType !=1 ; + var ret=new OfficeExtension.Action(actionInfo, isWriteOperation); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths); + return ret; + }; + ActionFactory.createQueryAction=function (context, parent, queryOption) { + OfficeExtension.Utility.validateObjectPath(parent); + var actionInfo={ + Id: context._nextId(), + ActionType: 2 , + Name: "", + ObjectPathId: parent._objectPath.objectPathInfo.Id, + }; + actionInfo.QueryInfo=queryOption; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(parent._objectPath); + return ret; + }; + ActionFactory.createInstantiateAction=function (context, obj) { + OfficeExtension.Utility.validateObjectPath(obj); + var actionInfo={ + Id: context._nextId(), + ActionType: 1 , + Name: "", + ObjectPathId: obj._objectPath.objectPathInfo.Id + }; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addReferencedObjectPath(obj._objectPath); + context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj)); + return ret; + }; + ActionFactory.createTraceAction=function (context, message) { + var actionInfo={ + Id: context._nextId(), + ActionType: 5 , + Name: "Trace", + ObjectPathId: 0 + }; + var ret=new OfficeExtension.Action(actionInfo, false); + context._pendingRequest.addAction(ret); + context._pendingRequest.addTrace(actionInfo.Id, message); + return ret; + }; + return ActionFactory; + })(); + OfficeExtension.ActionFactory=ActionFactory; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientObject=(function () { + function ClientObject(context, objectPath) { + OfficeExtension.Utility.checkArgumentNull(context, "context"); + this.m_context=context; + this.m_objectPath=objectPath; + if (this.m_objectPath) { + if (!context._processingResult) { + OfficeExtension.ActionFactory.createInstantiateAction(context, this); + if ((context._autoCleanup) && (this._KeepReference)) { + context.trackedObjects._autoAdd(this); + } + } + } + } + Object.defineProperty(ClientObject.prototype, "context", { + get: function () { + return this.m_context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientObject.prototype, "_objectPath", { + get: function () { + return this.m_objectPath; + }, + set: function (value) { + this.m_objectPath=value; + }, + enumerable: true, + configurable: true + }); + ClientObject.prototype._handleResult=function (value) { + }; + return ClientObject; + })(); + OfficeExtension.ClientObject=ClientObject; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientRequest=(function () { + function ClientRequest(context) { + this.m_context=context; + this.m_actions=[]; + this.m_actionResultHandler={}; + this.m_referencedObjectPaths={}; + this.m_flags=0 ; + this.m_traceInfos={}; + } + Object.defineProperty(ClientRequest.prototype, "flags", { + get: function () { + return this.m_flags; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientRequest.prototype, "traceInfos", { + get: function () { + return this.m_traceInfos; + }, + enumerable: true, + configurable: true + }); + ClientRequest.prototype.addAction=function (action) { + if (action.isWriteOperation) { + this.m_flags=this.m_flags | 1 ; + } + this.m_actions.push(action); + }; + Object.defineProperty(ClientRequest.prototype, "hasActions", { + get: function () { + return this.m_actions.length > 0; + }, + enumerable: true, + configurable: true + }); + ClientRequest.prototype.addTrace=function (actionId, message) { + this.m_traceInfos[actionId]=message; + }; + ClientRequest.prototype.addReferencedObjectPath=function (objectPath) { + if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) { + return; + } + if (!objectPath.isValid) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath)); + } + while (objectPath) { + if (objectPath.isWriteOperation) { + this.m_flags=this.m_flags | 1 ; + } + this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath; + if (objectPath.objectPathInfo.ObjectPathType==3 ) { + this.addReferencedObjectPaths(objectPath.argumentObjectPaths); + } + objectPath=objectPath.parentObjectPath; + } + }; + ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) { + if (objectPaths) { + for (var i=0; i < objectPaths.length; i++) { + this.addReferencedObjectPath(objectPaths[i]); + } + } + }; + ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) { + this.m_actionResultHandler[action.actionInfo.Id]=resultHandler; + }; + ClientRequest.prototype.buildRequestMessageBody=function () { + var objectPaths={}; + for (var i in this.m_referencedObjectPaths) { + objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo; + } + var actions=[]; + for (var index=0; index < this.m_actions.length; index++) { + actions.push(this.m_actions[index].actionInfo); + } + var ret={ + Actions: actions, + ObjectPaths: objectPaths + }; + return ret; + }; + ClientRequest.prototype.processResponse=function (msg) { + if (msg && msg.Results) { + for (var i=0; i < msg.Results.length; i++) { + var actionResult=msg.Results[i]; + var handler=this.m_actionResultHandler[actionResult.ActionId]; + if (handler) { + handler._handleResult(actionResult.Value); + } + } + } + }; + ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () { + for (var i in this.m_referencedObjectPaths) { + if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) { + this.m_referencedObjectPaths[i].isValid=false; + } + } + }; + return ClientRequest; + })(); + OfficeExtension.ClientRequest=ClientRequest; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientRequestContext=(function () { + function ClientRequestContext(url) { + this.m_nextId=0; + this.m_url=url; + if (OfficeExtension.Utility.isNullOrEmptyString(this.m_url)) { + this.m_url=OfficeExtension.Constants.localDocument; + } + this._processingResult=false; + this._customData=OfficeExtension.Constants.iterativeExecutor; + this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor(); + this.sync=this.sync.bind(this); + } + Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", { + get: function () { + if (this.m_pendingRequest==null) { + this.m_pendingRequest=new OfficeExtension.ClientRequest(this); + } + return this.m_pendingRequest; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", { + get: function () { + if (!this.m_trackedObjects) { + this.m_trackedObjects=new OfficeExtension.TrackedObjects(this); + } + return this.m_trackedObjects; + }, + enumerable: true, + configurable: true + }); + ClientRequestContext.prototype.load=function (clientObj, option) { + OfficeExtension.Utility.validateContext(this, clientObj); + var queryOption={}; + if (typeof (option)=="string") { + var select=option; + queryOption.Select=this.parseSelectExpand(select); + } + else if (Array.isArray(option)) { + queryOption.Select=option; + } + else if (typeof (option)=="object") { + var loadOption=option; + if (typeof (loadOption.select)=="string") { + queryOption.Select=this.parseSelectExpand(loadOption.select); + } + else if (Array.isArray(loadOption.select)) { + queryOption.Select=loadOption.select; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select"); + } + if (typeof (loadOption.expand)=="string") { + queryOption.Expand=this.parseSelectExpand(loadOption.expand); + } + else if (Array.isArray(loadOption.expand)) { + queryOption.Expand=loadOption.expand; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand"); + } + if (typeof (loadOption.top)=="number") { + queryOption.Top=loadOption.top; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top"); + } + if (typeof (loadOption.skip)=="number") { + queryOption.Skip=loadOption.skip; + } + else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip"); + } + } + else if (!OfficeExtension.Utility.isNullOrUndefined(option)) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option"); + } + var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption); + this._pendingRequest.addActionResultHandler(action, clientObj); + }; + ClientRequestContext.prototype.trace=function (message) { + OfficeExtension.ActionFactory.createTraceAction(this, message); + }; + ClientRequestContext.prototype.parseSelectExpand=function (select) { + var args=[]; + if (!OfficeExtension.Utility.isNullOrEmptyString(select)) { + var propertyNames=select.split(","); + for (var i=0; i < propertyNames.length; i++) { + var propertyName=propertyNames[i]; + propertyName=propertyName.trim(); + args.push(propertyName); + } + } + return args; + }; + ClientRequestContext.prototype.syncPrivate=function (doneCallback, failCallback) { + var req=this._pendingRequest; + if (!req.hasActions) { + doneCallback(); + return; + } + this.m_pendingRequest=null; + var msgBody=req.buildRequestMessageBody(); + var requestFlags=req.flags; + var requestExecutor=this._requestExecutor; + if (!requestExecutor) { + requestExecutor=new OfficeExtension.OfficeJsRequestExecutor(); + } + var requestExecutorRequestMessage={ + Url: this.m_url, + Headers: null, + Body: msgBody + }; + req.invalidatePendingInvalidObjectPaths(); + var thisObj=this; + requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage, function (response) { + var error; + var traceMessages=new Array(); + if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) { + error=new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {}); + } + else if (response.Body && response.Body.Error) { + error=new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, { + errorLocation: response.Body.Error.Location + }); + } + if (response.Body && response.Body.TraceIds) { + var traceMessageMap=req.traceInfos; + for (var i=0; i < response.Body.TraceIds.length; i++) { + var traceId=response.Body.TraceIds[i]; + var message=traceMessageMap[traceId]; + traceMessages.push(message); + } + } + if (error) { + failCallback(error); + return; + } + else { + thisObj._processingResult=true; + try { + req.processResponse(response.Body); + } + finally { + thisObj._processingResult=false; + } + doneCallback(); + return; + } + }); + }; + ClientRequestContext.prototype.sync=function (passThroughValue) { + var _this=this; + OfficeExtension._EnsurePromise(); + return new OfficeExtension['Promise'](function (resolve, reject) { + _this.syncPrivate(function () { + resolve(passThroughValue); + }, function (error) { + reject(error); + }); + }); + }; + ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) { + if (numCleanupAttempts===void 0) { numCleanupAttempts=3; } + if (retryDelay===void 0) { retryDelay=5000; } + OfficeExtension._EnsurePromise(); + var starterPromise=new OfficeExtension['Promise'](function (resolve, reject) { + resolve(); + }); + var ctx; + var succeeded=false; + var resultOrError; + return starterPromise.then(function () { + ctx=ctxInitializer(); + ctx._autoCleanup=true; + var batchResult=batch(ctx); + if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise); + } + return batchResult; + }).then(function (batchResult) { + return ctx.sync(batchResult); + }).then(function (result) { + succeeded=true; + resultOrError=result; + }).catch(function (error) { + resultOrError=error; + }).then(function () { + var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList(); + ctx._autoCleanup=false; + for (var key in itemsToRemove) { + itemsToRemove[key]._objectPath.isValid=false; + } + var cleanupCounter=0; + attemptCleanup(); + function attemptCleanup() { + cleanupCounter++; + for (var key in itemsToRemove) { + ctx.trackedObjects.remove(itemsToRemove[key]); + } + ctx.sync().then(function () { + if (onCleanupSuccess) { + onCleanupSuccess(cleanupCounter); + } + }).catch(function () { + if (onCleanupFailure) { + onCleanupFailure(cleanupCounter); + } + if (cleanupCounter < numCleanupAttempts) { + setTimeout(function () { + attemptCleanup(); + }, retryDelay); + } + }); + } + }).then(function () { + if (succeeded) { + return resultOrError; + } + else { + throw resultOrError; + } + }); + }; + ClientRequestContext.prototype._nextId=function () { + return++this.m_nextId; + }; + return ClientRequestContext; + })(); + OfficeExtension.ClientRequestContext=ClientRequestContext; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (ClientRequestFlags) { + ClientRequestFlags[ClientRequestFlags["None"]=0]="None"; + ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation"; + })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={})); + var ClientRequestFlags=OfficeExtension.ClientRequestFlags; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ClientResult=(function () { + function ClientResult() { + } + Object.defineProperty(ClientResult.prototype, "value", { + get: function () { + return this.m_value; + }, + enumerable: true, + configurable: true + }); + ClientResult.prototype._handleResult=function (value) { + this.m_value=value; + }; + return ClientResult; + })(); + OfficeExtension.ClientResult=ClientResult; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var Constants=(function () { + function Constants() { + } + Constants.getItemAt="GetItemAt"; + Constants.id="Id"; + Constants.idPrivate="_Id"; + Constants.index="_Index"; + Constants.items="_Items"; + Constants.iterativeExecutor="IterativeExecutor"; + Constants.localDocument="http://document.localhost/"; + Constants.localDocumentApiPrefix="http://document.localhost/_api/"; + Constants.referenceId="_ReferenceId"; + return Constants; + })(); + OfficeExtension.Constants=Constants; +})(OfficeExtension || (OfficeExtension={})); +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var OfficeExtension; +(function (OfficeExtension) { + var _Internal; + (function (_Internal) { + var RuntimeError=(function (_super) { + __extends(RuntimeError, _super); + function RuntimeError(code, message, traceMessages, debugInfo) { + _super.call(this, message); + this.name="OfficeExtension.Error"; + this.code=code; + this.message=message; + this.traceMessages=traceMessages; + this.debugInfo=debugInfo; + } + RuntimeError.prototype.toString=function () { + return this.code+': '+this.message; + }; + return RuntimeError; + })(Error); + _Internal.RuntimeError=RuntimeError; + })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={})); + OfficeExtension.Error=OfficeExtension._Internal.RuntimeError; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ErrorCodes=(function () { + function ErrorCodes() { + } + ErrorCodes.accessDenied="AccessDenied"; + ErrorCodes.generalException="GeneralException"; + ErrorCodes.activityLimitReached="ActivityLimitReached"; + return ErrorCodes; + })(); + OfficeExtension.ErrorCodes=ErrorCodes; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var InstantiateActionResultHandler=(function () { + function InstantiateActionResultHandler(clientObject) { + this.m_clientObject=clientObject; + } + InstantiateActionResultHandler.prototype._handleResult=function (value) { + OfficeExtension.Utility.fixObjectPathIfNecessary(this.m_clientObject, value); + if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this.m_clientObject._initReferenceId) { + this.m_clientObject._initReferenceId(value[OfficeExtension.Constants.referenceId]); + } + }; + return InstantiateActionResultHandler; + })(); + OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (RichApiRequestMessageIndex) { + RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission"; + RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags"; + })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={})); + var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex; + (function (RichApiResponseMessageIndex) { + RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode"; + RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers"; + RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body"; + })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={})); + var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex; + ; + (function (ActionType) { + ActionType[ActionType["Instantiate"]=1]="Instantiate"; + ActionType[ActionType["Query"]=2]="Query"; + ActionType[ActionType["Method"]=3]="Method"; + ActionType[ActionType["SetProperty"]=4]="SetProperty"; + ActionType[ActionType["Trace"]=5]="Trace"; + })(OfficeExtension.ActionType || (OfficeExtension.ActionType={})); + var ActionType=OfficeExtension.ActionType; + (function (ObjectPathType) { + ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject"; + ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject"; + ObjectPathType[ObjectPathType["Method"]=3]="Method"; + ObjectPathType[ObjectPathType["Property"]=4]="Property"; + ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer"; + ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId"; + })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={})); + var ObjectPathType=OfficeExtension.ObjectPathType; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ObjectPath=(function () { + function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) { + this.m_objectPathInfo=objectPathInfo; + this.m_parentObjectPath=parentObjectPath; + this.m_isWriteOperation=false; + this.m_isCollection=isCollection; + this.m_isInvalidAfterRequest=isInvalidAfterRequest; + this.m_isValid=true; + } + Object.defineProperty(ObjectPath.prototype, "objectPathInfo", { + get: function () { + return this.m_objectPathInfo; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isWriteOperation", { + get: function () { + return this.m_isWriteOperation; + }, + set: function (value) { + this.m_isWriteOperation=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isCollection", { + get: function () { + return this.m_isCollection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", { + get: function () { + return this.m_isInvalidAfterRequest; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "parentObjectPath", { + get: function () { + return this.m_parentObjectPath; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", { + get: function () { + return this.m_argumentObjectPaths; + }, + set: function (value) { + this.m_argumentObjectPaths=value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObjectPath.prototype, "isValid", { + get: function () { + return this.m_isValid; + }, + set: function (value) { + this.m_isValid=value; + }, + enumerable: true, + configurable: true + }); + ObjectPath.prototype.updateUsingObjectData=function (value) { + var referenceId=value[OfficeExtension.Constants.referenceId]; + if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) { + this.m_isInvalidAfterRequest=false; + this.m_isValid=true; + this.m_objectPathInfo.ObjectPathType=6 ; + this.m_objectPathInfo.Name=referenceId; + this.m_objectPathInfo.ArgumentInfo={}; + this.m_parentObjectPath=null; + this.m_argumentObjectPaths=null; + return; + } + if (this.parentObjectPath && this.parentObjectPath.isCollection) { + var id=value[OfficeExtension.Constants.id]; + if (OfficeExtension.Utility.isNullOrUndefined(id)) { + id=value[OfficeExtension.Constants.idPrivate]; + } + if (!OfficeExtension.Utility.isNullOrUndefined(id)) { + this.m_isInvalidAfterRequest=false; + this.m_isValid=true; + this.m_objectPathInfo.ObjectPathType=5 ; + this.m_objectPathInfo.Name=""; + this.m_objectPathInfo.ArgumentInfo={}; + this.m_objectPathInfo.ArgumentInfo.Arguments=[id]; + this.m_argumentObjectPaths=null; + return; + } + } + }; + return ObjectPath; + })(); + OfficeExtension.ObjectPath=ObjectPath; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ObjectPathFactory=(function () { + function ObjectPathFactory() { + } + ObjectPathFactory.createGlobalObjectObjectPath=function (context) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false); + }; + ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false); + }; + ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 4 , + Name: propertyName, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + }; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest); + }; + ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=args; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parentObjectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=args; + return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false); + }; + ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest) { + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 3 , + Name: methodName, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args); + var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest); + ret.argumentObjectPaths=argumentObjectPaths; + ret.isWriteOperation=(operationType !=1 ); + return ret; + }; + ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) { + var id=childItem[OfficeExtension.Constants.id]; + if (OfficeExtension.Utility.isNullOrUndefined(id)) { + id=childItem[OfficeExtension.Constants.idPrivate]; + } + var objectPathInfo=objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 5 , + Name: "", + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=[id]; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) { + var indexFromServer=childItem[OfficeExtension.Constants.index]; + if (indexFromServer) { + index=indexFromServer; + } + var objectPathInfo={ + Id: context._nextId(), + ObjectPathType: 3 , + Name: OfficeExtension.Constants.getItemAt, + ParentObjectPathId: parent._objectPath.objectPathInfo.Id, + ArgumentInfo: {} + }; + objectPathInfo.ArgumentInfo.Arguments=[index]; + return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false); + }; + ObjectPathFactory.createReferenceIdObjectPath=function (context, referenceId) { + var objectPathInfo={ Id: context._nextId(), ObjectPathType: 6 , Name: referenceId }; + return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false); + }; + return ObjectPathFactory; + })(); + OfficeExtension.ObjectPathFactory=ObjectPathFactory; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var OfficeJsRequestExecutor=(function () { + function OfficeJsRequestExecutor() { + } + OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage, callback) { + var requestMessageText=JSON.stringify(requestMessage.Body); + OfficeExtension.Utility.log("Request:"); + OfficeExtension.Utility.log(requestMessageText); + var messageSafearray=OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", null, requestMessageText); + OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) { + OfficeExtension.Utility.log("Response:"); + OfficeExtension.Utility.log(JSON.stringify(result)); + var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null }; + if (result.status=="succeeded") { + var bodyText=OfficeExtension.RichApiMessageUtility.getResponseBody(result); + response.Body=JSON.parse(bodyText); + response.Headers=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result); + callback(response); + } + else { + response.ErrorCode=OfficeExtension.ErrorCodes.generalException; + if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability) { + response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied; + } + else if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached) { + response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached; + } + response.ErrorMessage=result.error.message; + callback(response); + } + }); + }; + OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability=7000; + OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached=5102; + return OfficeJsRequestExecutor; + })(); + OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var OfficeXHRSettings=(function () { + function OfficeXHRSettings() { + } + return OfficeXHRSettings; + })(); + OfficeExtension.OfficeXHRSettings=OfficeXHRSettings; + function resetXHRFactory(oldFactory) { + OfficeXHR.settings.oldxhr=oldFactory; + return officeXHRFactory; + } + OfficeExtension.resetXHRFactory=resetXHRFactory; + function officeXHRFactory() { + return new OfficeXHR; + } + OfficeExtension.officeXHRFactory=officeXHRFactory; + var OfficeXHR=(function () { + function OfficeXHR() { + } + OfficeXHR.prototype.open=function (method, url) { + this.m_method=method; + this.m_url=url; + if (this.m_url.toLowerCase().indexOf(OfficeExtension.Constants.localDocumentApiPrefix)==0) { + this.m_url=this.m_url.substr(OfficeExtension.Constants.localDocumentApiPrefix.length); + } + else { + this.m_innerXhr=OfficeXHR.settings.oldxhr(); + var thisObj=this; + this.m_innerXhr.onreadystatechange=function () { + thisObj.innerXhrOnreadystatechage(); + }; + this.m_innerXhr.open(method, this.m_url); + } + }; + OfficeXHR.prototype.abort=function () { + if (this.m_innerXhr) { + this.m_innerXhr.abort(); + } + }; + OfficeXHR.prototype.send=function (body) { + if (this.m_innerXhr) { + this.m_innerXhr.send(body); + } + else { + var thisObj=this; + var requestFlags=0 ; + if (!OfficeExtension.Utility.isReadonlyRestRequest(this.m_method)) { + requestFlags=1 ; + } + var execFunction=OfficeXHR.settings.executeRichApiRequestAsync; + if (!execFunction) { + execFunction=OSF.DDA.RichApi.executeRichApiRequestAsync; + } + execFunction(OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray('', requestFlags, this.m_method, this.m_url, this.m_requestHeaders, body), function (asyncResult) { + thisObj.officeContextRequestCallback(asyncResult); + }); + } + }; + OfficeXHR.prototype.setRequestHeader=function (header, value) { + if (this.m_innerXhr) { + this.m_innerXhr.setRequestHeader(header, value); + } + else { + if (!this.m_requestHeaders) { + this.m_requestHeaders={}; + } + this.m_requestHeaders[header]=value; + } + }; + OfficeXHR.prototype.getResponseHeader=function (header) { + if (this.m_responseHeaders) { + return this.m_responseHeaders[header.toUpperCase()]; + } + return null; + }; + OfficeXHR.prototype.getAllResponseHeaders=function () { + return this.m_allResponseHeaders; + }; + OfficeXHR.prototype.overrideMimeType=function (mimeType) { + if (this.m_innerXhr) { + this.m_innerXhr.overrideMimeType(mimeType); + } + }; + OfficeXHR.prototype.innerXhrOnreadystatechage=function () { + this.readyState=this.m_innerXhr.readyState; + if (this.readyState==OfficeXHR.DONE) { + this.status=this.m_innerXhr.status; + this.statusText=this.m_innerXhr.statusText; + this.responseText=this.m_innerXhr.responseText; + this.response=this.m_innerXhr.response; + this.responseType=this.m_innerXhr.responseType; + this.setAllResponseHeaders(this.m_innerXhr.getAllResponseHeaders()); + } + if (this.onreadystatechange) { + this.onreadystatechange(); + } + }; + OfficeXHR.prototype.officeContextRequestCallback=function (result) { + this.readyState=OfficeXHR.DONE; + if (result.status=="succeeded") { + this.status=OfficeExtension.RichApiMessageUtility.getResponseStatusCode(result); + this.m_responseHeaders=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result); + console.debug("ResponseHeaders="+JSON.stringify(this.m_responseHeaders)); + this.responseText=OfficeExtension.RichApiMessageUtility.getResponseBody(result); + console.debug("ResponseText="+this.responseText); + this.response=this.responseText; + } + else { + this.status=500; + this.statusText="Internal Error"; + } + if (this.onreadystatechange) { + this.onreadystatechange(); + } + }; + OfficeXHR.prototype.setAllResponseHeaders=function (allResponseHeaders) { + this.m_allResponseHeaders=allResponseHeaders; + this.m_responseHeaders={}; + if (this.m_allResponseHeaders !=null) { + var regex=new RegExp("\r?\n"); + var entries=this.m_allResponseHeaders.split(regex); + for (var i=0; i < entries.length; i++) { + var entry=entries[i]; + if (entry !=null) { + var index=entry.indexOf(':'); + if (index > 0) { + var key=entry.substr(0, index); + var value=entry.substr(index+1); + key=OfficeExtension.Utility.trim(key); + value=OfficeExtension.Utility.trim(value); + this.m_responseHeaders[key.toUpperCase()]=value; + } + } + } + } + }; + OfficeXHR.UNSENT=0; + OfficeXHR.OPENED=1; + OfficeXHR.DONE=4; + OfficeXHR.settings=new OfficeXHRSettings(); + return OfficeXHR; + })(); + OfficeExtension.OfficeXHR=OfficeXHR; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + function _EnsurePromise() { + if (!OfficeExtension["Promise"]) { + PromiseImpl.Init(); + } + } + OfficeExtension._EnsurePromise=_EnsurePromise; + var PromiseImpl; + (function (PromiseImpl) { + function Init() { + (function () { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x==='function' || (typeof x==='object' && x !==null); + } + function lib$es6$promise$utils$$isFunction(x) { + return typeof x==='function'; + } + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x==='object' && x !==null; + } + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray=function (x) { + return Object.prototype.toString.call(x)==='[object Array]'; + }; + } + else { + lib$es6$promise$utils$$_isArray=Array.isArray; + } + var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len=0; + var lib$es6$promise$asap$$toString={}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + var lib$es6$promise$asap$$asap=function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg; + lib$es6$promise$asap$$len+=2; + if (lib$es6$promise$asap$$len===2) { + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } + else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + }; + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn=scheduleFn; + } + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap=asapFn; + } + var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]'; + var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined'; + function lib$es6$promise$asap$$useNextTick() { + var nextTick=process.nextTick; + var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/); + if (Array.isArray(version) && version[1]==='0' && version[2]==='10') { + nextTick=setImmediate; + } + return function () { + nextTick(lib$es6$promise$asap$$flush); + }; + } + function lib$es6$promise$asap$$useVertxTimer() { + return function () { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + function lib$es6$promise$asap$$useMutationObserver() { + var iterations=0; + var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node=document.createTextNode(''); + observer.observe(node, { characterData: true }); + return function () { + node.data=(iterations=++iterations % 2); + }; + } + function lib$es6$promise$asap$$useMessageChannel() { + var channel=new MessageChannel(); + channel.port1.onmessage=lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + function lib$es6$promise$asap$$useSetTimeout() { + return function () { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + var lib$es6$promise$asap$$queue=new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i=0; i < lib$es6$promise$asap$$len; i+=2) { + var callback=lib$es6$promise$asap$$queue[i]; + var arg=lib$es6$promise$asap$$queue[i+1]; + callback(arg); + lib$es6$promise$asap$$queue[i]=undefined; + lib$es6$promise$asap$$queue[i+1]=undefined; + } + lib$es6$promise$asap$$len=0; + } + function lib$es6$promise$asap$$attemptVertex() { + try { + var r=require; + var vertx=r('vertx'); + lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } + catch (e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + var lib$es6$promise$asap$$scheduleFlush; + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick(); + } + else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver(); + } + else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel(); + } + else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex(); + } + else { + lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout(); + } + function lib$es6$promise$$internal$$noop() { + } + var lib$es6$promise$$internal$$PENDING=void 0; + var lib$es6$promise$$internal$$FULFILLED=1; + var lib$es6$promise$$internal$$REJECTED=2; + var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject(); + function lib$es6$promise$$internal$$selfFullfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } + catch (error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error=error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } + catch (e) { + return e; + } + } + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function (promise) { + var sealed=false; + var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) { + if (sealed) { + return; + } + sealed=true; + if (thenable !==value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed=true; + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: '+(promise._label || ' unknown promise')); + if (!sealed && error) { + sealed=true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state===lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } + else if (thenable._state===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } + else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function (reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor===promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } + else { + var then=lib$es6$promise$$internal$$getThen(maybeThenable); + if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } + else if (then===undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } + else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise===value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment()); + } + else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } + else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + lib$es6$promise$$internal$$publish(promise); + } + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + return; + } + promise._result=value; + promise._state=lib$es6$promise$$internal$$FULFILLED; + if (promise._subscribers.length !==0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + return; + } + promise._state=lib$es6$promise$$internal$$REJECTED; + promise._result=reason; + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers=parent._subscribers; + var length=subscribers.length; + parent._onerror=null; + subscribers[length]=child; + subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment; + subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection; + if (length===0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + function lib$es6$promise$$internal$$publish(promise) { + var subscribers=promise._subscribers; + var settled=promise._state; + if (subscribers.length===0) { + return; + } + var child, callback, detail=promise._result; + for (var i=0; i < subscribers.length; i+=3) { + child=subscribers[i]; + callback=subscribers[i+settled]; + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } + else { + callback(detail); + } + } + promise._subscribers.length=0; + } + function lib$es6$promise$$internal$$ErrorObject() { + this.error=null; + } + var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject(); + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } + catch (e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed; + if (hasCallback) { + value=lib$es6$promise$$internal$$tryCatch(callback, detail); + if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed=true; + error=value.error; + value=null; + } + else { + succeeded=true; + } + if (promise===value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + } + else { + value=detail; + succeeded=true; + } + if (promise._state !==lib$es6$promise$$internal$$PENDING) { + } + else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } + else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } + else if (settled===lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } + else if (settled===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + catch (e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator=this; + enumerator._instanceConstructor=Constructor; + enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop); + if (enumerator._validateInput(input)) { + enumerator._input=input; + enumerator.length=input.length; + enumerator._remaining=input.length; + enumerator._init(); + if (enumerator.length===0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + else { + enumerator.length=enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining===0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } + else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) { + return lib$es6$promise$utils$$isArray(input); + }; + lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () { + return new OfficeExtension.Error('Array Methods must be provided an Array'); + }; + lib$es6$promise$enumerator$$Enumerator.prototype._init=function () { + this._result=new Array(this.length); + }; + var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator; + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () { + var enumerator=this; + var length=enumerator.length; + var promise=enumerator.promise; + var input=enumerator._input; + for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) { + var enumerator=this; + var c=enumerator._instanceConstructor; + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) { + entry._onerror=null; + enumerator._settledAt(entry._state, i, entry._result); + } + else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } + else { + enumerator._remaining--; + enumerator._result[i]=entry; + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) { + var enumerator=this; + var promise=enumerator.promise; + if (promise._state===lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + if (state===lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + else { + enumerator._result[i]=value; + } + } + if (enumerator._remaining===0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) { + var enumerator=this; + lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function (reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + var Constructor=this; + var promise=new Constructor(lib$es6$promise$$internal$$noop); + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + var length=entries.length; + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + return promise; + } + var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + var Constructor=this; + if (object && typeof object==='object' && object.constructor===Constructor) { + return object; + } + var promise=new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + var Constructor=this; + var promise=new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject; + var lib$es6$promise$promise$$counter=0; + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise; + function lib$es6$promise$promise$$Promise(resolver) { + this._id=lib$es6$promise$promise$$counter++; + this._state=undefined; + this._result=undefined; + this._subscribers=[]; + if (lib$es6$promise$$internal$$noop !==resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap; + lib$es6$promise$promise$$Promise.prototype={ + constructor: lib$es6$promise$promise$$Promise, + then: function (onFulfillment, onRejection) { + var parent=this; + var state=parent._state; + if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + var child=new this.constructor(lib$es6$promise$$internal$$noop); + var result=parent._result; + if (state) { + var callback=arguments[state - 1]; + lib$es6$promise$asap$$asap(function () { + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } + else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + return child; + }, + 'catch': function (onRejection) { + return this.then(null, onRejection); + } + }; + OfficeExtension["Promise"]=lib$es6$promise$promise$$default; + }).call(this); + } + PromiseImpl.Init=Init; + })(PromiseImpl || (PromiseImpl={})); +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + (function (OperationType) { + OperationType[OperationType["Default"]=0]="Default"; + OperationType[OperationType["Read"]=1]="Read"; + })(OfficeExtension.OperationType || (OfficeExtension.OperationType={})); + var OperationType=OfficeExtension.OperationType; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var TrackedObjects=(function () { + function TrackedObjects(context) { + this._autoCleanupList={}; + this.m_context=context; + } + TrackedObjects.prototype.add=function (param) { + var _this=this; + if (Array.isArray(param)) { + param.forEach(function (item) { return _this._addCommon(item, true); }); + } + else { + this._addCommon(param, true); + } + }; + TrackedObjects.prototype._autoAdd=function (object) { + this._addCommon(object, false); + this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object; + }; + TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) { + var referenceId=object[OfficeExtension.Constants.referenceId]; + if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) { + object._KeepReference(); + OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object); + if (isExplicitlyAdded && this.m_context._autoCleanup) { + delete this._autoCleanupList[object._objectPath.objectPathInfo.Id]; + } + } + }; + TrackedObjects.prototype.remove=function (param) { + var _this=this; + if (Array.isArray(param)) { + param.forEach(function (item) { return _this._removeCommon(item); }); + } + else { + this._removeCommon(param); + } + }; + TrackedObjects.prototype._removeCommon=function (object) { + var referenceId=object[OfficeExtension.Constants.referenceId]; + if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) { + var rootObject=this.m_context._rootObject; + if (rootObject._RemoveReference) { + rootObject._RemoveReference(referenceId); + } + } + }; + TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () { + var list=this._autoCleanupList; + this._autoCleanupList={}; + return list; + }; + return TrackedObjects; + })(); + OfficeExtension.TrackedObjects=TrackedObjects; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var ResourceStrings=(function () { + function ResourceStrings() { + } + ResourceStrings.invalidObjectPath="InvalidObjectPath"; + ResourceStrings.propertyNotLoaded="PropertyNotLoaded"; + ResourceStrings.invalidRequestContext="InvalidRequestContext"; + ResourceStrings.invalidArgument="InvalidArgument"; + ResourceStrings.runMustReturnPromise="RunMustReturnPromise"; + return ResourceStrings; + })(); + OfficeExtension.ResourceStrings=ResourceStrings; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var RichApiMessageUtility=(function () { + function RichApiMessageUtility() { + } + RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) { + var headerArray=[]; + if (headers) { + for (var headerName in headers) { + headerArray.push(headerName); + headerArray.push(headers[headerName]); + } + } + var appPermission=0; + var solutionId=""; + var instanceId=""; + var marketplaceType=""; + return [ + customData, + method, + path, + headerArray, + body, + appPermission, + requestFlags, + solutionId, + instanceId, + marketplaceType + ]; + }; + RichApiMessageUtility.getResponseBody=function (result) { + return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseHeaders=function (result) { + return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) { + var ret=data[2 ]; + if (typeof (ret)==="string") { + return ret; + } + var arr=ret; + return arr.join(""); + }; + RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) { + var arrayHeader=data[1 ]; + if (!arrayHeader) { + return null; + } + var headers={}; + for (var i=0; i < arrayHeader.length - 1; i+=2) { + headers[arrayHeader[i]]=arrayHeader[i+1]; + } + return headers; + }; + RichApiMessageUtility.getResponseStatusCode=function (result) { + return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data); + }; + RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) { + return data[0 ]; + }; + return RichApiMessageUtility; + })(); + OfficeExtension.RichApiMessageUtility=RichApiMessageUtility; +})(OfficeExtension || (OfficeExtension={})); +var OfficeExtension; +(function (OfficeExtension) { + var Utility=(function () { + function Utility() { + } + Utility.checkArgumentNull=function (value, name) { + }; + Utility.isNullOrUndefined=function (value) { + if (value===null) { + return true; + } + if (typeof (value)==="undefined") { + return true; + } + return false; + }; + Utility.isUndefined=function (value) { + if (typeof (value)==="undefined") { + return true; + } + return false; + }; + Utility.isNullOrEmptyString=function (value) { + if (value===null) { + return true; + } + if (typeof (value)==="undefined") { + return true; + } + if (value.length==0) { + return true; + } + return false; + }; + Utility.trim=function (str) { + return str.replace(new RegExp("^\\s+|\\s+$", "g"), ""); + }; + Utility.caseInsensitiveCompareString=function (str1, str2) { + if (Utility.isNullOrUndefined(str1)) { + return Utility.isNullOrUndefined(str2); + } + else { + if (Utility.isNullOrUndefined(str2)) { + return false; + } + else { + return str1.toUpperCase()==str2.toUpperCase(); + } + } + }; + Utility.isReadonlyRestRequest=function (method) { + return Utility.caseInsensitiveCompareString(method, "GET"); + }; + Utility.setMethodArguments=function (context, argumentInfo, args) { + if (Utility.isNullOrUndefined(args)) { + return null; + } + var referencedObjectPaths=new Array(); + var referencedObjectPathIds=new Array(); + var hasOne=false; + for (var i=0; i < args.length; i++) { + if (args[i] instanceof OfficeExtension.ClientObject) { + var clientObject=args[i]; + Utility.validateContext(context, clientObject); + args[i]=clientObject._objectPath.objectPathInfo.Id; + referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id); + referencedObjectPaths.push(clientObject._objectPath); + hasOne=true; + } + else { + referencedObjectPathIds.push(0); + } + } + argumentInfo.Arguments=args; + if (hasOne) { + argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds; + return referencedObjectPaths; + } + return null; + }; + Utility.fixObjectPathIfNecessary=function (clientObject, value) { + if (clientObject && clientObject._objectPath && value) { + clientObject._objectPath.updateUsingObjectData(value); + } + }; + Utility.validateObjectPath=function (clientObject) { + var objectPath=clientObject._objectPath; + while (objectPath) { + if (!objectPath.isValid) { + var pathExpression=Utility.getObjectPathExpression(objectPath); + Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression); + } + objectPath=objectPath.parentObjectPath; + } + }; + Utility.validateReferencedObjectPaths=function (objectPaths) { + if (objectPaths) { + for (var i=0; i < objectPaths.length; i++) { + var objectPath=objectPaths[i]; + while (objectPath) { + if (!objectPath.isValid) { + var pathExpression=Utility.getObjectPathExpression(objectPath); + Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression); + } + objectPath=objectPath.parentObjectPath; + } + } + } + }; + Utility.validateContext=function (context, obj) { + if (obj && obj.context !==context) { + Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext); + } + }; + Utility.log=function (message) { + if (Utility._logEnabled && window.console && window.console.log) { + window.console.log(message); + } + }; + Utility.load=function (clientObj, option) { + clientObj.context.load(clientObj, option); + }; + Utility.throwError=function (resourceId, arg) { + throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), {}); + }; + Utility.createRuntimeError=function (code, message, location) { + return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location }); + }; + Utility._getResourceString=function (resourceId, arg) { + var ret=resourceId; + if (window.Strings && window.Strings.OfficeOM) { + var stringName="L_"+resourceId; + var stringValue=window.Strings.OfficeOM[stringName]; + if (stringValue) { + ret=stringValue; + } + } + if (!Utility.isNullOrUndefined(arg)) { + ret=ret.replace("{0}", arg); + } + return ret; + }; + Utility.throwIfNotLoaded=function (propertyName, fieldValue) { + if (Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) { + Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName); + } + }; + Utility.getObjectPathExpression=function (objectPath) { + var ret=""; + while (objectPath) { + switch (objectPath.objectPathInfo.ObjectPathType) { + case 1 : + ret=ret; + break; + case 2 : + ret="new()"+(ret.length > 0 ? "." : "")+ret; + break; + case 3 : + ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret; + break; + case 4 : + ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret; + break; + case 5 : + ret="getItem()"+(ret.length > 0 ? "." : "")+ret; + break; + case 6 : + ret="_reference()"+(ret.length > 0 ? "." : "")+ret; + break; + } + objectPath=objectPath.parentObjectPath; + } + return ret; + }; + Utility._createPromiseFromResult=function (value) { + OfficeExtension._EnsurePromise(); + return new OfficeExtension['Promise'](function (resolve, reject) { + resolve(value); + }); + }; + Utility._addActionResultHandler=function (clientObj, action, resultHandler) { + clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler); + }; + Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) { + for (var i=0; i < propertyNames.length - 1; i+=2) { + if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) { + clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]); + } + } + }; + Utility.normalizeName=function (name) { + return name.substr(0, 1).toLowerCase()+name.substr(1); + }; + Utility._logEnabled=false; + Utility.s_underscoreCharCode="_".charCodeAt(0); + return Utility; + })(); + OfficeExtension.Utility=Utility; +})(OfficeExtension || (OfficeExtension={})); + +var __extends=this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p]; + function __() { this.constructor=d; } + __.prototype=b.prototype; + d.prototype=new __(); +}; +var Word; +(function (Word) { + function _normalizeSearchOptions(context, searchOptions) { + if (OfficeExtension.Utility.isNullOrUndefined(searchOptions)) { + return null; + } + if (typeof (searchOptions) !="object") { + OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "searchOptions"); + } + if (searchOptions instanceof Word.SearchOptions) { + return searchOptions; + } + var newSearchOptions=Word.SearchOptions.newObject(context); + for (var property in searchOptions) { + if (searchOptions.hasOwnProperty(property)) { + newSearchOptions[property]=searchOptions[property]; + } + } + return newSearchOptions; + } + var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath; + var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath; + var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath; + var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath; + var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer; + var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt; + var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction; + var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction; + var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined; + var _isUndefined=OfficeExtension.Utility.isUndefined; + var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded; + var _load=OfficeExtension.Utility.load; + var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary; + var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler; + var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults; + var Body=(function (_super) { + __extends(Body, _super); + function Body() { + _super.apply(this, arguments); + } + Object.defineProperty(Body.prototype, "contentControls", { + get: function () { + if (!this.m_contentControls) { + this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false)); + } + return this.m_contentControls; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Body.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Body.prototype, "inlinePictures", { + get: function () { + if (!this.m_inlinePictures) { + this.m_inlinePictures=new Word.InlinePictureCollection(this.context, _createPropertyObjectPath(this.context, this, "InlinePictures", true, false)); + } + return this.m_inlinePictures; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Body.prototype, "paragraphs", { + get: function () { + if (!this.m_paragraphs) { + this.m_paragraphs=new Word.ParagraphCollection(this.context, _createPropertyObjectPath(this.context, this, "Paragraphs", true, false)); + } + return this.m_paragraphs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Body.prototype, "parentContentControl", { + get: function () { + if (!this.m_parentContentControl) { + this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false)); + } + return this.m_parentContentControl; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Body.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Body.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Body.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + Body.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + Body.prototype.getHtml=function () { + var action=_createMethodAction(this.context, this, "GetHtml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Body.prototype.getOoxml=function () { + var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Body.prototype.insertBreak=function (breakType, insertLocation) { + _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]); + }; + Body.prototype.insertContentControl=function () { + return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true)); + }; + Body.prototype.insertFileFromBase64=function (base64File, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true)); + }; + Body.prototype.insertHtml=function (html, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true)); + }; + Body.prototype.insertOoxml=function (ooxml, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true)); + }; + Body.prototype.insertParagraph=function (paragraphText, insertLocation) { + return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true)); + }; + Body.prototype.insertText=function (text, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true)); + }; + Body.prototype.search=function (searchText, searchOptions) { + searchOptions=_normalizeSearchOptions(this.context, searchOptions); + return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true)); + }; + Body.prototype.select=function () { + _createMethodAction(this.context, this, "Select", 1 , []); + }; + Body.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + Body.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "inlinePictures", "InlinePictures", "paragraphs", "Paragraphs", "parentContentControl", "ParentContentControl"]); + }; + Body.prototype.load=function (option) { + _load(this, option); + return this; + }; + Body.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return Body; + })(OfficeExtension.ClientObject); + Word.Body=Body; + var ContentControl=(function (_super) { + __extends(ContentControl, _super); + function ContentControl() { + _super.apply(this, arguments); + } + Object.defineProperty(ContentControl.prototype, "contentControls", { + get: function () { + if (!this.m_contentControls) { + this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false)); + } + return this.m_contentControls; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "inlinePictures", { + get: function () { + if (!this.m_inlinePictures) { + this.m_inlinePictures=new Word.InlinePictureCollection(this.context, _createPropertyObjectPath(this.context, this, "InlinePictures", true, false)); + } + return this.m_inlinePictures; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "paragraphs", { + get: function () { + if (!this.m_paragraphs) { + this.m_paragraphs=new Word.ParagraphCollection(this.context, _createPropertyObjectPath(this.context, this, "Paragraphs", true, false)); + } + return this.m_paragraphs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "parentContentControl", { + get: function () { + if (!this.m_parentContentControl) { + this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false)); + } + return this.m_parentContentControl; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "appearance", { + get: function () { + _throwIfNotLoaded("appearance", this.m_appearance); + return this.m_appearance; + }, + set: function (value) { + this.m_appearance=value; + _createSetPropertyAction(this.context, this, "Appearance", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "cannotDelete", { + get: function () { + _throwIfNotLoaded("cannotDelete", this.m_cannotDelete); + return this.m_cannotDelete; + }, + set: function (value) { + this.m_cannotDelete=value; + _createSetPropertyAction(this.context, this, "CannotDelete", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "cannotEdit", { + get: function () { + _throwIfNotLoaded("cannotEdit", this.m_cannotEdit); + return this.m_cannotEdit; + }, + set: function (value) { + this.m_cannotEdit=value; + _createSetPropertyAction(this.context, this, "CannotEdit", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "id", { + get: function () { + _throwIfNotLoaded("id", this.m_id); + return this.m_id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "placeholderText", { + get: function () { + _throwIfNotLoaded("placeholderText", this.m_placeholderText); + return this.m_placeholderText; + }, + set: function (value) { + this.m_placeholderText=value; + _createSetPropertyAction(this.context, this, "PlaceholderText", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "removeWhenEdited", { + get: function () { + _throwIfNotLoaded("removeWhenEdited", this.m_removeWhenEdited); + return this.m_removeWhenEdited; + }, + set: function (value) { + this.m_removeWhenEdited=value; + _createSetPropertyAction(this.context, this, "RemoveWhenEdited", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "tag", { + get: function () { + _throwIfNotLoaded("tag", this.m_tag); + return this.m_tag; + }, + set: function (value) { + this.m_tag=value; + _createSetPropertyAction(this.context, this, "Tag", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "title", { + get: function () { + _throwIfNotLoaded("title", this.m_title); + return this.m_title; + }, + set: function (value) { + this.m_title=value; + _createSetPropertyAction(this.context, this, "Title", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "type", { + get: function () { + _throwIfNotLoaded("type", this.m_type); + return this.m_type; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControl.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + ContentControl.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + ContentControl.prototype.delete=function (keepContent) { + _createMethodAction(this.context, this, "Delete", 0 , [keepContent]); + }; + ContentControl.prototype.getHtml=function () { + var action=_createMethodAction(this.context, this, "GetHtml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + ContentControl.prototype.getOoxml=function () { + var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + ContentControl.prototype.insertBreak=function (breakType, insertLocation) { + _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]); + }; + ContentControl.prototype.insertFileFromBase64=function (base64File, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true)); + }; + ContentControl.prototype.insertHtml=function (html, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true)); + }; + ContentControl.prototype.insertOoxml=function (ooxml, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true)); + }; + ContentControl.prototype.insertParagraph=function (paragraphText, insertLocation) { + return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true)); + }; + ContentControl.prototype.insertText=function (text, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true)); + }; + ContentControl.prototype.search=function (searchText, searchOptions) { + searchOptions=_normalizeSearchOptions(this.context, searchOptions); + return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true)); + }; + ContentControl.prototype.select=function () { + _createMethodAction(this.context, this, "Select", 1 , []); + }; + ContentControl.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + ContentControl.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Appearance"])) { + this.m_appearance=obj["Appearance"]; + } + if (!_isUndefined(obj["CannotDelete"])) { + this.m_cannotDelete=obj["CannotDelete"]; + } + if (!_isUndefined(obj["CannotEdit"])) { + this.m_cannotEdit=obj["CannotEdit"]; + } + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["Id"])) { + this.m_id=obj["Id"]; + } + if (!_isUndefined(obj["PlaceholderText"])) { + this.m_placeholderText=obj["PlaceholderText"]; + } + if (!_isUndefined(obj["RemoveWhenEdited"])) { + this.m_removeWhenEdited=obj["RemoveWhenEdited"]; + } + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + if (!_isUndefined(obj["Tag"])) { + this.m_tag=obj["Tag"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["Title"])) { + this.m_title=obj["Title"]; + } + if (!_isUndefined(obj["Type"])) { + this.m_type=obj["Type"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "inlinePictures", "InlinePictures", "paragraphs", "Paragraphs", "parentContentControl", "ParentContentControl"]); + }; + ContentControl.prototype.load=function (option) { + _load(this, option); + return this; + }; + ContentControl.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return ContentControl; + })(OfficeExtension.ClientObject); + Word.ContentControl=ContentControl; + var ContentControlCollection=(function (_super) { + __extends(ContentControlCollection, _super); + function ContentControlCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ContentControlCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentControlCollection.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + ContentControlCollection.prototype.getById=function (id) { + return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "GetById", 1 , [id], false, false)); + }; + ContentControlCollection.prototype.getByTag=function (tag) { + return new Word.ContentControlCollection(this.context, _createMethodObjectPath(this.context, this, "GetByTag", 1 , [tag], true, false)); + }; + ContentControlCollection.prototype.getByTitle=function (title) { + return new Word.ContentControlCollection(this.context, _createMethodObjectPath(this.context, this, "GetByTitle", 1 , [title], true, false)); + }; + ContentControlCollection.prototype.getItem=function (index) { + return new Word.ContentControl(this.context, _createIndexerObjectPath(this.context, this, [index])); + }; + ContentControlCollection.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + ContentControlCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Word.ContentControl(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ContentControlCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + ContentControlCollection.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return ContentControlCollection; + })(OfficeExtension.ClientObject); + Word.ContentControlCollection=ContentControlCollection; + var Document=(function (_super) { + __extends(Document, _super); + function Document() { + _super.apply(this, arguments); + } + Object.defineProperty(Document.prototype, "body", { + get: function () { + if (!this.m_body) { + this.m_body=new Word.Body(this.context, _createPropertyObjectPath(this.context, this, "Body", false, false)); + } + return this.m_body; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Document.prototype, "contentControls", { + get: function () { + if (!this.m_contentControls) { + this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false)); + } + return this.m_contentControls; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Document.prototype, "sections", { + get: function () { + if (!this.m_sections) { + this.m_sections=new Word.SectionCollection(this.context, _createPropertyObjectPath(this.context, this, "Sections", true, false)); + } + return this.m_sections; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Document.prototype, "saved", { + get: function () { + _throwIfNotLoaded("saved", this.m_saved); + return this.m_saved; + }, + enumerable: true, + configurable: true + }); + Document.prototype.getSelection=function () { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelection", 1 , [], false, true)); + }; + Document.prototype.save=function () { + _createMethodAction(this.context, this, "Save", 0 , []); + }; + Document.prototype._GetObjectByReferenceId=function (referenceId) { + var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", 1 , [referenceId]); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Document.prototype._GetObjectTypeNameByReferenceId=function (referenceId) { + var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", 1 , [referenceId]); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Document.prototype._RemoveAllReferences=function () { + _createMethodAction(this.context, this, "_RemoveAllReferences", 1 , []); + }; + Document.prototype._RemoveReference=function (referenceId) { + _createMethodAction(this.context, this, "_RemoveReference", 1 , [referenceId]); + }; + Document.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Saved"])) { + this.m_saved=obj["Saved"]; + } + _handleNavigationPropertyResults(this, obj, ["body", "Body", "contentControls", "ContentControls", "sections", "Sections"]); + }; + Document.prototype.load=function (option) { + _load(this, option); + return this; + }; + return Document; + })(OfficeExtension.ClientObject); + Word.Document=Document; + var Font=(function (_super) { + __extends(Font, _super); + function Font() { + _super.apply(this, arguments); + } + Object.defineProperty(Font.prototype, "bold", { + get: function () { + _throwIfNotLoaded("bold", this.m_bold); + return this.m_bold; + }, + set: function (value) { + this.m_bold=value; + _createSetPropertyAction(this.context, this, "Bold", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "color", { + get: function () { + _throwIfNotLoaded("color", this.m_color); + return this.m_color; + }, + set: function (value) { + this.m_color=value; + _createSetPropertyAction(this.context, this, "Color", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "doubleStrikeThrough", { + get: function () { + _throwIfNotLoaded("doubleStrikeThrough", this.m_doubleStrikeThrough); + return this.m_doubleStrikeThrough; + }, + set: function (value) { + this.m_doubleStrikeThrough=value; + _createSetPropertyAction(this.context, this, "DoubleStrikeThrough", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "highlightColor", { + get: function () { + _throwIfNotLoaded("highlightColor", this.m_highlightColor); + return this.m_highlightColor; + }, + set: function (value) { + this.m_highlightColor=value; + _createSetPropertyAction(this.context, this, "HighlightColor", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "italic", { + get: function () { + _throwIfNotLoaded("italic", this.m_italic); + return this.m_italic; + }, + set: function (value) { + this.m_italic=value; + _createSetPropertyAction(this.context, this, "Italic", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "name", { + get: function () { + _throwIfNotLoaded("name", this.m_name); + return this.m_name; + }, + set: function (value) { + this.m_name=value; + _createSetPropertyAction(this.context, this, "Name", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "size", { + get: function () { + _throwIfNotLoaded("size", this.m_size); + return this.m_size; + }, + set: function (value) { + this.m_size=value; + _createSetPropertyAction(this.context, this, "Size", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "strikeThrough", { + get: function () { + _throwIfNotLoaded("strikeThrough", this.m_strikeThrough); + return this.m_strikeThrough; + }, + set: function (value) { + this.m_strikeThrough=value; + _createSetPropertyAction(this.context, this, "StrikeThrough", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "subscript", { + get: function () { + _throwIfNotLoaded("subscript", this.m_subscript); + return this.m_subscript; + }, + set: function (value) { + this.m_subscript=value; + _createSetPropertyAction(this.context, this, "Subscript", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "superscript", { + get: function () { + _throwIfNotLoaded("superscript", this.m_superscript); + return this.m_superscript; + }, + set: function (value) { + this.m_superscript=value; + _createSetPropertyAction(this.context, this, "Superscript", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "underline", { + get: function () { + _throwIfNotLoaded("underline", this.m_underline); + return this.m_underline; + }, + set: function (value) { + this.m_underline=value; + _createSetPropertyAction(this.context, this, "Underline", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Font.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + Font.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + Font.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Bold"])) { + this.m_bold=obj["Bold"]; + } + if (!_isUndefined(obj["Color"])) { + this.m_color=obj["Color"]; + } + if (!_isUndefined(obj["DoubleStrikeThrough"])) { + this.m_doubleStrikeThrough=obj["DoubleStrikeThrough"]; + } + if (!_isUndefined(obj["HighlightColor"])) { + this.m_highlightColor=obj["HighlightColor"]; + } + if (!_isUndefined(obj["Italic"])) { + this.m_italic=obj["Italic"]; + } + if (!_isUndefined(obj["Name"])) { + this.m_name=obj["Name"]; + } + if (!_isUndefined(obj["Size"])) { + this.m_size=obj["Size"]; + } + if (!_isUndefined(obj["StrikeThrough"])) { + this.m_strikeThrough=obj["StrikeThrough"]; + } + if (!_isUndefined(obj["Subscript"])) { + this.m_subscript=obj["Subscript"]; + } + if (!_isUndefined(obj["Superscript"])) { + this.m_superscript=obj["Superscript"]; + } + if (!_isUndefined(obj["Underline"])) { + this.m_underline=obj["Underline"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + }; + Font.prototype.load=function (option) { + _load(this, option); + return this; + }; + Font.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return Font; + })(OfficeExtension.ClientObject); + Word.Font=Font; + var InlinePicture=(function (_super) { + __extends(InlinePicture, _super); + function InlinePicture() { + _super.apply(this, arguments); + } + Object.defineProperty(InlinePicture.prototype, "parentContentControl", { + get: function () { + if (!this.m_parentContentControl) { + this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false)); + } + return this.m_parentContentControl; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "altTextDescription", { + get: function () { + _throwIfNotLoaded("altTextDescription", this.m_altTextDescription); + return this.m_altTextDescription; + }, + set: function (value) { + this.m_altTextDescription=value; + _createSetPropertyAction(this.context, this, "AltTextDescription", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "altTextTitle", { + get: function () { + _throwIfNotLoaded("altTextTitle", this.m_altTextTitle); + return this.m_altTextTitle; + }, + set: function (value) { + this.m_altTextTitle=value; + _createSetPropertyAction(this.context, this, "AltTextTitle", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "height", { + get: function () { + _throwIfNotLoaded("height", this.m_height); + return this.m_height; + }, + set: function (value) { + this.m_height=value; + _createSetPropertyAction(this.context, this, "Height", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "hyperlink", { + get: function () { + _throwIfNotLoaded("hyperlink", this.m_hyperlink); + return this.m_hyperlink; + }, + set: function (value) { + this.m_hyperlink=value; + _createSetPropertyAction(this.context, this, "Hyperlink", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "lockAspectRatio", { + get: function () { + _throwIfNotLoaded("lockAspectRatio", this.m_lockAspectRatio); + return this.m_lockAspectRatio; + }, + set: function (value) { + this.m_lockAspectRatio=value; + _createSetPropertyAction(this.context, this, "LockAspectRatio", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "width", { + get: function () { + _throwIfNotLoaded("width", this.m_width); + return this.m_width; + }, + set: function (value) { + this.m_width=value; + _createSetPropertyAction(this.context, this, "Width", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePicture.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + InlinePicture.prototype.getBase64ImageSrc=function () { + var action=_createMethodAction(this.context, this, "GetBase64ImageSrc", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + InlinePicture.prototype.insertContentControl=function () { + return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true)); + }; + InlinePicture.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + InlinePicture.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["AltTextDescription"])) { + this.m_altTextDescription=obj["AltTextDescription"]; + } + if (!_isUndefined(obj["AltTextTitle"])) { + this.m_altTextTitle=obj["AltTextTitle"]; + } + if (!_isUndefined(obj["Height"])) { + this.m_height=obj["Height"]; + } + if (!_isUndefined(obj["Hyperlink"])) { + this.m_hyperlink=obj["Hyperlink"]; + } + if (!_isUndefined(obj["LockAspectRatio"])) { + this.m_lockAspectRatio=obj["LockAspectRatio"]; + } + if (!_isUndefined(obj["Width"])) { + this.m_width=obj["Width"]; + } + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["parentContentControl", "ParentContentControl"]); + }; + InlinePicture.prototype.load=function (option) { + _load(this, option); + return this; + }; + InlinePicture.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return InlinePicture; + })(OfficeExtension.ClientObject); + Word.InlinePicture=InlinePicture; + var InlinePictureCollection=(function (_super) { + __extends(InlinePictureCollection, _super); + function InlinePictureCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(InlinePictureCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InlinePictureCollection.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + InlinePictureCollection.prototype._GetItem=function (index) { + return new Word.InlinePicture(this.context, _createIndexerObjectPath(this.context, this, [index])); + }; + InlinePictureCollection.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + InlinePictureCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Word.InlinePicture(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + InlinePictureCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + InlinePictureCollection.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return InlinePictureCollection; + })(OfficeExtension.ClientObject); + Word.InlinePictureCollection=InlinePictureCollection; + var Paragraph=(function (_super) { + __extends(Paragraph, _super); + function Paragraph() { + _super.apply(this, arguments); + } + Object.defineProperty(Paragraph.prototype, "contentControls", { + get: function () { + if (!this.m_contentControls) { + this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false)); + } + return this.m_contentControls; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "inlinePictures", { + get: function () { + if (!this.m_inlinePictures) { + this.m_inlinePictures=new Word.InlinePictureCollection(this.context, _createPropertyObjectPath(this.context, this, "InlinePictures", true, false)); + } + return this.m_inlinePictures; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "parentContentControl", { + get: function () { + if (!this.m_parentContentControl) { + this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false)); + } + return this.m_parentContentControl; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "alignment", { + get: function () { + _throwIfNotLoaded("alignment", this.m_alignment); + return this.m_alignment; + }, + set: function (value) { + this.m_alignment=value; + _createSetPropertyAction(this.context, this, "Alignment", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "firstLineIndent", { + get: function () { + _throwIfNotLoaded("firstLineIndent", this.m_firstLineIndent); + return this.m_firstLineIndent; + }, + set: function (value) { + this.m_firstLineIndent=value; + _createSetPropertyAction(this.context, this, "FirstLineIndent", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "leftIndent", { + get: function () { + _throwIfNotLoaded("leftIndent", this.m_leftIndent); + return this.m_leftIndent; + }, + set: function (value) { + this.m_leftIndent=value; + _createSetPropertyAction(this.context, this, "LeftIndent", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "lineSpacing", { + get: function () { + _throwIfNotLoaded("lineSpacing", this.m_lineSpacing); + return this.m_lineSpacing; + }, + set: function (value) { + this.m_lineSpacing=value; + _createSetPropertyAction(this.context, this, "LineSpacing", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "lineUnitAfter", { + get: function () { + _throwIfNotLoaded("lineUnitAfter", this.m_lineUnitAfter); + return this.m_lineUnitAfter; + }, + set: function (value) { + this.m_lineUnitAfter=value; + _createSetPropertyAction(this.context, this, "LineUnitAfter", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "lineUnitBefore", { + get: function () { + _throwIfNotLoaded("lineUnitBefore", this.m_lineUnitBefore); + return this.m_lineUnitBefore; + }, + set: function (value) { + this.m_lineUnitBefore=value; + _createSetPropertyAction(this.context, this, "LineUnitBefore", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "outlineLevel", { + get: function () { + _throwIfNotLoaded("outlineLevel", this.m_outlineLevel); + return this.m_outlineLevel; + }, + set: function (value) { + this.m_outlineLevel=value; + _createSetPropertyAction(this.context, this, "OutlineLevel", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "rightIndent", { + get: function () { + _throwIfNotLoaded("rightIndent", this.m_rightIndent); + return this.m_rightIndent; + }, + set: function (value) { + this.m_rightIndent=value; + _createSetPropertyAction(this.context, this, "RightIndent", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "spaceAfter", { + get: function () { + _throwIfNotLoaded("spaceAfter", this.m_spaceAfter); + return this.m_spaceAfter; + }, + set: function (value) { + this.m_spaceAfter=value; + _createSetPropertyAction(this.context, this, "SpaceAfter", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "spaceBefore", { + get: function () { + _throwIfNotLoaded("spaceBefore", this.m_spaceBefore); + return this.m_spaceBefore; + }, + set: function (value) { + this.m_spaceBefore=value; + _createSetPropertyAction(this.context, this, "SpaceBefore", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Paragraph.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + Paragraph.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + Paragraph.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Paragraph.prototype.getHtml=function () { + var action=_createMethodAction(this.context, this, "GetHtml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Paragraph.prototype.getOoxml=function () { + var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Paragraph.prototype.insertBreak=function (breakType, insertLocation) { + _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]); + }; + Paragraph.prototype.insertContentControl=function () { + return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true)); + }; + Paragraph.prototype.insertFileFromBase64=function (base64File, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true)); + }; + Paragraph.prototype.insertHtml=function (html, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true)); + }; + Paragraph.prototype.insertInlinePictureFromBase64=function (base64EncodedImage, insertLocation) { + return new Word.InlinePicture(this.context, _createMethodObjectPath(this.context, this, "InsertInlinePictureFromBase64", 0 , [base64EncodedImage, insertLocation], false, true)); + }; + Paragraph.prototype.insertOoxml=function (ooxml, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true)); + }; + Paragraph.prototype.insertParagraph=function (paragraphText, insertLocation) { + return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true)); + }; + Paragraph.prototype.insertText=function (text, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true)); + }; + Paragraph.prototype.search=function (searchText, searchOptions) { + searchOptions=_normalizeSearchOptions(this.context, searchOptions); + return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true)); + }; + Paragraph.prototype.select=function () { + _createMethodAction(this.context, this, "Select", 1 , []); + }; + Paragraph.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + Paragraph.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Alignment"])) { + this.m_alignment=obj["Alignment"]; + } + if (!_isUndefined(obj["FirstLineIndent"])) { + this.m_firstLineIndent=obj["FirstLineIndent"]; + } + if (!_isUndefined(obj["LeftIndent"])) { + this.m_leftIndent=obj["LeftIndent"]; + } + if (!_isUndefined(obj["LineSpacing"])) { + this.m_lineSpacing=obj["LineSpacing"]; + } + if (!_isUndefined(obj["LineUnitAfter"])) { + this.m_lineUnitAfter=obj["LineUnitAfter"]; + } + if (!_isUndefined(obj["LineUnitBefore"])) { + this.m_lineUnitBefore=obj["LineUnitBefore"]; + } + if (!_isUndefined(obj["OutlineLevel"])) { + this.m_outlineLevel=obj["OutlineLevel"]; + } + if (!_isUndefined(obj["RightIndent"])) { + this.m_rightIndent=obj["RightIndent"]; + } + if (!_isUndefined(obj["SpaceAfter"])) { + this.m_spaceAfter=obj["SpaceAfter"]; + } + if (!_isUndefined(obj["SpaceBefore"])) { + this.m_spaceBefore=obj["SpaceBefore"]; + } + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "inlinePictures", "InlinePictures", "parentContentControl", "ParentContentControl"]); + }; + Paragraph.prototype.load=function (option) { + _load(this, option); + return this; + }; + Paragraph.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return Paragraph; + })(OfficeExtension.ClientObject); + Word.Paragraph=Paragraph; + var ParagraphCollection=(function (_super) { + __extends(ParagraphCollection, _super); + function ParagraphCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(ParagraphCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParagraphCollection.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + ParagraphCollection.prototype._GetItem=function (index) { + return new Word.Paragraph(this.context, _createIndexerObjectPath(this.context, this, [index])); + }; + ParagraphCollection.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + ParagraphCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Word.Paragraph(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + ParagraphCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + ParagraphCollection.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return ParagraphCollection; + })(OfficeExtension.ClientObject); + Word.ParagraphCollection=ParagraphCollection; + var Range=(function (_super) { + __extends(Range, _super); + function Range() { + _super.apply(this, arguments); + } + Object.defineProperty(Range.prototype, "contentControls", { + get: function () { + if (!this.m_contentControls) { + this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false)); + } + return this.m_contentControls; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "font", { + get: function () { + if (!this.m_font) { + this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false)); + } + return this.m_font; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "paragraphs", { + get: function () { + if (!this.m_paragraphs) { + this.m_paragraphs=new Word.ParagraphCollection(this.context, _createPropertyObjectPath(this.context, this, "Paragraphs", true, false)); + } + return this.m_paragraphs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "parentContentControl", { + get: function () { + if (!this.m_parentContentControl) { + this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false)); + } + return this.m_parentContentControl; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "style", { + get: function () { + _throwIfNotLoaded("style", this.m_style); + return this.m_style; + }, + set: function (value) { + this.m_style=value; + _createSetPropertyAction(this.context, this, "Style", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "text", { + get: function () { + _throwIfNotLoaded("text", this.m_text); + return this.m_text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Range.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + Range.prototype.clear=function () { + _createMethodAction(this.context, this, "Clear", 0 , []); + }; + Range.prototype.delete=function () { + _createMethodAction(this.context, this, "Delete", 0 , []); + }; + Range.prototype.getHtml=function () { + var action=_createMethodAction(this.context, this, "GetHtml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Range.prototype.getOoxml=function () { + var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []); + var ret=new OfficeExtension.ClientResult(); + _addActionResultHandler(this, action, ret); + return ret; + }; + Range.prototype.insertBreak=function (breakType, insertLocation) { + _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]); + }; + Range.prototype.insertContentControl=function () { + return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true)); + }; + Range.prototype.insertFileFromBase64=function (base64File, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true)); + }; + Range.prototype.insertHtml=function (html, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true)); + }; + Range.prototype.insertOoxml=function (ooxml, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true)); + }; + Range.prototype.insertParagraph=function (paragraphText, insertLocation) { + return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true)); + }; + Range.prototype.insertText=function (text, insertLocation) { + return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true)); + }; + Range.prototype.search=function (searchText, searchOptions) { + searchOptions=_normalizeSearchOptions(this.context, searchOptions); + return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true)); + }; + Range.prototype.select=function () { + _createMethodAction(this.context, this, "Select", 1 , []); + }; + Range.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + Range.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["Style"])) { + this.m_style=obj["Style"]; + } + if (!_isUndefined(obj["Text"])) { + this.m_text=obj["Text"]; + } + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "paragraphs", "Paragraphs", "parentContentControl", "ParentContentControl"]); + }; + Range.prototype.load=function (option) { + _load(this, option); + return this; + }; + Range.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return Range; + })(OfficeExtension.ClientObject); + Word.Range=Range; + var SearchOptions=(function (_super) { + __extends(SearchOptions, _super); + function SearchOptions() { + _super.apply(this, arguments); + } + Object.defineProperty(SearchOptions.prototype, "ignorePunct", { + get: function () { + _throwIfNotLoaded("ignorePunct", this.m_ignorePunct); + return this.m_ignorePunct; + }, + set: function (value) { + this.m_ignorePunct=value; + _createSetPropertyAction(this.context, this, "IgnorePunct", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchOptions.prototype, "ignoreSpace", { + get: function () { + _throwIfNotLoaded("ignoreSpace", this.m_ignoreSpace); + return this.m_ignoreSpace; + }, + set: function (value) { + this.m_ignoreSpace=value; + _createSetPropertyAction(this.context, this, "IgnoreSpace", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchOptions.prototype, "matchCase", { + get: function () { + _throwIfNotLoaded("matchCase", this.m_matchCase); + return this.m_matchCase; + }, + set: function (value) { + this.m_matchCase=value; + _createSetPropertyAction(this.context, this, "MatchCase", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchOptions.prototype, "matchPrefix", { + get: function () { + _throwIfNotLoaded("matchPrefix", this.m_matchPrefix); + return this.m_matchPrefix; + }, + set: function (value) { + this.m_matchPrefix=value; + _createSetPropertyAction(this.context, this, "MatchPrefix", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchOptions.prototype, "matchSoundsLike", { + get: function () { + _throwIfNotLoaded("matchSoundsLike", this.m_matchSoundsLike); + return this.m_matchSoundsLike; + }, + set: function (value) { + this.m_matchSoundsLike=value; + _createSetPropertyAction(this.context, this, "MatchSoundsLike", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchOptions.prototype, "matchSuffix", { + get: function () { + _throwIfNotLoaded("matchSuffix", this.m_matchSuffix); + return this.m_matchSuffix; + }, + set: function (value) { + this.m_matchSuffix=value; + _createSetPropertyAction(this.context, this, "MatchSuffix", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchOptions.prototype, "matchWholeWord", { + get: function () { + _throwIfNotLoaded("matchWholeWord", this.m_matchWholeWord); + return this.m_matchWholeWord; + }, + set: function (value) { + this.m_matchWholeWord=value; + _createSetPropertyAction(this.context, this, "MatchWholeWord", value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchOptions.prototype, "matchWildCards", { + get: function () { + _throwIfNotLoaded("matchWildCards", this.m_matchWildCards); + return this.m_matchWildCards; + }, + set: function (value) { + this.m_matchWildCards=value; + _createSetPropertyAction(this.context, this, "MatchWildCards", value); + }, + enumerable: true, + configurable: true + }); + SearchOptions.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["IgnorePunct"])) { + this.m_ignorePunct=obj["IgnorePunct"]; + } + if (!_isUndefined(obj["IgnoreSpace"])) { + this.m_ignoreSpace=obj["IgnoreSpace"]; + } + if (!_isUndefined(obj["MatchCase"])) { + this.m_matchCase=obj["MatchCase"]; + } + if (!_isUndefined(obj["MatchPrefix"])) { + this.m_matchPrefix=obj["MatchPrefix"]; + } + if (!_isUndefined(obj["MatchSoundsLike"])) { + this.m_matchSoundsLike=obj["MatchSoundsLike"]; + } + if (!_isUndefined(obj["MatchSuffix"])) { + this.m_matchSuffix=obj["MatchSuffix"]; + } + if (!_isUndefined(obj["MatchWholeWord"])) { + this.m_matchWholeWord=obj["MatchWholeWord"]; + } + if (!_isUndefined(obj["MatchWildCards"])) { + this.m_matchWildCards=obj["MatchWildCards"]; + } + }; + SearchOptions.prototype.load=function (option) { + _load(this, option); + return this; + }; + SearchOptions.newObject=function (context) { + var ret=new Word.SearchOptions(context, _createNewObjectObjectPath(context, "Microsoft.WordServices.SearchOptions", false)); + return ret; + }; + return SearchOptions; + })(OfficeExtension.ClientObject); + Word.SearchOptions=SearchOptions; + var SearchResultCollection=(function (_super) { + __extends(SearchResultCollection, _super); + function SearchResultCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(SearchResultCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchResultCollection.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + SearchResultCollection.prototype._GetItem=function (index) { + return new Word.Range(this.context, _createIndexerObjectPath(this.context, this, [index])); + }; + SearchResultCollection.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + SearchResultCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Word.Range(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + SearchResultCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + SearchResultCollection.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return SearchResultCollection; + })(OfficeExtension.ClientObject); + Word.SearchResultCollection=SearchResultCollection; + var Section=(function (_super) { + __extends(Section, _super); + function Section() { + _super.apply(this, arguments); + } + Object.defineProperty(Section.prototype, "body", { + get: function () { + if (!this.m_body) { + this.m_body=new Word.Body(this.context, _createPropertyObjectPath(this.context, this, "Body", false, false)); + } + return this.m_body; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Section.prototype, "_Id", { + get: function () { + _throwIfNotLoaded("_Id", this.m__Id); + return this.m__Id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Section.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + Section.prototype.getFooter=function (type) { + return new Word.Body(this.context, _createMethodObjectPath(this.context, this, "GetFooter", 1 , [type], false, true)); + }; + Section.prototype.getHeader=function (type) { + return new Word.Body(this.context, _createMethodObjectPath(this.context, this, "GetHeader", 1 , [type], false, true)); + }; + Section.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + Section.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["_Id"])) { + this.m__Id=obj["_Id"]; + } + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + _handleNavigationPropertyResults(this, obj, ["body", "Body"]); + }; + Section.prototype.load=function (option) { + _load(this, option); + return this; + }; + Section.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return Section; + })(OfficeExtension.ClientObject); + Word.Section=Section; + var SectionCollection=(function (_super) { + __extends(SectionCollection, _super); + function SectionCollection() { + _super.apply(this, arguments); + } + Object.defineProperty(SectionCollection.prototype, "items", { + get: function () { + _throwIfNotLoaded("items", this.m__items); + return this.m__items; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SectionCollection.prototype, "_ReferenceId", { + get: function () { + _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId); + return this.m__ReferenceId; + }, + enumerable: true, + configurable: true + }); + SectionCollection.prototype._GetItem=function (index) { + return new Word.Section(this.context, _createIndexerObjectPath(this.context, this, [index])); + }; + SectionCollection.prototype._KeepReference=function () { + _createMethodAction(this.context, this, "_KeepReference", 1 , []); + }; + SectionCollection.prototype._handleResult=function (value) { + if (_isNullOrUndefined(value)) + return; + var obj=value; + _fixObjectPathIfNecessary(this, obj); + if (!_isUndefined(obj["_ReferenceId"])) { + this.m__ReferenceId=obj["_ReferenceId"]; + } + if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) { + this.m__items=[]; + var _data=obj[OfficeExtension.Constants.items]; + for (var i=0; i < _data.length; i++) { + var _item=new Word.Section(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i])); + _item._handleResult(_data[i]); + this.m__items.push(_item); + } + } + }; + SectionCollection.prototype.load=function (option) { + _load(this, option); + return this; + }; + SectionCollection.prototype._initReferenceId=function (value) { + this.m__ReferenceId=value; + }; + return SectionCollection; + })(OfficeExtension.ClientObject); + Word.SectionCollection=SectionCollection; + var ContentControlType; + (function (ContentControlType) { + ContentControlType.richText="RichText"; + })(ContentControlType=Word.ContentControlType || (Word.ContentControlType={})); + var ContentControlAppearance; + (function (ContentControlAppearance) { + ContentControlAppearance.boundingBox="BoundingBox"; + ContentControlAppearance.tags="Tags"; + ContentControlAppearance.hidden="Hidden"; + })(ContentControlAppearance=Word.ContentControlAppearance || (Word.ContentControlAppearance={})); + var UnderlineType; + (function (UnderlineType) { + UnderlineType.none="None"; + UnderlineType.single="Single"; + UnderlineType.word="Word"; + UnderlineType.double="Double"; + UnderlineType.dotted="Dotted"; + UnderlineType.hidden="Hidden"; + UnderlineType.thick="Thick"; + UnderlineType.dashLine="DashLine"; + UnderlineType.dotLine="DotLine"; + UnderlineType.dotDashLine="DotDashLine"; + UnderlineType.twoDotDashLine="TwoDotDashLine"; + UnderlineType.wave="Wave"; + })(UnderlineType=Word.UnderlineType || (Word.UnderlineType={})); + var BreakType; + (function (BreakType) { + BreakType.page="Page"; + BreakType.column="Column"; + BreakType.next="Next"; + BreakType.sectionContinuous="SectionContinuous"; + BreakType.sectionEven="SectionEven"; + BreakType.sectionOdd="SectionOdd"; + BreakType.line="Line"; + BreakType.lineClearLeft="LineClearLeft"; + BreakType.lineClearRight="LineClearRight"; + BreakType.textWrapping="TextWrapping"; + })(BreakType=Word.BreakType || (Word.BreakType={})); + var InsertLocation; + (function (InsertLocation) { + InsertLocation.before="Before"; + InsertLocation.after="After"; + InsertLocation.start="Start"; + InsertLocation.end="End"; + InsertLocation.replace="Replace"; + })(InsertLocation=Word.InsertLocation || (Word.InsertLocation={})); + var Alignment; + (function (Alignment) { + Alignment.unknown="Unknown"; + Alignment.left="Left"; + Alignment.centered="Centered"; + Alignment.right="Right"; + Alignment.justified="Justified"; + })(Alignment=Word.Alignment || (Word.Alignment={})); + var HeaderFooterType; + (function (HeaderFooterType) { + HeaderFooterType.primary="Primary"; + HeaderFooterType.firstPage="FirstPage"; + HeaderFooterType.evenPages="EvenPages"; + })(HeaderFooterType=Word.HeaderFooterType || (Word.HeaderFooterType={})); + var ErrorCodes; + (function (ErrorCodes) { + ErrorCodes.accessDenied="AccessDenied"; + ErrorCodes.generalException="GeneralException"; + ErrorCodes.invalidArgument="InvalidArgument"; + ErrorCodes.itemNotFound="ItemNotFound"; + ErrorCodes.notImplemented="NotImplemented"; + })(ErrorCodes=Word.ErrorCodes || (Word.ErrorCodes={})); +})(Word || (Word={})); +var Word; +(function (Word) { + var RequestContext=(function (_super) { + __extends(RequestContext, _super); + function RequestContext(url) { + _super.call(this, url); + this.m_document=new Word.Document(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this)); + this._rootObject=this.m_document; + } + Object.defineProperty(RequestContext.prototype, "document", { + get: function () { + return this.m_document; + }, + enumerable: true, + configurable: true + }); + return RequestContext; + })(OfficeExtension.ClientRequestContext); + Word.RequestContext=RequestContext; + function run(batch) { + return OfficeExtension.ClientRequestContext._run(function () { return new Word.RequestContext(); }, batch); + } + Word.run=run; +})(Word || (Word={})); + + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-win32-16.00.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-win32-16.00.js new file mode 100644 index 000000000..107eea243 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/word-win32-16.00.js @@ -0,0 +1,19 @@ +/* Word specific JavaScript API library */ +/* Version: 16.0.6216.3006 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +/* +* @overview es6-promise - a tiny implementation of Promises/A+. +* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) +* @license Licensed under MIT license +* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE +* @version 2.3.0 +*/ + +var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},OsfMsAjaxFactory,OSF,msAjaxCDNPath,OSFRichclient,OfficeExt,OSFLog,Logger,OSFAppTelemetry,OfficeExtension,Word;(function(n){var t=function(){function t(){}var i=null,n=!0;return t.prototype.isMsAjaxLoaded=function(){var t="function",i="undefined";return typeof Sys!==i&&typeof Type!==i&&Sys.StringBuilder&&typeof Sys.StringBuilder===t&&Type.registerNamespace&&typeof Type.registerNamespace===t&&Type.registerClass&&typeof Type.registerClass===t&&typeof Function._validateParams===t?n:!1},t.prototype.loadMsAjaxFull=function(n){var t=(window.location.protocol.toLowerCase()==="https:"?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(t,n)},Object.defineProperty(t.prototype,"msAjaxError",{get:function(){var n=this;return n._msAjaxError==i&&n.isMsAjaxLoaded()&&(n._msAjaxError=Error),n._msAjaxError},set:function(n){this._msAjaxError=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxSerializer",{get:function(){var n=this;return n._msAjaxSerializer==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer),n._msAjaxSerializer},set:function(n){this._msAjaxSerializer=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxString",{get:function(){var n=this;return n._msAjaxString==i&&n.isMsAjaxLoaded()&&(n._msAjaxSerializer=String),n._msAjaxString},set:function(n){this._msAjaxString=n},enumerable:n,configurable:n}),Object.defineProperty(t.prototype,"msAjaxDebug",{get:function(){var n=this;return n._msAjaxDebug==i&&n.isMsAjaxLoaded()&&(n._msAjaxDebug=Sys.Debug),n._msAjaxDebug},set:function(n){this._msAjaxDebug=n},enumerable:n,configurable:n}),t}();n.MicrosoftAjaxFactory=t})(OfficeExt||(OfficeExt={}));OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory;OSF=OSF||{},function(n){var t=function(){function n(n){this._internalStorage=n}return n.prototype.getItem=function(n){try{return this._internalStorage&&this._internalStorage.getItem(n)}catch(t){return null}},n.prototype.setItem=function(n,t){try{this._internalStorage&&this._internalStorage.setItem(n,t)}catch(i){}},n.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(n){}},n.prototype.removeItem=function(n){try{this._internalStorage&&this._internalStorage.removeItem(n)}catch(t){}},n.prototype.getKeysWithPrefix=function(n){var r=[],u,t,i;try{for(u=this._internalStorage&&this._internalStorage.length||0,t=0;t1?s[s.length-1]:t,h=d(),e,o,c;return!r&&h&&(e=window.name.indexOf(i),e>-1&&(o=window.name.indexOf(";",e),o==-1&&(o=window.name.length),c=window.name.substring(e,o),f?h.setItem(c,f):f=h.getItem(c))),f},getConversationId:function(){var i=window.location.search,n=t,r;return i&&(r=i.indexOf("&"),n=r>0?i.substring(1,r):i.substr(1),n&&n.charAt(n.length-1)==="="&&(n=n.substring(0,n.length-1),n&&(n=decodeURIComponent(n)))),n},getInfoItems:function(n){var t=n.split("$");return typeof t[1]==e&&(t=n.split("|")),t},getConversationUrl:function(){var t="",r=OSF.OUtil.parseXdmInfo(i),n;return r&&(n=OSF.OUtil.getInfoItems(r),n!=undefined&&n.length>=3&&(t=n[2])),t},validateParamObject:function(t,r){var u=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:n},{name:"expectedProperties",type:Object,mayBeNull:n},{name:"callback",type:Function,mayBeNull:i}]),f;if(u)throw u;for(f in r)if(u=Function._validateParameter(t[f],r[f],f),u)throw u;},writeProfilerMark:function(n){window.msWriteProfilerMark&&(window.msWriteProfilerMark(n),OsfMsAjaxFactory.msAjaxDebug.trace(n))},outputDebug:function(n){typeof Sys!==e&&Sys&&Sys.Debug&&OsfMsAjaxFactory.msAjaxDebug.trace(n)},defineNondefaultProperty:function(n,t,r,u){var e,f;r=r||{};for(e in u)f=u[e],r[f]==undefined&&(r[f]=i);return Object.defineProperty(n,t,r),n},defineNondefaultProperties:function(n,t,i){t=t||{};for(var r in t)OSF.OUtil.defineNondefaultProperty(n,r,t[r],i);return n},defineEnumerableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[f])},defineEnumerableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[f])},defineMutableProperty:function(n,t,i){return OSF.OUtil.defineNondefaultProperty(n,t,i,[y,f,v])},defineMutableProperties:function(n,t){return OSF.OUtil.defineNondefaultProperties(n,t,[y,f,v])},finalizeProperties:function(t,r){var e,u;r=r||{};for(var o=Object.getOwnPropertyNames(t),s=o.length,f=0;f>8,f=e&255,i[t++]=r>>2,i[t++]=(r&3)<<4|u>>4,i[t++]=(u&15)<<2|f>>6,i[t++]=f&63,isNaN(e)||(r=e>>8,u=s&255,f=s>>8,i[t++]=r>>2,i[t++]=(r&3)<<4|u>>4,i[t++]=(u&15)<<2|f>>6,i[t++]=f&63),isNaN(e)?i[t-1]=64:isNaN(s)&&(i[t-2]=64,i[t-1]=64),h=0;h0;t++)(t==8||t==12||t==16||t==20)&&(i+="-"),i+=n[r%16],r=Math.floor(r/16);for(;t<32;t++)(t==8||t==12||t==16||t==20)&&(i+="-"),i+=n[Math.floor(Math.random()*16)];return i}}}();window.OSF=OSF;OSF.OUtil.setNamespace("OSF",window);OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072};OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"};OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"};OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8};OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"};OSF.OfficeAppContext=function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){var b=this;b._id=n;b._appName=t;b._appVersion=i;b._appUILocale=r;b._dataLocale=u;b._docUrl=f;b._clientMode=e;b._settings=o;b._reason=s;b._osfControlType=h;b._eToken=c;b._correlationId=l;b._appInstanceId=a;b._touchEnabled=v;b._commerceAllowed=y;b._appMinorVersion=p;b._requirementMatrix=w;b.get_id=function(){return this._id};b.get_appName=function(){return this._appName};b.get_appVersion=function(){return this._appVersion};b.get_appUILocale=function(){return this._appUILocale};b.get_dataLocale=function(){return this._dataLocale};b.get_docUrl=function(){return this._docUrl};b.get_clientMode=function(){return this._clientMode};b.get_bindings=function(){return this._bindings};b.get_settings=function(){return this._settings};b.get_reason=function(){return this._reason};b.get_osfControlType=function(){return this._osfControlType};b.get_eToken=function(){return this._eToken};b.get_correlationId=function(){return this._correlationId};b.get_appInstanceId=function(){return this._appInstanceId};b.get_touchEnabled=function(){return this._touchEnabled};b.get_commerceAllowed=function(){return this._commerceAllowed};b.get_appMinorVersion=function(){return this._appMinorVersion};b.get_requirementMatrix=function(){return this._requirementMatrix}};OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1};OSF.ClientMode={ReadOnly:0,ReadWrite:1};OSF.OUtil.setNamespace("Microsoft",window);OSF.OUtil.setNamespace("Office",Microsoft);OSF.OUtil.setNamespace("Client",Microsoft.Office);OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened"};Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"};Microsoft.Office.WebExtension.FilterType={All:"all"};Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",ImageLeft:"imageLeft",ImageTop:"imageTop",ImageWidth:"imageWidth",ImageHeight:"imageHeight",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex"};OSF.OUtil.setNamespace("DDA",OSF);OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0};OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"};OSF.DDA.EventDescriptors={};OSF.DDA.ListDescriptors={};OSF.DDA.getXdmEventName=function(n,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged?n+"_"+t:t};OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidMethodMax:141,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123};OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidActivationStatusChangedEvent:32,dispidAppCommandInvokedEvent:39,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63};OSF.DDA.ErrorCodeManager=function(){var n={};return{getErrorArgs:function(t){return n[t]||n[this.errorCodes.ooeInternalError]},addErrorMessage:function(t,i){n[t]=i},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101},initializeErrorMessages:function(t){n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:t.L_APICallFailed,message:t.L_ActivityLimitReached};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:t.L_CustomXmlError,message:t.L_CustomXmlError};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile};n[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported}}}}(),function(n){(function(n){var t=1.1,r=function(){function n(n){this.isSetSupported=function(n,t){var u,i,r;return n==undefined?!1:(t==undefined&&(t=0),u=this._setMap,i=u._sets,i.hasOwnProperty(n.toLowerCase())?(r=i[n.toLowerCase()],r>0&&r>=t):!1)};this._setMap=n}return n}(),i,f,e,o,s,h,c,l,a,u,v,y,p,w,b,k,d;n.RequirementMatrix=r;i=function(){function n(n){this._sets=n}return n}();n.DefaultSetRequirement=i;f=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,excelapi:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t})}return __extends(i,n),i}(i);n.ExcelClientDefaultSetRequirement=f;e=function(n){function t(){n.call(this,{mailbox:1.3})}return __extends(t,n),t}(i);n.OutlookClientDefaultSetRequirement=e;o=function(n){function i(){n.call(this,{bindingevents:t,compressedfile:t,customxmlparts:t,documentevents:t,file:t,htmlcoercion:t,matrixbindings:t,matrixcoercion:t,ooxmlcoercion:t,pdffile:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,textfile:t,wordapi:t})}return __extends(i,n),i}(i);n.WordClientDefaultSetRequirement=o;s=function(n){function i(){n.call(this,{activeview:t,compressedfile:t,documentevents:t,file:t,pdffile:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.PowerpointClientDefaultSetRequirement=s;h=function(n){function i(){n.call(this,{selection:t,textcoercion:t})}return __extends(i,n),i}(i);n.ProjectClientDefaultSetRequirement=h;c=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,file:t})}return __extends(i,n),i}(i);n.ExcelWebDefaultSetRequirement=c;l=function(n){function i(){n.call(this,{customxmlparts:t,documentevents:t,file:t,ooxmlcoercion:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.WordWebDefaultSetRequirement=l;a=function(n){function i(){n.call(this,{activeview:t,settings:t})}return __extends(i,n),i}(i);n.PowerpointWebDefaultSetRequirement=a;u=function(n){function t(){n.call(this,{mailbox:1.3})}return __extends(t,n),t}(i);n.OutlookWebDefaultSetRequirement=u;v=function(n){function i(){n.call(this,{activeview:t,documentevents:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.SwayWebDefaultSetRequirement=v;y=function(n){function i(){n.call(this,{bindingevents:t,partialtablebindings:t,settings:t,tablebindings:t,tablecoercion:t})}return __extends(i,n),i}(i);n.AccessWebDefaultSetRequirement=y;p=function(n){function i(){n.call(this,{bindingevents:t,documentevents:t,matrixbindings:t,matrixcoercion:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t})}return __extends(i,n),i}(i);n.ExcelIOSDefaultSetRequirement=p;w=function(n){function i(){n.call(this,{bindingevents:t,compressedfile:t,customxmlparts:t,documentevents:t,file:t,htmlcoercion:t,matrixbindings:t,matrixcoercion:t,ooxmlcoercion:t,pdffile:t,selection:t,settings:t,tablebindings:t,tablecoercion:t,textbindings:t,textcoercion:t,textfile:t})}return __extends(i,n),i}(i);n.WordIOSDefaultSetRequirement=w;b=function(n){function i(){n.call(this,{activeview:t,compressedfile:t,documentevents:t,file:t,pdffile:t,selection:t,settings:t,textcoercion:t})}return __extends(i,n),i}(i);n.PowerpointIOSDefaultSetRequirement=b;k=function(n){function i(){n.call(this,{mailbox:t})}return __extends(i,n),i}(i);n.OutlookIOSDefaultSetRequirement=k;d=function(){function n(){}return n.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)},n.getDefaultRequirementMatrix=function(t){var u,s,f,e,h,o;return this.initializeDefaultSetMatrix(),u=undefined,t.get_requirementMatrix()!=undefined&&typeof JSON!="undefined"?(s=JSON.parse(t.get_requirementMatrix()),u=new r(new i(s))):(f=t.get_appMinorVersion(),e="",e=f<10?"0"+f:""+f,h=t.get_appVersion()+"."+e,o=t.get_appName()+"-"+h,u=n.DefaultSetArrayMatrix!=undefined&&n.DefaultSetArrayMatrix[o]!=undefined?new r(n.DefaultSetArrayMatrix[o]):new r(new i({}))),u},n.initializeDefaultSetMatrix=function(){n.DefaultSetArrayMatrix[n.Excel_RCLIENT_1600]=new f;n.DefaultSetArrayMatrix[n.Word_RCLIENT_1600]=new o;n.DefaultSetArrayMatrix[n.PowerPoint_RCLIENT_1600]=new s;n.DefaultSetArrayMatrix[n.Outlook_RCLIENT_1600]=new e;n.DefaultSetArrayMatrix[n.Excel_WAC_1600]=new c;n.DefaultSetArrayMatrix[n.Word_WAC_1600]=new l;n.DefaultSetArrayMatrix[n.Outlook_WAC_1600]=new u;n.DefaultSetArrayMatrix[n.Outlook_WAC_1601]=new u;n.DefaultSetArrayMatrix[n.Project_RCLIENT_1600]=new h;n.DefaultSetArrayMatrix[n.Access_WAC_1600]=new y;n.DefaultSetArrayMatrix[n.PowerPoint_WAC_1600]=new a;n.DefaultSetArrayMatrix[n.Excel_IOS_1600]=new p;n.DefaultSetArrayMatrix[n.SWAY_WAC_1600]=new v;n.DefaultSetArrayMatrix[n.Word_IOS_1600]=new w;n.DefaultSetArrayMatrix[n.PowerPoint_IOS_1600]=new b;n.DefaultSetArrayMatrix[n.Outlook_IOS_1600]=new k},n.Excel_RCLIENT_1600="1-16.00",n.Word_RCLIENT_1600="2-16.00",n.PowerPoint_RCLIENT_1600="4-16.00",n.Outlook_RCLIENT_1600="8-16.00",n.Excel_WAC_1600="16-16.00",n.Word_WAC_1600="32-16.00",n.Outlook_WAC_1600="64-16.00",n.Outlook_WAC_1601="64-16.01",n.Project_RCLIENT_1600="128-16.00",n.Access_WAC_1600="256-16.00",n.PowerPoint_WAC_1600="512-16.00",n.Excel_IOS_1600="1024-16.01",n.SWAY_WAC_1600="2048-16.00",n.Word_IOS_1600="4096-16.00",n.PowerPoint_IOS_1600="8192-16.00",n.Outlook_IOS_1600="65536-16.00",n.DefaultSetArrayMatrix={},n}();n.RequirementsMatrixFactory=d})(n.Requirement||(n.Requirement={}));var t=n.Requirement}(OfficeExt||(OfficeExt={}));OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"};Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"};OSF.NamespaceManager=function(){var t,n=!1;return{enableShortcut:function(){n||(window.Office?t=window.Office:OSF.OUtil.setNamespace("Office",window),window.Office=Microsoft.Office.WebExtension,n=!0)},disableShortcut:function(){n&&(t?window.Office=t:OSF.OUtil.unsetNamespace("Office",window),n=!1)}}}();OSF.NamespaceManager.enableShortcut();Microsoft.Office.WebExtension.useShortNamespace=function(n){n?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()};Microsoft.Office.WebExtension.select=function(n,t){var i,r,o,u,f,e;if(n&&typeof n=="string"&&(r=n.indexOf("#"),r!=-1)){o=n.substring(0,r);u=n.substring(r+1);switch(o){case"binding":case"bindings":u&&(i=new OSF.DDA.BindingPromise(u))}}if(i)return i.onFail=t,i;else if(t)if(f=typeof t,f=="function")e={},e[Microsoft.Office.WebExtension.Parameters.Callback]=t,OSF.DDA.issueAsyncResult(e,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));else throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,f);};OSF.DDA.Context=function(n,t,i,r,u){var f=this,e,o;OSF.OUtil.defineEnumerableProperties(f,{contentLanguage:{value:n.get_dataLocale()},displayLanguage:{value:n.get_appUILocale()},touchEnabled:{value:n.get_touchEnabled()},commerceAllowed:{value:n.get_commerceAllowed()}});t&&OSF.OUtil.defineEnumerableProperty(f,"document",{value:t});i&&OSF.OUtil.defineEnumerableProperty(f,"license",{value:i});r&&(e=r.displayName||"appOM",delete r.displayName,OSF.OUtil.defineEnumerableProperty(f,e,{value:r}));u&&OSF.OUtil.defineEnumerableProperty(f,"officeTheme",{get:function(){return u()}});o=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(n);OSF.OUtil.defineEnumerableProperty(f,"requirements",{value:o})};OSF.DDA.OutlookContext=function(n,t,i,r,u){OSF.DDA.OutlookContext.uber.constructor.call(this,n,null,i,r,u);t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})};OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);OSF.DDA.OutlookAppOm=function(){};OSF.DDA.Document=function(n,t){var i;switch(n.get_clientMode()){case OSF.ClientMode.ReadOnly:i=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:i=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t});OSF.OUtil.defineMutableProperties(this,{mode:{value:i},url:{value:n.get_docUrl()}})};OSF.DDA.JsomDocument=function(n,t,i){var r=this,u;OSF.DDA.JsomDocument.uber.constructor.call(r,n,i);t&&OSF.OUtil.defineEnumerableProperty(r,"bindings",{get:function(){return t}});u=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(r,[u.GetSelectedDataAsync,u.SetSelectedDataAsync]);OSF.DDA.DispIdHost.addEventSupport(r,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))};OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var n;return OSF&&OSF._OfficeAppFactory&&(n=OSF._OfficeAppFactory.getContext()),n}});OSF.DDA.License=function(n){OSF.OUtil.defineEnumerableProperty(this,"value",{value:n})};OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"};Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"};OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1};OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"};OSF.DDA.AsyncMethodNames={};OSF.DDA.AsyncMethodNames.addNames=function(n){var t,i;for(t in n)i={},OSF.OUtil.defineEnumerableProperties(i,{id:{value:t},displayName:{value:n[t]}}),OSF.DDA.AsyncMethodNames[t]=i};OSF.DDA.AsyncMethodCall=function(n,t,i,r,u,f,e){function c(n,t){var u,i,r;for(u in n){if(i=n[u],r=t[u],i["enum"])switch(typeof r){case"string":if(OSF.OUtil.listContainsValue(i["enum"],r))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;break;default:throw s();}if(i.types&&!OSF.OUtil.listContainsValue(i.types,typeof r))throw s();}}function l(t,i,r){var f,u,h,e,l,a;if(t.lengtho+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(a=n.length-1;a>=o;a--){v=n[a];switch(typeof v){case"object":if(f)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);else f=v;break;case h:if(l)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);else l=v;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);}}f=f||{};for(y in t)OSF.OUtil.listContainsKey(f,y)||(e=undefined,s=t[y],s.calculate&&i&&(e=s.calculate(i,r,u)),e||s.defaultValue===undefined||(e=s.defaultValue),f[y]=e);if(l)if(f[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;else f[Microsoft.Office.WebExtension.Parameters.Callback]=l;return c(t,f),f}var h="function",o=n.length,s=OSF.OUtil.delayExecutionAndCache(function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,e)});this.verifyAndExtractCall=function(n,t,r){var e=l(n,t,r),c=a(n,e,t,r),u={},o,s,h;for(o in e)u[o]=e[o];for(s in c)u[s]=c[s];for(h in i)u[h]=i[h](t,r);return f&&(u=f(u,t,r)),u};this.processResponse=function(n,t,i,f){return n==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?r?r(t,i,f):t:u?u(n,t):OSF.DDA.ErrorCodeManager.getErrorArgs(n)};this.getCallArgs=function(n){for(var t,u,r,i=n.length-1;i>=o;i--){r=n[i];switch(typeof r){case"object":t=r;break;case h:u=r}}return t=t||{},u&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=u),t}};OSF.DDA.AsyncMethodCallFactory=function(){function n(n){var i=null,r,t;if(n)for(i={},r=n.length,t=0;t0&&t.push(u)}}catch(s){}return t}var i=[],t={};t[Microsoft.Office.WebExtension.Parameters.Data]=function(){var t=0,i=1;return{toHost:function(n){if(typeof n!="string"&&n[OSF.DDA.TableDataProperties.TableRows]!==undefined){var r=[];r[t]=n[OSF.DDA.TableDataProperties.TableRows];r[i]=n[OSF.DDA.TableDataProperties.TableHeaders];n=r}return n},fromHost:function(r){var f,e,u;return r.toArray?(e=r.dimensions(),e===2?f=n(r):(u=r.toArray(),u.length===2&&(u[0]!=null&&u[0].toArray||u[1]!=null&&u[1].toArray)?(f={},f[OSF.DDA.TableDataProperties.TableRows]=n(u[t]),f[OSF.DDA.TableDataProperties.TableHeaders]=n(u[i])):f=u)):f=r,f}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,i,t);this.unpack=function(n,i){var r,u;return this.isComplexType(n)||OSF.DDA.ListType.isListType(n)?(u=(i||typeof i=="unknown")&&i.toArray,r=u?i.toArray():i||{}):r=this.isDynamicType(n)?t[n].fromHost(i):i,r}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{type:Microsoft.Office.WebExtension.Parameters.ValueFormat,toHost:[{name:Microsoft.Office.WebExtension.ValueFormat.Unformatted,value:0},{name:Microsoft.Office.WebExtension.ValueFormat.Formatted,value:1}]},{type:Microsoft.Office.WebExtension.Parameters.FilterType,toHost:[{name:Microsoft.Office.WebExtension.FilterType.All,value:0}]}]);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.AsyncResultStatus,fromHost:[{name:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,value:0},{name:Microsoft.Office.WebExtension.AsyncResultStatus.Failed,value:1}]});OSF.DDA.SafeArray.Delegate.executeAsync=function(n){function t(n){var i=n,f,r,u;if(OSF.OUtil.isArray(n))for(f=i.length,r=0;r2)for(u=[],o=1;o40)&&(n=OSF.OUtil.Guid.generateNewGuid(),t.setValue(t.clientIDKey,n)),n},n.prototype.saveLog=function(n,t){var i=this,r=i.getValue(i.logIdSetKey);r=(r&&r.length>0?r+";":"")+n;i.setValue(i.logIdSetKey,r);i.setValue(n,t)},n.prototype.enumerateLog=function(n,t){var i=this,e=i.getValue(i.logIdSetKey),u,o,r,f;if(e){u=e.split(";");for(o in u)r=u[o],f=i.getValue(r),f&&(n&&n(r,f),t&&i.remove(r));t&&i.remove(i.logIdSetKey)}},n.prototype.getValue=function(n){var t=OSF.OUtil.getLocalStorage(),i="";return t&&(i=t.getItem(n)),i},n.prototype.setValue=function(n,t){var i=OSF.OUtil.getLocalStorage();i&&i.setItem(n,t)},n.prototype.remove=function(n){var t=OSF.OUtil.getLocalStorage();if(t)try{t.removeItem(n)}catch(i){}},n}(),f=function(){function n(){}return n.prototype.LogData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n.SerializeRow(),OSF.Logger.SendFlag.none)},n.prototype.LogRawData=function(n){OSF.Logger&&OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,n,OSF.Logger.SendFlag.none)},n}();n.initialize=c;n.onAppActivated=l;n.onScriptDone=a;n.onCallDone=v;n.onMethodDone=y;n.onPropertyDone=p;n.onEventDone=w;n.onRegisterDone=b;n.onAppClosed=k;n.setOsfControlAppCorrelationId=d;n.doAppInitializationLogging=s;n.logAppCommonMessage=g;n.logAppException=nt;OSF.AppTelemetry=n}(OSFAppTelemetry||(OSFAppTelemetry={}));Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed",Pdf:"pdf"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FileProperties:"FileProperties",FileSliceProperties:"FileSliceProperties"});OSF.DDA.FileProperties={Handle:"FileHandle",FileSize:"FileSize",SliceSize:Microsoft.Office.WebExtension.Parameters.SliceSize};OSF.DDA.File=function(n,t,i){var r,u;OSF.OUtil.defineEnumerableProperties(this,{size:{value:t},sliceCount:{value:Math.ceil(t/i)}});r={};r[OSF.DDA.FileProperties.Handle]=n;r[OSF.DDA.FileProperties.SliceSize]=i;u=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[u.GetDocumentCopyChunkAsync,u.ReleaseDocumentCopyAsync],r)};OSF.DDA.FileSliceOffset="fileSliceoffset";OSF.DDA.AsyncMethodNames.addNames({GetDocumentCopyAsync:"getFileAsync",GetDocumentCopyChunkAsync:"getSliceAsync",ReleaseDocumentCopyAsync:"closeAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.FileType,"enum":Microsoft.Office.WebExtension.FileType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:{types:["number"],defaultValue:4194304}}],checkCallArgs:function(n){var t=n[Microsoft.Office.WebExtension.Parameters.SliceSize];if(t<=0||t>4194304)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return n},onSucceeded:function(n,t,i){return new OSF.DDA.File(n[OSF.DDA.FileProperties.Handle],n[OSF.DDA.FileProperties.FileSize],i[Microsoft.Office.WebExtension.Parameters.SliceSize])}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(n,t){return t[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(n,t){return t[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(n,t,i){var r=n[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(r<0||r>=t.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;return n[OSF.DDA.FileSliceOffset]=parseInt((r*i[OSF.DDA.FileProperties.SliceSize]).toString()),n},onSucceeded:function(n,t,i){var r={};return OSF.OUtil.defineEnumerableProperties(r,{data:{value:n[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:i[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:n[OSF.DDA.FileProperties.SliceSize]}}),r}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(n,t){return t[OSF.DDA.FileProperties.Handle]}}]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FileType,{Text:"text",Pdf:"pdf"});OSF.DDA.FilePropertiesDescriptor={Url:"Url"};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"});Microsoft.Office.WebExtension.FileProperties=function(n){OSF.OUtil.defineEnumerableProperties(this,{url:{value:n[OSF.DDA.FilePropertiesDescriptor.Url]}})};OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(n){return new Microsoft.Office.WebExtension.FileProperties(n)}});Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"};Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"};Microsoft.Office.WebExtension.Index={First:"first",Last:"last",Next:"next",Previous:"previous"};OSF.DDA.AsyncMethodNames.addNames({GoToByIdAsync:"goToByIdAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GoToByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string","number"]},{name:Microsoft.Office.WebExtension.Parameters.GoToType,"enum":Microsoft.Office.WebExtension.GoToType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:{"enum":Microsoft.Office.WebExtension.SelectionMode,defaultValue:Microsoft.Office.WebExtension.SelectionMode.Default}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:0},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:1},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:2},{name:Microsoft.Office.WebExtension.GoToType.Index,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:0},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:1},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:1},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileProperties.FileSize,value:1}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:0},{name:OSF.DDA.FileProperties.SliceSize,value:1}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:0},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:5},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:6}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:0}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0},{name:OSF.DDA.FileSliceOffset,value:1},{name:OSF.DDA.FileProperties.SliceSize,value:2}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:0}]});OSF.DDA.AsyncMethodNames.addNames({GetSelectedDataAsync:"getSelectedDataAsync",SetSelectedDataAsync:"setSelectedDataAsync"}),function(){function r(n,t,i){var r=n[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&r&&(r[OSF.DDA.TableDataProperties.TableRows]!=undefined||r[OSF.DDA.TableDataProperties.TableHeaders]!=undefined)&&(r=OSF.DDA.OMFactory.manufactureTableData(r)),r=OSF.DDA.DataCoercion.coerceData(r,i[Microsoft.Office.WebExtension.Parameters.CoercionType]),r==undefined?null:r}var i=!1,n="boolean",t="number";OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,"enum":Microsoft.Office.WebExtension.CoercionType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}}],privateStateCallbacks:[],onSucceeded:r});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object",t,n]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.ImageLeft,value:{types:[t,n],defaultValue:i}},{name:Microsoft.Office.WebExtension.Parameters.ImageTop,value:{types:[t,n],defaultValue:i}},{name:Microsoft.Office.WebExtension.Parameters.ImageWidth,value:{types:[t,n],defaultValue:i}},{name:Microsoft.Office.WebExtension.Parameters.ImageHeight,value:{types:[t,n],defaultValue:i}}],privateStateCallbacks:[]})}();OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:1},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:2}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1},{name:Microsoft.Office.WebExtension.Parameters.ImageLeft,value:2},{name:Microsoft.Office.WebExtension.Parameters.ImageTop,value:3},{name:Microsoft.Office.WebExtension.Parameters.ImageWidth,value:4},{name:Microsoft.Office.WebExtension.Parameters.ImageHeight,value:5}]});OSF.DDA.SettingsManager={SerializedSettings:"serializedSettings",DateJSONPrefix:"Date(",DataJSONSuffix:")",serializeSettings:function(n){var r={},i,t;for(i in n){t=n[i];try{t=JSON?JSON.stringify(t,function(n,t){return OSF.OUtil.isDate(this[n])?OSF.DDA.SettingsManager.DateJSONPrefix+this[n].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix:t}):Sys.Serialization.JavaScriptSerializer.serialize(t);r[i]=t}catch(u){}}return r},deserializeSettings:function(n){var r={},i,t;n=n||{};for(i in n){t=n[i];try{t=JSON?JSON.parse(t,function(n,t){var i;return typeof t=="string"&&t&&t.length>6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix&&(i=new Date(parseInt(t.slice(5,-1))),i)?i:t}):Sys.Serialization.JavaScriptSerializer.deserialize(t,!0);r[i]=t}catch(u){}}return r}};OSF.DDA.Settings=function(n){var t="name",i;n=n||{};i=function(n){var i=OSF.OUtil.getSessionStorage(),t,r;i&&(t=OSF.DDA.SettingsManager.serializeSettings(n),r=JSON?JSON.stringify(t):Sys.Serialization.JavaScriptSerializer.serialize(t),i.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),r))};OSF.OUtil.defineEnumerableProperties(this,{get:{value:function(i){var u=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1}]),r;if(u)throw u;return r=n[i],typeof r=="undefined"?null:r}},set:{value:function(r,u){var f=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1},{name:"value",mayBeNull:!0}]);if(f)throw f;n[r]=u;i(n)}},remove:{value:function(r){var u=Function._validateParams(arguments,[{name:t,type:String,mayBeNull:!1}]);if(u)throw u;delete n[r];i(n)}}});OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],n)};OSF.DDA.RefreshableSettings=function(n){OSF.DDA.RefreshableSettings.uber.constructor.call(this,n);OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],n);OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))};OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings);Microsoft.Office.WebExtension.EventType={};OSF.EventDispatch=function(n){var t,i;this._eventHandlers={};for(t in n)i=n[t],this._eventHandlers[i]=[]};OSF.EventDispatch.prototype={getSupportedEvents:function(){var n=[];for(var t in this._eventHandlers)n.push(t);return n},supportsEvent:function(n){var t=!1;for(var i in this._eventHandlers)if(n==i){t=!0;break}return t},hasEventHandler:function(n,t){var i=this._eventHandlers[n],r;if(i&&i.length>0)for(r in i)if(i[r]===t)return!0;return!1},addEventHandler:function(n,t){if(typeof t!="function")return!1;var i=this._eventHandlers[n];return i&&!this.hasEventHandler(n,t)?(i.push(t),!0):!1},removeEventHandler:function(n,t){var i=this._eventHandlers[n],r;if(i&&i.length>0)for(r=0;r0?(this._eventHandlers[n]=[],!0):!1},getEventHandlerCount:function(n){return this._eventHandlers[n]!=undefined?this._eventHandlers[n].length:-1},fireEvent:function(n){var t,i,r;if(n.type==undefined)return!1;if(t=n.type,t&&this._eventHandlers[t]){i=this._eventHandlers[t];for(r in i)i[r](n);return!0}else return!1}};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureEventArgs=function(n,t,i){var u=this,r;switch(n){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:r=new OSF.DDA.DocumentSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:r=new OSF.DDA.BindingSelectionChangedEventArgs(u.manufactureBinding(i,t.document),i[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:r=new OSF.DDA.BindingDataChangedEventArgs(u.manufactureBinding(i,t.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:r=new OSF.DDA.SettingsChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:r=new OSF.DDA.ActiveViewChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:r=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:r=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(i);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:r=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(i);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:r=new OSF.DDA.NodeInsertedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:r=new OSF.DDA.NodeReplacedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NewNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:r=new OSF.DDA.NodeDeletedEventArgs(u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.OldNode]),u.manufactureDataNode(i[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),i[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:r=new OSF.DDA.TaskSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:r=new OSF.DDA.ResourceSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:r=new OSF.DDA.ViewSelectionChangedEventArgs(t);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,n));}return r};OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,"enum":Microsoft.Office.WebExtension.EventType,verify:function(n,t,i){return i.supportsEvent(n)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"});OSF.DDA.SettingsChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:n}})};OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n){var t=n[OSF.DDA.SettingsManager.SerializedSettings];return OSF.DDA.SettingsManager.deserializeSettings(t)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:!0}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(n,t){return OSF.DDA.SettingsManager.serializeSettings(t)}}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.SettingsManager.SerializedSettings},{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent});Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"};OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType};OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"});OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"});OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties);OSF.DDA.BindingPromise=function(n,t){this._id=n;OSF.OUtil.defineEnumerableProperty(this,"onFail",{get:function(){return t},set:function(n){var i=typeof n;if(i!="undefined"&&i!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,i);t=n}})};OSF.DDA.BindingPromise.prototype={_fetch:function(n){var t=this,i;return t.binding?n&&n(t.binding):t._binding||(i=t,Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(t._id,function(t){t.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded?(OSF.OUtil.defineEnumerableProperty(i,"binding",{value:t.value}),n&&n(i.binding)):i.onFail&&i.onFail(t)})),t},getDataAsync:function(){var n=arguments;return this._fetch(function(t){t.getDataAsync.apply(t,n)}),this},setDataAsync:function(){var n=arguments;return this._fetch(function(t){t.setDataAsync.apply(t,n)}),this},addHandlerAsync:function(){var n=arguments;return this._fetch(function(t){t.addHandlerAsync.apply(t,n)}),this},removeHandlerAsync:function(){var n=arguments;return this._fetch(function(t){t.removeHandlerAsync.apply(t,n)}),this}};OSF.DDA.BindingFacade=function(n){this._eventDispatches=[];OSF.OUtil.defineEnumerableProperty(this,"document",{value:n});var t=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[t.AddFromSelectionAsync,t.AddFromNamedItemAsync,t.GetAllAsync,t.GetByIdAsync,t.ReleaseByIdAsync])};OSF.DDA.UnknownBinding=function(n,t){OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:n}})};OSF.DDA.Binding=function(n,t){var r,u,i,f;OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:n}});r=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[r.GetDataAsync,r.SetDataAsync]);u=Microsoft.Office.WebExtension.EventType;i=t.bindings._eventDispatches;i[n]||(i[n]=new OSF.EventDispatch([u.BindingSelectionChanged,u.BindingDataChanged]));f=i[n];OSF.DDA.DispIdHost.addEventSupport(this,f)};OSF.DDA.generateBindingId=function(){return"UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureBinding=function(n,t){var r=n[OSF.DDA.BindingProperties.Id],u=n[OSF.DDA.BindingProperties.RowCount],f=n[OSF.DDA.BindingProperties.ColumnCount],s=n[OSF.DDA.BindingProperties.HasHeaders],i,e,o;switch(n[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:i=new OSF.DDA.TextBinding(r,t);break;case Microsoft.Office.WebExtension.BindingType.Matrix:i=new OSF.DDA.MatrixBinding(r,t,u,f);break;case Microsoft.Office.WebExtension.BindingType.Table:e=function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument};o=e()&&OSF.DDA.ExcelTableBinding?OSF.DDA.ExcelTableBinding:OSF.DDA.TableBinding;i=new o(r,t,u,f,s);break;default:i=new OSF.DDA.UnknownBinding(r,t)}return i};OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"}),function(){function u(n){return OSF.DDA.OMFactory.manufactureBinding(n,Microsoft.Office.WebExtension.context.document)}function f(n){return n.id}function e(n,t,i){var u=n[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&u&&(u[OSF.DDA.TableDataProperties.TableRows]!=undefined||u[OSF.DDA.TableDataProperties.TableHeaders]!=undefined)&&(u=OSF.DDA.OMFactory.manufactureTableData(u)),u=OSF.DDA.DataCoercion.coerceData(u,i[Microsoft.Office.WebExtension.Parameters.CoercionType]),u==undefined?r:u}var t="number",i="object",n="string",r=null;OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[n],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}}],privateStateCallbacks:[],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:[n]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,"enum":Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:[n],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return!0}}],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n){return OSF.OUtil.mapList(n[OSF.DDA.ListDescriptors.BindingList],u)}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[n]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:u});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:[n]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(n,t,i){var r=i[Microsoft.Office.WebExtension.Parameters.Id];delete t._eventDispatches[r]}});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n,t){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{"enum":Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{"enum":Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[i,n],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:[t],defaultValue:0}}],checkCallArgs:function(n,t){if(n[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&n[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&n[Microsoft.Office.WebExtension.Parameters.RowCount]==0&&n[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0&&(delete n[Microsoft.Office.WebExtension.Parameters.StartRow],delete n[Microsoft.Office.WebExtension.Parameters.StartColumn],delete n[Microsoft.Office.WebExtension.Parameters.RowCount],delete n[Microsoft.Office.WebExtension.Parameters.ColumnCount]),n[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[Microsoft.Office.WebExtension.Parameters.StartRow]||n[Microsoft.Office.WebExtension.Parameters.StartColumn]||n[Microsoft.Office.WebExtension.Parameters.RowCount]||n[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}],onSucceeded:e});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:[n,i,t,"boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{"enum":Microsoft.Office.WebExtension.CoercionType,calculate:function(n){return OSF.DDA.DataCoercion.determineCoercionType(n[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:[i,n],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:[i],defaultValue:r}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:[t],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:[t],defaultValue:0}}],checkCallArgs:function(n,t){if(n[Microsoft.Office.WebExtension.Parameters.StartRow]==0&&n[Microsoft.Office.WebExtension.Parameters.StartColumn]==0&&(delete n[Microsoft.Office.WebExtension.Parameters.StartRow],delete n[Microsoft.Office.WebExtension.Parameters.StartColumn]),n[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(n[Microsoft.Office.WebExtension.Parameters.StartRow]||n[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return n},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:f}]})}();OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.MatrixBinding=function(n,t,i,r){OSF.DDA.MatrixBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:i?i:0},columnCount:{value:r?r:0}})};OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding);OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:0},{name:OSF.DDA.BindingProperties.Type,value:1},{name:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,value:2}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:0},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:1},{name:Microsoft.Office.WebExtension.BindingType.Table,value:2}],invertible:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:0},{name:Microsoft.Office.WebExtension.Parameters.Id,value:1},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:2},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:2},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:3},{name:OSF.DDA.PropertyDescriptors.Subset,value:4}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:1},{name:Microsoft.Office.WebExtension.Parameters.Data,value:2},{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:3}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,fromHost:[{name:OSF.DDA.BindingProperties.RowCount,value:0},{name:OSF.DDA.BindingProperties.ColumnCount,value:1},{name:OSF.DDA.BindingProperties.HasHeaders,value:2}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,toHost:[{name:OSF.DDA.SafeArray.UniqueArguments.Offset,value:0},{name:OSF.DDA.SafeArray.UniqueArguments.Run,value:1}],canonical:!0,isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Offset,toHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:0},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:1}],canonical:!0,isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.SafeArray.UniqueArguments.Run,toHost:[{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:0},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:1}],canonical:!0,isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0},{name:Microsoft.Office.WebExtension.Parameters.Data,value:1}]});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:0}]});Microsoft.Office.WebExtension.TableData=function(n,t){function i(n){if(n==null||n==undefined)return null;try{for(var t=OSF.DDA.DataCoercion.findArrayDimensionality(n,2);t<2;t++)n=[n];return n}catch(i){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{get:function(){return t},set:function(n){t=i(n)}},rows:{get:function(){return n},set:function(t){n=t==null||OSF.OUtil.isArray(t)&&t.length==0?[]:i(t)}}});this.headers=t;this.rows=n};OSF.DDA.OMFactory=OSF.DDA.OMFactory||{};OSF.DDA.OMFactory.manufactureTableData=function(n){return new Microsoft.Office.WebExtension.TableData(n[OSF.DDA.TableDataProperties.TableRows],n[OSF.DDA.TableDataProperties.TableHeaders])};OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{TableDataProperties:"TableDataProperties"});OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"});OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"};OSF.DDA.TableBinding=function(n,t,i,r,u){OSF.DDA.TableBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:i?i:0},columnCount:{value:r?r:0},hasHeaders:{value:u?u:!1}});var f=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[f.AddRowsAsync,f.AddColumnsAsync,f.DeleteAllDataValuesAsync])};OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding);OSF.DDA.AsyncMethodNames.addNames({AddRowsAsync:"addRowsAsync",AddColumnsAsync:"addColumnsAsync",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync"}),function(){function n(n){return n.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]});OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:n}]})}();OSF.DDA.TextBinding=function(n,t){OSF.DDA.TextBinding.uber.constructor.call(this,n,t);OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})};OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding);OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"});OSF.DDA.DocumentSelectionChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:n}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"});OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{BindingSelectionChangedEvent:"BindingSelectionChangedEvent"});OSF.DDA.BindingSelectionChangedEventArgs=function(n,t){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:n}});for(var i in t)OSF.OUtil.defineEnumerableProperty(this,i,{value:t[i]})};OSF.DDA.BindingDataChangedEventArgs=function(n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:n}})};OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0},{name:OSF.DDA.PropertyDescriptors.Subset,value:1}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}],isComplexType:!0});OSF.DDA.SafeArray.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.SafeArray.Delegate.ParameterMap.self}]});Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"};OSF.DDA.DataCoercion=function(){var n=null;return{findArrayDimensionality:function(n){if(OSF.OUtil.isArray(n)){for(var t=0,i=0;i0},enumerable:!0,configurable:!0}),t.prototype.addTrace=function(n,t){this.m_traceInfos[n]=t},t.prototype.addReferencedObjectPath=function(t){if(!this.m_referencedObjectPaths[t.objectPathInfo.Id])for(t.isValid||n.Utility.throwError(n.ResourceStrings.invalidObjectPath,n.Utility.getObjectPathExpression(t));t;)t.isWriteOperation&&(this.m_flags=this.m_flags|1),this.m_referencedObjectPaths[t.objectPathInfo.Id]=t,t.objectPathInfo.ObjectPathType==3&&this.addReferencedObjectPaths(t.argumentObjectPaths),t=t.parentObjectPath},t.prototype.addReferencedObjectPaths=function(n){if(n)for(var t=0;t0&&(f=i.substr(0,u),e=i.substr(u+1),f=n.Utility.trim(f),e=n.Utility.trim(e),this.m_responseHeaders[f.toUpperCase()]=e))},t.UNSENT=0,t.OPENED=1,t.DONE=4,t.settings=new i,t}();n.OfficeXHR=t}(OfficeExtension||(OfficeExtension={})),function(n){function i(){n.Promise||t.Init()}n._EnsurePromise=i;var t;(function(t){function i(){(function(){"use strict";function wt(n){return typeof n=="function"||typeof n=="object"&&n!==null}function b(n){return typeof n=="function"}function bt(n){return typeof n=="object"&&n!==null}function kt(n){k=n}function dt(n){f=n}function ti(){var t=process.nextTick,n=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(n)&&n[1]==="0"&&n[2]==="10"&&(t=setImmediate),function(){t(c)}}function ii(){return function(){tt(c)}}function ri(){var n=0,i=new ut(c),t=document.createTextNode("");return i.observe(t,{characterData:!0}),function(){t.data=n=++n%2}}function ui(){var n=new MessageChannel;return n.port1.onmessage=c,function(){n.port2.postMessage(0)}}function ft(){return function(){setTimeout(c,1)}}function c(){for(var t,i,n=0;n0?".":"")+i;break;case 3:i=t.normalizeName(n.objectPathInfo.Name)+"()"+(i.length>0?".":"")+i;break;case 4:i=t.normalizeName(n.objectPathInfo.Name)+(i.length>0?".":"")+i;break;case 5:i="getItem()"+(i.length>0?".":"")+i;break;case 6:i="_reference()"+(i.length>0?".":"")+i;break}n=n.parentObjectPath}return i},t._createPromiseFromResult=function(t){return n._EnsurePromise(),new n.Promise(function(n,i){n(t)})},t._addActionResultHandler=function(n,t,i){n.context._pendingRequest.addActionResultHandler(t,i)},t._handleNavigationPropertyResults=function(n,i,r){for(var u=0;u=WebkitScriptMessaging.MESSAGE_TIME_DELTA)) { + invokePostMessage(); + this.lastMessageTimestamp=currentTimestamp; + } else { + this.lastMessageTimestamp+=WebkitScriptMessaging.MESSAGE_TIME_DELTA; + setTimeout(function () { + invokePostMessage(); + }, this.lastMessageTimestamp - currentTimestamp); + } + return correlationId; + }; + WebkitScriptMessaging.prototype.generateCorrelationId=function () { +++this.callingIndex; + return this.conversationId+this.callingIndex; + }; + WebkitScriptMessaging.getCurrentTimeMS=function () { + return (new Date).getTime(); + }; + WebkitScriptMessaging.MESSAGE_TIME_DELTA=10; + return WebkitScriptMessaging; + })(); + ScriptMessaging.WebkitScriptMessaging=WebkitScriptMessaging; + })(OSFWebkit.ScriptMessaging || (OSFWebkit.ScriptMessaging={})); + var ScriptMessaging=OSFWebkit.ScriptMessaging; +})(OSFWebkit || (OSFWebkit={})); +OSF.ScriptMessaging=OSFWebkit.ScriptMessaging; +var OSFWebkit; +(function (OSFWebkit) { + OSFWebkit.MessageHandlerName="Agave"; + (function (AppContextProperties) { + AppContextProperties[AppContextProperties["Settings"]=0]="Settings"; + AppContextProperties[AppContextProperties["SolutionReferenceId"]=1]="SolutionReferenceId"; + AppContextProperties[AppContextProperties["AppType"]=2]="AppType"; + AppContextProperties[AppContextProperties["MajorVersion"]=3]="MajorVersion"; + AppContextProperties[AppContextProperties["MinorVersion"]=4]="MinorVersion"; + AppContextProperties[AppContextProperties["RevisionVersion"]=5]="RevisionVersion"; + AppContextProperties[AppContextProperties["APIVersionSequence"]=6]="APIVersionSequence"; + AppContextProperties[AppContextProperties["AppCapabilities"]=7]="AppCapabilities"; + AppContextProperties[AppContextProperties["APPUILocale"]=8]="APPUILocale"; + AppContextProperties[AppContextProperties["AppDataLocale"]=9]="AppDataLocale"; + AppContextProperties[AppContextProperties["BindingCount"]=10]="BindingCount"; + AppContextProperties[AppContextProperties["DocumentUrl"]=11]="DocumentUrl"; + AppContextProperties[AppContextProperties["ActivationMode"]=12]="ActivationMode"; + AppContextProperties[AppContextProperties["ControlIntegrationLevel"]=13]="ControlIntegrationLevel"; + AppContextProperties[AppContextProperties["SolutionToken"]=14]="SolutionToken"; + AppContextProperties[AppContextProperties["APISetVersion"]=15]="APISetVersion"; + AppContextProperties[AppContextProperties["CorrelationId"]=16]="CorrelationId"; + AppContextProperties[AppContextProperties["InstanceId"]=17]="InstanceId"; + })(OSFWebkit.AppContextProperties || (OSFWebkit.AppContextProperties={})); + var AppContextProperties=OSFWebkit.AppContextProperties; + (function (MethodId) { + MethodId[MethodId["Execute"]=1]="Execute"; + MethodId[MethodId["RegisterEvent"]=2]="RegisterEvent"; + MethodId[MethodId["UnregisterEvent"]=3]="UnregisterEvent"; + MethodId[MethodId["WriteSettings"]=4]="WriteSettings"; + MethodId[MethodId["GetContext"]=5]="GetContext"; + })(OSFWebkit.MethodId || (OSFWebkit.MethodId={})); + var MethodId=OSFWebkit.MethodId; + var WebkitHostController=(function () { + function WebkitHostController(hostScriptProxy) { + this.hostScriptProxy=hostScriptProxy; + } + WebkitHostController.prototype.execute=function (id, params, callback) { + var args=params; + if (args==null) { + args=[]; + } + var hostParams={ + id: id, + apiArgs: args + }; + var agaveResponseCallback=function (payload) { + var safeArraySource=payload; + if (OSF.OUtil.isArray(payload) && payload.length >=2) { + var hrStatus=payload[0]; + safeArraySource=payload[1]; + } + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.Execute, hostParams, agaveResponseCallback); + }; + WebkitHostController.prototype.registerEvent=function (id, targetId, handler, callback) { + var agaveEventHandlerCallback=function (payload) { + var safeArraySource=payload; + var eventId=0; + if (OSF.OUtil.isArray(payload) && payload.length >=2) { + safeArraySource=payload[0]; + eventId=payload[1]; + } + if (handler) { + handler(eventId, new OSFWebkit.WebkitSafeArray(safeArraySource)); + } + }; + var agaveResponseCallback=function (payload) { + if (callback) { + callback(new OSFWebkit.WebkitSafeArray(payload)); + } + }; + this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.RegisterEvent, id, targetId, agaveEventHandlerCallback, agaveResponseCallback); + }; + WebkitHostController.prototype.unregisterEvent=function (id, targetId, callback) { + var agaveResponseCallback=function (response) { + callback(new OSFWebkit.WebkitSafeArray(response)); + }; + this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.UnregisterEvent, id, targetId, agaveResponseCallback); + }; + return WebkitHostController; + })(); + OSFWebkit.WebkitHostController=WebkitHostController; +})(OSFWebkit || (OSFWebkit={})); +OSF.Webkit=OSFWebkit; +OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger()); +OSF.ClientMode={ + ReadWrite: 0, + ReadOnly: 1 +} +OSF.DDA.RichInitializationReason={ + 1: Microsoft.Office.WebExtension.InitializationReason.Inserted, + 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened +}; +Microsoft.Office.WebExtension.FileType={ + Text: "text", + Compressed: "compressed" +}; +OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) { + OSF.OUtil.defineEnumerableProperties(this, { + "size": { + value: fileSize + }, + "sliceCount": { + value: Math.ceil(fileSize / sliceSize) + } + }); + var privateState={}; + privateState[OSF.DDA.FileProperties.Handle]=handle; + privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, [ + am.GetDocumentCopyChunkAsync, + am.ReleaseDocumentCopyAsync + ], + privateState + ); +} +OSF.DDA.FileSliceOffset="fileSliceoffset"; +OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() { + this._eventDispatches=[]; + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.AddDataPartAsync, + am.GetDataPartByIdAsync, + am.GetDataPartsByNameSpaceAsync + ]); +}; +OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) { + OSF.OUtil.defineEnumerableProperties(this, { + "builtIn": { + value: builtIn + }, + "id": { + value: id + }, + "namespaceManager": { + value: new OSF.DDA.CustomXmlPrefixMappings(id) + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + am.DeleteDataPartAsync, + am.GetPartNodesAsync, + am.GetPartXmlAsync + ]); + var customXmlPartEventDispatches=customXmlParts._eventDispatches; + var dispatch=customXmlPartEventDispatches[id]; + if (!dispatch) { + var et=Microsoft.Office.WebExtension.EventType; + dispatch=new OSF.EventDispatch([ + et.DataNodeDeleted, + et.DataNodeInserted, + et.DataNodeReplaced + ]); + customXmlPartEventDispatches[id]=dispatch; + } + OSF.DDA.DispIdHost.addEventSupport(this, dispatch); +}; +OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) { + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.AddDataPartNamespaceAsync, + am.GetDataPartNamespaceAsync, + am.GetDataPartPrefixAsync + ], + partId + ); +}; +OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) { + OSF.OUtil.defineEnumerableProperties(this, { + "baseName": { + value: baseName + }, + "namespaceUri": { + value: ns + }, + "nodeType": { + value: nodeType + } + }); + var am=OSF.DDA.AsyncMethodNames; + OSF.DDA.DispIdHost.addAsyncMethods( + this, + [ + am.GetRelativeNodesAsync, + am.GetNodeValueAsync, + am.GetNodeXmlAsync, + am.SetNodeValueAsync, + am.SetNodeXmlAsync + ], + handle + ); +}; +OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeInserted + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced + }, + "oldNode": { + value: oldNode + }, + "newNode": { + value: newNode + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) { + OSF.OUtil.defineEnumerableProperties(this, { + "type": { + value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted + }, + "oldNode": { + value: oldNode + }, + "oldNextSibling": { + value: oldNextSibling + }, + "inUndoRedo": { + value: inUndoRedo + } + }); +}; +OSF.DDA.RichClientSettingsManager=(function OSF_DDA$RichClientSettingsManager() { + return { + read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onComplete) { + var keys=[]; + var values=[]; + if (onCalling) { + onCalling(); + } + var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper(); + var onReceivedContext=function onReceivedContext(appContext) { + if (onComplete) { + onComplete(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, appContext.get_settings()); + } + }; + OSF._OfficeAppFactory.getWebkitAppContext(null, onReceivedContext); + }, + write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onComplete) { + var hostParams={}; + var keys=[]; + var values=[]; + for (var key in serializedSettings) { + keys.push(key); + values.push(serializedSettings[key]); + } + hostParams["keys"]=keys; + hostParams["values"]=values; + if (onCalling) { + onCalling(); + } + var onWriteCompleted=function onWriteCompleted(status) { + if (onComplete) { + onComplete(status[0], null); + } + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.WriteSettings, hostParams, onWriteCompleted); + } + }; +})(); +OSF._OfficeAppFactory.getWebkitAppContext=function OSF__OfficeAppFactory$getWebkitAppContext(wnd, gotAppContext) { + var getInvocationCallback=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(appContext) { + var returnedContext; + var appContextProperties=OSF.Webkit.AppContextProperties; + var appType=appContext[appContextProperties.AppType]; + var appTypeSupported=false; + for (var appEntry in OSF.AppName) { + if (OSF.AppName[appEntry]==appType) { + appTypeSupported=true; + break; + } + } + if (!appTypeSupported) { + throw "Unsupported client type "+appType; + } + var hostSettings=appContext[appContextProperties.Settings]; + var serializedSettings={}; + var keys=hostSettings[0]; + var values=hostSettings[1]; + for (var index=0; index < keys.length; index++) { + serializedSettings[keys[index]]=values[index]; + } + var id=appContext[appContextProperties.SolutionReferenceId]; + var version=appContext[appContextProperties.MajorVersion]; + var clientMode=appContext[appContextProperties.AppCapabilities]; + var UILocale=appContext[appContextProperties.APPUILocale]; + var dataLocale=appContext[appContextProperties.AppDataLocale]; + var docUrl=appContext[appContextProperties.DocumentUrl]; + var reason=appContext[appContextProperties.ActivationMode]; + var osfControlType=appContext[appContextProperties.ControlIntegrationLevel]; + var eToken=appContext[appContextProperties.SolutionToken]; + eToken=eToken ? eToken.toString() : ""; + var correlationId=appContext[appContextProperties.CorrelationId]; + returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, serializedSettings, reason, osfControlType, eToken, correlationId); + if (OSF.AppTelemetry) { + OSF.AppTelemetry.initialize(returnedContext); + } + gotAppContext(returnedContext); + }; + OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.GetContext, [], getInvocationCallback); +} +OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) { + var delegateMethods={}; + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync; + delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync; + function getSettingsExecuteMethod(hostDelegateMethod) { + return function (args) { + var status, response; + var onComplete=function onComplete(status, response) { + if (args.onReceiving) { + args.onReceiving(); + } + if (args.onComplete) { + args.onComplete(status, response); + } + }; + try { + hostDelegateMethod(args.hostCallArgs, args.onCalling, onComplete); + } catch (ex) { + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + response={ name: Strings.OfficeOM.L_InternalError, message: ex }; + onComplete(status, response); + } + }; + } + function readSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving); + } + function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) { + return OSF.DDA.RichClientSettingsManager.write( + hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], + hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], + onCalling, + onReceiving + ); + } + switch (actionId) { + case OSF.DDA.AsyncMethodNames.RefreshAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings); + break; + case OSF.DDA.AsyncMethodNames.SaveAsync.id: + delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings); + break; + default: + break; + } + return delegateMethods; +} +OSF.OUtil.setNamespace("SafeArray", OSF.DDA); +OSF.DDA.SafeArray.Response={ + Status: 0, + Payload: 1 +}; +OSF.DDA.SafeArray.UniqueArguments={ + Offset: "offset", + Run: "run", + BindingSpecificData: "bindingSpecificData", + MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}" +}; +OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray); +OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() { + function _2DVBArrayToJaggedArray(vbArr) { + var ret; + try { + var rows=vbArr.ubound(1); + var cols=vbArr.ubound(2); + vbArr=vbArr.toArray(); + if (rows==1 && cols==1) { + ret=[vbArr]; + } else { + ret=[]; + for (var row=0; row < rows; row++) { + var rowArr=[]; + for (var col=0; col < cols; col++) { + var datum=vbArr[row * cols+col]; + if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) { + rowArr.push(datum); + } + } + if (rowArr.length > 0) { + ret.push(rowArr); + } + } + } + } catch (ex) { + } + return ret; + } + var complexTypes=[ + OSF.DDA.PropertyDescriptors.FileProperties, + OSF.DDA.PropertyDescriptors.FileSliceProperties, + OSF.DDA.PropertyDescriptors.BindingProperties, + OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + OSF.DDA.SafeArray.UniqueArguments.Offset, + OSF.DDA.SafeArray.UniqueArguments.Run, + OSF.DDA.PropertyDescriptors.Subset, + OSF.DDA.PropertyDescriptors.DataPartProperties, + OSF.DDA.PropertyDescriptors.DataNodeProperties, + OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + OSF.DDA.DataNodeEventProperties.OldNode, + OSF.DDA.DataNodeEventProperties.NewNode, + OSF.DDA.DataNodeEventProperties.NextSiblingNode + ]; + var dynamicTypes={}; + dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () { + var tableRows=0; + var tableHeaders=1; + return { + toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) { + if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) { + var tableData=[]; + tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows]; + tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders]; + data=tableData; + } + return data; + }, + fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) { + var ret; + if (hostArgs.toArray) { + var dimensions=hostArgs.dimensions(); + if(dimensions===2) { + ret=_2DVBArrayToJaggedArray(hostArgs); + } else { + var array=hostArgs.toArray(); + if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) { + ret={}; + ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]); + ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]); + } else { + ret=array; + } + } + } else { + ret=hostArgs; + } + return ret; + } + } + })(); + OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes); + this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) { + var value; + if (this.isDynamicType(param)) { + value=dynamicTypes[param].toHost(arg); + } else { + value=arg; + } + return value; + }; + this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) { + var value; + if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) { + try { + value=arg.toArray(); + } catch (ex) { + value=arg || {}; + } + } else if (this.isDynamicType(param)) { + value=dynamicTypes[param].fromHost(arg); + } else { + value=arg; + } + return value; + }; +} +OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor); +OSF.DDA.SafeArray.Delegate.ParameterMap=(function () { + var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor()); + var ns; + var self=parameterMap.self; + function createObject(properties) { + var obj=null; + if (properties) { + obj={}; + var len=properties.length; + for (var i=0; i < len; i++) { + obj[properties[i].name]=properties[i].value; + } + } + return obj; + } + function define(definition) { + var args={}; + var toHost=createObject(definition.toHost); + if (definition.invertible) { + args.map=toHost; + } + else if (definition.canonical) { + args.toHost=args.fromHost=toHost; + } + else { + args.toHost=toHost; + args.fromHost=createObject(definition.fromHost); + } + parameterMap.setMapping(definition.type, args); + } + ns=OSF.DDA.FileProperties; + define({ + type: OSF.DDA.PropertyDescriptors.FileProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.FileSize, value: 1 } + ] + }); + define({ + type: OSF.DDA.PropertyDescriptors.FileSliceProperties, + fromHost: [ + { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }, + { name: ns.SliceSize, value: 1} + ] + }); + ns=OSF.DDA.BindingProperties; + define({ + type: OSF.DDA.PropertyDescriptors.BindingProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Type, value: 1 }, + { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 } + ] + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, + fromHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 }, + { name: ns.HasHeaders, value: 2 } + ] + }); + ns=OSF.DDA.SafeArray.UniqueArguments; + define({ + type: OSF.DDA.PropertyDescriptors.Subset, + toHost: [ + { name: ns.Offset, value: 0 }, + { name: ns.Run, value: 1 } + ], + canonical: true + }); + ns=Microsoft.Office.WebExtension.Parameters; + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Offset, + toHost: [ + { name: ns.StartRow, value: 0 }, + { name: ns.StartColumn, value: 1 } + ], + canonical: true + }); + define({ + type: OSF.DDA.SafeArray.UniqueArguments.Run, + toHost: [ + { name: ns.RowCount, value: 0 }, + { name: ns.ColumnCount, value: 1 } + ], + canonical: true + }); + ns=OSF.DDA.DataPartProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataPartProperties, + fromHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BuiltIn, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeProperties; + define({ + type: OSF.DDA.PropertyDescriptors.DataNodeProperties, + fromHost: [ + { name: ns.Handle, value: 0 }, + { name: ns.BaseName, value: 1 }, + { name: ns.NamespaceUri, value: 2 }, + { name: ns.NodeType, value: 3 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 } + ] + }); + ns=OSF.DDA.DataNodeEventProperties; + define({ + type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.NewNode, value: 1 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NewNode, value: 2 } + ] + }); + define({ + type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, + fromHost: [ + { name: ns.InUndoRedo, value: 0 }, + { name: ns.OldNode, value: 1 }, + { name: ns.NextSiblingNode, value: 2 } + ] + }); + define({ + type: ns.OldNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NewNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + define({ + type: ns.NextSiblingNode, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self } + ] + }); + ns=Microsoft.Office.WebExtension.AsyncResultStatus; + define({ + type: OSF.DDA.PropertyDescriptors.AsyncResultStatus, + fromHost: [ + { name: ns.Succeeded, value: 0 }, + { name: ns.Failed, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.CoercionType; + define({ + type: Microsoft.Office.WebExtension.Parameters.CoercionType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 }, + { name: ns.Html, value: 3 }, + { name: ns.Ooxml, value: 4 } + ] + }); + ns=Microsoft.Office.WebExtension.FileType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.FileType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Compressed, value: 5 } + ] + }); + } + ns=Microsoft.Office.WebExtension.BindingType; + if (ns) { + define({ + type: Microsoft.Office.WebExtension.Parameters.BindingType, + toHost: [ + { name: ns.Text, value: 0 }, + { name: ns.Matrix, value: 1 }, + { name: ns.Table, value: 2 } + ], + invertible: true + }); + } + ns=Microsoft.Office.WebExtension.ValueFormat; + define({ + type: Microsoft.Office.WebExtension.Parameters.ValueFormat, + toHost: [ + { name: ns.Unformatted, value: 0 }, + { name: ns.Formatted, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.FilterType; + define({ + type: Microsoft.Office.WebExtension.Parameters.FilterType, + toHost: [ + { name: ns.All, value: 0 }, + { name: ns.OnlyVisible, value: 1 } + ] + }); + ns=Microsoft.Office.WebExtension.Parameters; + var cns=OSF.DDA.MethodDispId; + define({ + type: cns.dispidGetSelectedDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.ValueFormat, value: 1 }, + { name: ns.FilterType, value: 2 } + ] + }); + define({ + type: cns.dispidSetSelectedDataMethod, + toHost: [ + { name: ns.CoercionType, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidGetDocumentCopyMethod, + toHost: [{ name: ns.FileType, value: 0}], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self } + ] + }); + define({ + type: cns.dispidGetDocumentCopyChunkMethod, + toHost: [ + { name: OSF.DDA.FileProperties.Handle, value: 0 }, + { name: OSF.DDA.FileSliceOffset, value: 1 }, + { name: OSF.DDA.FileProperties.SliceSize, value: 2 } + ], + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self } + ] + }); + define({ + type: cns.dispidReleaseDocumentCopyMethod, + toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}] + }); + define({ + type: cns.dispidAddBindingFromSelectionMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 } + ] + }); + define({ + type: cns.dispidAddBindingFromPromptMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.BindingType, value: 1 }, + { name: ns.PromptText, value: 2 } + ] + }); + define({ + type: cns.dispidAddBindingFromNamedItemMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.ItemName, value: 0 }, + { name: ns.Id, value: 1 }, + { name: ns.BindingType, value: 2 }, + { name: ns.FailOnCollision, value: 3 } + ] + }); + define({ + type: cns.dispidReleaseBindingMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetBindingMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetAllBindingsMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.BindingList, value: self } + ] + }); + define({ + type: cns.dispidGetBindingDataMethod, + fromHost: [ + { name: ns.Data, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.ValueFormat, value: 2 }, + { name: ns.FilterType, value: 3 }, + { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 } + ] + }); + define({ + type: cns.dispidSetBindingDataMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.CoercionType, value: 1 }, + { name: ns.Data, value: 2 }, + { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 } + ] + }); + define({ + type: cns.dispidAddRowsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidAddColumnsMethod, + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidClearAllRowsMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidLoadSettingsMethod, + fromHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: self } + ] + }); + define({ + type: cns.dispidSaveSettingsMethod, + toHost: [ + { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings }, + { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale } + ] + }); + define({ + type: cns.dispidAddDataPartMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Xml, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartByIdMethod, + fromHost: [ + { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartsByNamespaceMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataPartList, value: self } + ], + toHost: [ + { name: ns.Namespace, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataPartNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: ns.Id, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidDeleteDataPartMethod, + toHost: [ + { name: ns.Id, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeValueMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodeXmlMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 } + ] + }); + define({ + type: cns.dispidGetDataNodesMethod, + fromHost: [ + { name: OSF.DDA.ListDescriptors.DataNodeList, value: self } + ], + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.XPath, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeValueMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Data, value: 1 } + ] + }); + define({ + type: cns.dispidSetDataNodeXmlMethod, + toHost: [ + { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }, + { name: ns.Xml, value: 1 } + ] + }); + define({ + type: cns.dispidAddDataNamespaceMethod, + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 }, + { name: ns.Namespace, value: 2 } + ] + }); + define({ + type: cns.dispidGetDataUriByPrefixMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Prefix, value: 1 } + ] + }); + define({ + type: cns.dispidGetDataPrefixByUriMethod, + fromHost: [ + { name: ns.Data, value: self} + ], + toHost: [ + { name: OSF.DDA.DataPartProperties.Id, value: 0 }, + { name: ns.Namespace, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedTaskMethod, + fromHost: [ + { name: ns.TaskId, value: self } + ] + }); + define({ + type: cns.dispidGetTaskMethod, + fromHost: [ + { name: "taskName", value: 0 }, + { name: "wssTaskId", value: 1 }, + { name: "resourceNames", value: 2 } + ], + toHost: [ + { name: ns.TaskId, value: 0 } + ] + }); + define({ + type: cns.dispidGetTaskFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.TaskId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetWSSUrlMethod, + fromHost: [ + { name: ns.ServerUrl, value: 0 }, + { name: ns.ListName, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedResourceMethod, + fromHost: [ + { name: ns.ResourceId, value: self } + ] + }); + define({ + type: cns.dispidGetResourceFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.ResourceId, value: 0 }, + { name: ns.FieldId, value: 1 }, + { name: ns.GetRawValue, value: 2 } + ] + }); + define({ + type: cns.dispidGetProjectFieldMethod, + fromHost: [ + { name: ns.FieldValue, value: self } + ], + toHost: [ + { name: ns.FieldId, value: 0 }, + { name: ns.GetRawValue, value: 1 } + ] + }); + define({ + type: cns.dispidGetSelectedViewMethod, + fromHost: [ + { name: ns.ViewType, value: 0 }, + { name: ns.ViewName, value: 1 } + ] + }); + cns=OSF.DDA.EventDispId + define({ type: cns.dispidDocumentSelectionChangedEvent }); + define({ + type: cns.dispidBindingSelectionChangedEvent, + fromHost: [ + {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self} + ] + }); + define({ + type: cns.dispidBindingDataChangedEvent, + fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}] + }); + define({ type: cns.dispidSettingsChangedEvent }); + define({ + type: cns.dispidDataNodeAddedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeReplacedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}] + }); + define({ + type: cns.dispidDataNodeDeletedEvent, + fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}] + }); + define({ type: cns.dispidTaskSelectionChangedEvent }); + define({ type: cns.dispidResourceSelectionChangedEvent }); + define({ type: cns.dispidViewSelectionChangedEvent }); + return parameterMap; +})(); +OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) { + var status; + var number=ex.number; + if (number) { + switch (number) { + case -2146828218: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability; + break; + case -2146827850: + default: + status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError; + break; + } + } + if (args.onComplete) { + args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError); + } +} +OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) { + try { + if (args.onCalling) { + args.onCalling(); + } + function toArray(args) { + var arrArgs=args; + if (OSF.OUtil.isArray(args)) { + var len=arrArgs.length; + for (var i=0; i < len; i++) { + arrArgs[i]=toArray(arrArgs[i]); + } + } else if (OSF.OUtil.isDate(args)) { + arrArgs=args.getVarDate(); + } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) { + arrArgs=[]; + for (var index in args) { + if (!OSF.OUtil.isFunction(args[index])) { + arrArgs[index]=toArray(args[index]); + } + } + } + return arrArgs; + } + var startTime=(new Date()).getTime(); + OSF.ClientHostController.execute( + args.dispId, + toArray(args.hostCallArgs), + function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var result=hostResponseArgs.toArray(); + var status=result[OSF.DDA.SafeArray.Response.Status]; + if (args.onComplete) { + var payload; + if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) { + if (result.length > 2) { + payload=[]; + for (var i=1; i < result.length; i++) + payload[i - 1]=result[i]; + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + } + else { + payload=result[OSF.DDA.SafeArray.Response.Payload]; + } + args.onComplete(status, payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status); + } + } + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) { + var startTime=(new Date()).getTime(); + return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) { + if (args.onReceiving) { + args.onReceiving(); + } + var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs; + if (args.onComplete) { + args.onComplete(status) + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status); + } + } +} +OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args); + try { + OSF.ClientHostController.registerEvent( + args.dispId, + args.targetId, + function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) { + if (args.onEvent) { + args.onEvent(payload); + } + if (OSF.AppTelemetry) { + OSF.AppTelemetry.onEventDone(args.dispId); + } + }, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) { + if (args.onCalling) { + args.onCalling(); + } + var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args); + try { + OSF.ClientHostController.unregisterEvent( + args.dispId, + args.targetId, + callback + ); + } + catch (ex) { + OSF.DDA.SafeArray.Delegate._onException(ex, args); + } +}; +OSF.DDA.WordDocument=function OSF_DDA_WordDocument(officeAppContext, settings) { + OSF.DDA.WordDocument.uber.constructor.call(this, + officeAppContext, + new OSF.DDA.BindingFacade(this), + settings + ); + OSF.DDA.DispIdHost.addAsyncMethods(this, [ + OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync + ]); + OSF.OUtil.defineEnumerableProperty(this, "customXmlParts", { + value: new OSF.DDA.CustomXmlParts() + }); + OSF.OUtil.finalizeProperties(this); +}; +OSF.OUtil.extend(OSF.DDA.WordDocument, OSF.DDA.JsomDocument); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/wordios-15.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/wordios-15.js new file mode 100644 index 000000000..c541f47e2 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/1/wordios-15.js @@ -0,0 +1,11 @@ +/* Word iOS specific JavaScript API library */ +/* Version: 15.0.4420.1017 Build Time: 05/04/2015 */ +/* + Copyright (c) Microsoft Corporation. All rights reserved. +*/ + +/* + Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. +*/ + +OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType,{Html:"html",Ooxml:"ooxml"});OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DataNodeDeleted:"nodeDeleted",DataNodeInserted:"nodeInserted",DataNodeReplaced:"nodeReplaced"});var OSF=OSF||{},OSFWebkit;(function(b){var a=function(){var a=false;function b(a){this.data=a;this.safeArrayFlag=this.isSafeArray(a)}b.prototype.dimensions=function(){var a=0;if(this.safeArrayFlag)a=this.data[0][0];else if(this.isArray())a=2;return a};b.prototype.getItem=function(){var b=[],a=null;if(this.safeArrayFlag)b=this.toArray();else b=this.data;a=b;for(var c=0;c=a.MESSAGE_TIME_DELTA){f();b.lastMessageTimestamp=d}else{b.lastMessageTimestamp+=a.MESSAGE_TIME_DELTA;setTimeout(function(){f()},b.lastMessageTimestamp-d)}return e};a.prototype.generateCorrelationId=function(){++this.callingIndex;return this.conversationId+this.callingIndex};a.getCurrentTimeMS=function(){return (new Date).getTime()};a.MESSAGE_TIME_DELTA=10;return a}();b.WebkitScriptMessaging=c})(a.ScriptMessaging||(a.ScriptMessaging={}));var b=a.ScriptMessaging})(OSFWebkit||(OSFWebkit={}));OSF.ScriptMessaging=OSFWebkit.ScriptMessaging;var OSFWebkit;(function(a){a.MessageHandlerName="Agave";(function(a){var j="InstanceId",i="CorrelationId",h="APISetVersion",g="SolutionToken",f="ControlIntegrationLevel",e="ActivationMode",d="DocumentUrl",c="BindingCount",b="AppDataLocale",r="APPUILocale",q="AppCapabilities",p="APIVersionSequence",o="RevisionVersion",n="MinorVersion",m="MajorVersion",l="SolutionReferenceId",k="Settings";a[a[k]=0]=k;a[a[l]=1]=l;a[a["AppType"]=2]="AppType";a[a[m]=3]=m;a[a[n]=4]=n;a[a[o]=5]=o;a[a[p]=6]=p;a[a[q]=7]=q;a[a[r]=8]=r;a[a[b]=9]=b;a[a[c]=10]=c;a[a[d]=11]=d;a[a[e]=12]=e;a[a[f]=13]=f;a[a[g]=14]=g;a[a[h]=15]=h;a[a[i]=16]=i;a[a[j]=17]=j})(a.AppContextProperties||(a.AppContextProperties={}));var c=a.AppContextProperties;(function(a){var e="GetContext",d="WriteSettings",c="UnregisterEvent",b="RegisterEvent";a[a["Execute"]=1]="Execute";a[a[b]=2]=b;a[a[c]=3]=c;a[a[d]=4]=d;a[a[e]=5]=e})(a.MethodId||(a.MethodId={}));var d=a.MethodId,b=function(){function b(a){this.hostScriptProxy=a}b.prototype.execute=function(g,f,c){var b=f;if(b==null)b=[];var e={id:g,apiArgs:b},d=function(b){var d=b;if(OSF.OUtil.isArray(b)&&b.length>=2){var e=b[0];d=b[1]}c&&c(new a.WebkitSafeArray(d))};this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.Execute,e,d)};b.prototype.registerEvent=function(g,f,c,b){var d=function(b){var d=b,e=0;if(OSF.OUtil.isArray(b)&&b.length>=2){d=b[0];e=b[1]}c&&c(e,new a.WebkitSafeArray(d))},e=function(c){b&&b(new a.WebkitSafeArray(c))};this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.RegisterEvent,g,f,d,e)};b.prototype.unregisterEvent=function(e,d,c){var b=function(b){c(new a.WebkitSafeArray(b))};this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.UnregisterEvent,e,d,b)};return b}();a.WebkitHostController=b})(OSFWebkit||(OSFWebkit={}));OSF.Webkit=OSFWebkit;OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger());OSF.ClientMode={ReadWrite:0,ReadOnly:1};OSF.DDA.RichInitializationReason={1:Microsoft.Office.WebExtension.InitializationReason.Inserted,2:Microsoft.Office.WebExtension.InitializationReason.DocumentOpened};Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed"};OSF.DDA.File=function(e,c,b){OSF.OUtil.defineEnumerableProperties(this,{size:{value:c},sliceCount:{value:Math.ceil(c/b)}});var a={};a[OSF.DDA.FileProperties.Handle]=e;a[OSF.DDA.FileProperties.SliceSize]=b;var d=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[d.GetDocumentCopyChunkAsync,d.ReleaseDocumentCopyAsync],a)};OSF.DDA.FileSliceOffset="fileSliceoffset";OSF.DDA.CustomXmlParts=function(){this._eventDispatches=[];var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartAsync,a.GetDataPartByIdAsync,a.GetDataPartsByNameSpaceAsync])};OSF.DDA.CustomXmlPart=function(f,b,g){OSF.OUtil.defineEnumerableProperties(this,{builtIn:{value:g},id:{value:b},namespaceManager:{value:new OSF.DDA.CustomXmlPrefixMappings(b)}});var c=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[c.DeleteDataPartAsync,c.GetPartNodesAsync,c.GetPartXmlAsync]);var e=f._eventDispatches,a=e[b];if(!a){var d=Microsoft.Office.WebExtension.EventType;a=new OSF.EventDispatch([d.DataNodeDeleted,d.DataNodeInserted,d.DataNodeReplaced]);e[b]=a}OSF.DDA.DispIdHost.addEventSupport(this,a)};OSF.DDA.CustomXmlPrefixMappings=function(b){var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.AddDataPartNamespaceAsync,a.GetDataPartNamespaceAsync,a.GetDataPartPrefixAsync],b)};OSF.DDA.CustomXmlNode=function(d,c,e,b){OSF.OUtil.defineEnumerableProperties(this,{baseName:{value:b},namespaceUri:{value:e},nodeType:{value:c}});var a=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[a.GetRelativeNodesAsync,a.GetNodeValueAsync,a.GetNodeXmlAsync,a.SetNodeValueAsync,a.SetNodeXmlAsync],d)};OSF.DDA.NodeInsertedEventArgs=function(b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeInserted},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeReplacedEventArgs=function(c,b,a){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeReplaced},oldNode:{value:c},newNode:{value:b},inUndoRedo:{value:a}})};OSF.DDA.NodeDeletedEventArgs=function(c,a,b){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeDeleted},oldNode:{value:c},oldNextSibling:{value:a},inUndoRedo:{value:b}})};OSF.DDA.RichClientSettingsManager=function(){return {read:function(b,a){var f=[],e=[];b&&b();var d=OSF._OfficeAppFactory.getInitializationHelper(),c=function(b){a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,b.get_settings())};OSF._OfficeAppFactory.getWebkitAppContext(null,c)},write:function(b,i,d,c){var a={},f=[],e=[];for(var g in b){f.push(g);e.push(b[g])}a["keys"]=f;a["values"]=e;d&&d();var h=function(a){c&&c(a[0],null)};OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName,OSF.Webkit.MethodId.WriteSettings,a,h)}}}();OSF._OfficeAppFactory.getWebkitAppContext=function(c,b){var a=function(c){var f,a=OSF.Webkit.AppContextProperties,g=c[a.AppType],i=false;for(var p in OSF.AppName)if(OSF.AppName[p]==g){i=true;break}if(!i)throw"Unsupported client type "+g;for(var j=c[a.Settings],h={},k=j[0],u=j[1],e=0;e0&&b.push(c)}}}catch(i){}return b}var c=[OSF.DDA.PropertyDescriptors.FileProperties,OSF.DDA.PropertyDescriptors.FileSliceProperties,OSF.DDA.PropertyDescriptors.BindingProperties,OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,OSF.DDA.SafeArray.UniqueArguments.Offset,OSF.DDA.SafeArray.UniqueArguments.Run,OSF.DDA.PropertyDescriptors.Subset,OSF.DDA.PropertyDescriptors.DataPartProperties,OSF.DDA.PropertyDescriptors.DataNodeProperties,OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,OSF.DDA.EventDescriptors.DataNodeInsertedEvent,OSF.DDA.EventDescriptors.DataNodeReplacedEvent,OSF.DDA.EventDescriptors.DataNodeDeletedEvent,OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode],a={};a[Microsoft.Office.WebExtension.Parameters.Data]=function(){var c=0,a=1;return {toHost:function(b){if(typeof b!="string"&&b[OSF.DDA.TableDataProperties.TableRows]!==undefined){var d=[];d[c]=b[OSF.DDA.TableDataProperties.TableRows];d[a]=b[OSF.DDA.TableDataProperties.TableHeaders];b=d}return b},fromHost:function(f){var e;if(f.toArray){var g=f.dimensions();if(g===2)e=b(f);else{var d=f.toArray();if(d.length===2&&(d[0]!=null&&d[0].toArray||d[1]!=null&&d[1].toArray)){e={};e[OSF.DDA.TableDataProperties.TableRows]=b(d[c]);e[OSF.DDA.TableDataProperties.TableHeaders]=b(d[a])}else e=d}}else e=f;return e}}}();OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,c,a);this.pack=function(c,d){var b;if(this.isDynamicType(c))b=a[c].toHost(d);else b=d;return b};this.unpack=function(c,d){var b;if(this.isComplexType(c)||OSF.DDA.ListType.isListType(c))try{b=d.toArray()}catch(e){b=d||{}}else if(this.isDynamicType(c))b=a[c].fromHost(d);else b=d;return b}};OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);OSF.DDA.SafeArray.Delegate.ParameterMap=function(){var e=true,f=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor),a,d=f.self;function g(a){var c=null;if(a){c={};for(var d=a.length,b=0;b2){c=[];for(var e=1;e0){var d=[];for(var c=0;c=d)break;a=Function._validateParameter(g[b],f,h);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(j,d,i){var a,c,b=d.length,e=j.length;if(eb){c=true;for(a=0;a0&&(d=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};Sys._indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+=" ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.CollectionChange=function(e,a,c,b,d){this.action=e;if(a)if(!(a instanceof Array))a=[a];this.newItems=a||null;if(typeof c!=="number")c=-1;this.newStartingIndex=c;if(b)if(!(b instanceof Array))b=[b];this.oldItems=b||null;if(typeof d!=="number")d=-1;this.oldStartingIndex=d};Sys.CollectionChange.registerClass("Sys.CollectionChange");Sys.NotifyCollectionChangedAction=function(){throw Error.notImplemented()};Sys.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");Sys.NotifyCollectionChangedEventArgs=function(a){this._changes=a;Sys.NotifyCollectionChangedEventArgs.initializeBase(this)};Sys.NotifyCollectionChangedEventArgs.prototype={get_changes:function(){return this._changes||[]}};Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",Sys.EventArgs);Sys.Observer=function(){};Sys.Observer.registerClass("Sys.Observer");Sys.Observer.makeObservable=function(a){var c=a instanceof Array,b=Sys.Observer;if(a.setValue===b._observeMethods.setValue)return a;b._addMethods(a,b._observeMethods);if(c)b._addMethods(a,b._arrayMethods);return a};Sys.Observer._addMethods=function(c,b){for(var a in b)c[a]=b[a]};Sys.Observer._addEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._addHandler(a,b)};Sys.Observer.addEventHandler=function(c,a,b){Sys.Observer._addEventHandler(c,a,b)};Sys.Observer._removeEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._removeHandler(a,b)};Sys.Observer.removeEventHandler=function(c,a,b){Sys.Observer._removeEventHandler(c,a,b)};Sys.Observer.raiseEvent=function(b,e,d){var c=Sys.Observer._getContext(b);if(!c)return;var a=c.events.getHandler(e);if(a)a(b,d)};Sys.Observer.addPropertyChanged=function(b,a){Sys.Observer._addEventHandler(b,"propertyChanged",a)};Sys.Observer.removePropertyChanged=function(b,a){Sys.Observer._removeEventHandler(b,"propertyChanged",a)};Sys.Observer.beginUpdate=function(a){Sys.Observer._getContext(a,true).updating=true};Sys.Observer.endUpdate=function(b){var a=Sys.Observer._getContext(b);if(!a||!a.updating)return;a.updating=false;var d=a.dirty;a.dirty=false;if(d){if(b instanceof Array){var c=a.changes;a.changes=null;Sys.Observer.raiseCollectionChanged(b,c)}Sys.Observer.raisePropertyChanged(b,"")}};Sys.Observer.isUpdating=function(b){var a=Sys.Observer._getContext(b);return a?a.updating:false};Sys.Observer._setValue=function(a,j,g){var b,f,k=a,d=j.split(".");for(var i=0,m=d.length-1;i-1&&ac.Calendar.TwoDigitYearMax)a-=100}return a};Date._getEra=function(e,c){if(!c)return 0;var b,d=e.getTime();for(var a=0,f=c.length;a=b)return a}return 0};Date._getEraYear=function(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":case "gg":case "g":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)");break;case "/":a.append("(\\"+b.DateSeparator+")")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(h,d,i){var a,c,b,f,e,g=false;for(a=1,c=i.length;a31)return null;break;case "MMMM":c=k._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=k._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":e=Date._expandYear(g,parseInt(a,10));if(e<0||e>9999)return null;break;case "yyyy":e=parseInt(a,10);if(e<0||e>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":p=parseInt(a,10);if(p<0||p>59)return null;break;case "s":case "ss":q=parseInt(a,10);if(q<0||q>59)return null;break;case "tt":case "t":var z=a.toUpperCase();v=z===g.PMDesignator.toUpperCase();if(!v&&z!==g.AMDesignator.toUpperCase())return null;break;case "f":f=parseInt(a,10)*100;if(f<0||f>999)return null;break;case "ff":f=parseInt(a,10)*10;if(f<0||f>999)return null;break;case "fff":f=parseInt(a,10);if(f<0||f>999)return null;break;case "dddd":i=k._getDayIndex(a);if(i<0||i>6)return null;break;case "ddd":i=k._getAbbrDayIndex(a);if(i<0||i>6)return null;break;case "zzz":var u=a.split(/:/);if(u.length!==2)return null;h=parseInt(u[0],10);if(h<-12||h>13)return null;var m=parseInt(u[1],10);if(m<0||m>59)return null;l=h*60+(a.startsWith("-")?-m:m);break;case "z":case "zz":h=parseInt(a,10);if(h<-12||h>13)return null;l=h*60;break;case "g":case "gg":var o=a;if(!o||!g.eras)return null;o=o.toLowerCase().trim();for(var r=0,F=g.eras.length;r0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k1)b=parseInt(e.slice(1),10);var c;switch(e.charAt(0)){case "d":case "D":c="n";if(b!==-1)d=g(""+d,b,true);if(this<0)d=-d;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;d=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;d=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;d=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=d;break;case "$":f+=a.CurrencySymbol;break;case "-":if(/[1-9]/.test(d))f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getIndex:function(c,d,e){var b=this._toUpper(c),a=Array.indexOf(d,b);if(a===-1)a=Array.indexOf(e,b);return a},_getMonthIndex:function(a){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);this._upperMonthsGenitive=this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)}return this._getIndex(a,this._upperMonths,this._upperMonthsGenitive)},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);this._upperAbbrMonthsGenitive=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)}return this._getIndex(a,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c=0;c--){var f=d[c];if(!g||f.autoRemove)$removeHandler(a,b,f.handler)}}a._events=null}};Sys.UI.DomEvent._disposeHandlers=function(){Sys.UI.DomEvent._clearHandlers(this,true);var b=this._chainDispose,a=typeof b;if(a!=="undefined"){this.dispose=b;this._chainDispose=null;if(a==="function")this.dispose()}};var $removeHandler=Sys.UI.DomEvent.removeHandler=function(b,a,c){Sys.UI.DomEvent._removeHandler(b,a,c)};Sys.UI.DomEvent._removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b=3){d+=parseInt(b.borderLeftWidth);e+=parseInt(b.borderTopWidth)}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(a=c.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)){d-=a.scrollLeft||0;e-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(d,e)};else Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,a,i=null,g=null,b=null;for(a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)};Sys.UI.DomElement.isDomElement=function(a){return Sys._isDomElement(a)};Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.resolveElement=function(b,c){var a=b;if(!a)return null;if(typeof a==="string")a=Sys.UI.DomElement.getElementById(a,c);return a};Sys.UI.DomElement.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){Sys.UI.DomElement._raiseBubbleEventFromControl(a,c,d);return}b=b.parentNode}};Sys.UI.DomElement._raiseBubbleEventFromControl=function(a,b,c){if(!a.onBubbleEvent(b,c))a._raiseBubbleEvent(b,c)};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);this._domReady()};Sys._Application.prototype={_creatingComponents:false,_disposing:false,_deleteCount:0,get_isCreatingComponents:function(){return this._creatingComponents},get_isDisposing:function(){return this._disposing},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,f=b.length;a=0;b--){var d=i[b],f=d.dispose;if(f&&typeof f==="function")d.dispose();else{var e=d.control;if(e&&typeof e.dispose==="function")e.dispose()}var a=d._behaviors;if(a)this._disposeComponents(a);a=d._components;if(a){this._disposeComponents(a);d._components=null}}if(!j){var f=c.dispose;if(f&&typeof f==="function")c.dispose();else{var e=c.control;if(e&&typeof e.dispose==="function")e.dispose()}var a=c._behaviors;if(a)this._disposeComponents(a);a=c._components;if(a){this._disposeComponents(a);c._components=null}}}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a1000){var c=[];for(var d=0,f=b.length;d=0;b--){var c=a[b];if(typeof c.dispose==="function")c.dispose()}},_domReady:function(){var a,g,f=this;function b(){f.initialize()}var c=function(){Sys.UI.DomEvent.removeHandler(window,"load",c);b()};Sys.UI.DomEvent.addHandler(window,"load",c);if(document.addEventListener)try{document.addEventListener("DOMContentLoaded",a=function(){document.removeEventListener("DOMContentLoaded",a,false);b()},false)}catch(h){}else if(document.attachEvent)if(window==window.top&&document.documentElement.doScroll){var e,d=document.createElement("div");a=function(){try{d.doScroll("left")}catch(c){e=window.setTimeout(a,0);return}d=null;b()};a()}else document.attachEvent("onreadystatechange",a=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}})},_raiseInit:function(){var a=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!==-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");var a=this._element;if(a){var c=this.get_name();if(c)a[c]=null;var b=a._behaviors;Array.remove(b,this);if(b.length===0)a._behaviors=null;delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b0&&a.charAt(0)==="#")a=a.substring(1);return a};Sys._Application.prototype.get_enableHistory=function(){return this._enableHistory};Sys._Application.prototype.set_enableHistory=function(a){this._enableHistory=a};Sys._Application.prototype.add_navigate=function(a){this.get_events().addHandler("navigate",a)};Sys._Application.prototype.remove_navigate=function(a){this.get_events().removeHandler("navigate",a)};Sys._Application.prototype.addHistoryPoint=function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()};Sys._Application.prototype.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};Sys._Application.prototype.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};Sys._Application.prototype._deserializeState=function(a){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+27){var e=document.title;document.title=c;this._setState(a);document.title=e}else this._setState(a);this._raiseNavigate()}else{this._setState(a);this._raiseNavigate()}}};Sys._Application.prototype._raiseNavigate=function(){var d=this._historyPointIsNew,c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var e=new Sys.HistoryEventArgs(b);if(c)c(this,e);if(!d){var f;try{if(Sys.Browser.agent===Sys.Browser.Firefox&&window.location.hash&&(!window.frameElement||window.top.location.hash))Sys.Browser.version<3.5?window.history.go(0):(location.hash=this.get_stateString())}catch(g){}}};Sys._Application.prototype._serializeState=function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")};Sys._Application.prototype._setState=function(a,b){if(this._enableHistory){a=a||"";if(a!==this._currentEntry){if(window.theForm){var d=window.theForm.action,e=d.indexOf("#");window.theForm.action=(e!==-1?d.substring(0,e):d)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){this._ignoreIFrame=true;var c=this._historyFrame.contentWindow.document;c.open("javascript:''");c.write(""+(b||document.title)+"parent.Sys.Application._onIFrameLoad('+Sys.Serialization.JavaScriptSerializer.serialize(a)+");");c.close()}this._ignoreTimer=false;this._currentEntry=a;if(this._historyFrame||this._historyPointIsNew){var f=this.get_stateString();if(a!==f){window.location.hash=a;this._currentEntry=this.get_stateString();if(typeof b!=="undefined"&&b!==null)document.title=b}}this._historyPointIsNew=false}}};Sys._Application.prototype._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(c,b,f){b=b||encodeURIComponent;var h=0,e,g,d,a=new Sys.StringBuilder;if(c)for(d in c){e=c[d];if(typeof e==="function")continue;g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(h++)a.append("&");a.append(d);a.append("=");a.append(b(g))}if(f){if(h)a.append("&");a.append(f)}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b,c){if(!b&&!c)return a;var d=Sys.Net.WebRequest._createQueryString(b,null,c);return d.length?a+(a&&a.indexOf("?")>=0?"&":"?")+d:a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoaderTask._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;this._completedCallback(a,true)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys._ScriptLoaderTask._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Type.registerNamespace("Sys.Net");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext==="undefined"?null:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||null},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||null},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return !!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||null},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||"callback"},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(d,e,g,f,c,b,a){c=c||this.get_defaultSucceededCallback();b=b||this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(q,a,m,l,j,b,g,e,w,p){var i=w!==false?Sys.Net.WebServiceProxy._xdomain.exec(q):null,c,n=i&&i.length===3&&(i[1]!==location.protocol||i[2]!==location.host);m=n||m;if(n){p=p||"callback";c="_jsonp"+Sys._jsonp++}if(!l)l={};var r=l;if(!m||!r)r={};var s,h,f=null,k,o=null,u=Sys.Net.WebRequest._createUrl(a?q+"/"+encodeURIComponent(a):q,r,n?p+"=Sys."+c:null);if(n){s=document.createElement("script");s.src=u;k=new Sys._ScriptLoaderTask(s,function(d,b){if(!b||c)t({Message:String.format(Sys.Res.webServiceFailedNoMsg,a)},-1)});function v(){if(f===null)return;f=null;h=new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut,a));k.dispose();delete Sys[c];if(b)b(h,g,a)}function t(d,e){if(f!==null){window.clearTimeout(f);f=null}k.dispose();delete Sys[c];c=null;if(typeof e!=="undefined"&&e!==200){if(b){h=new Sys.Net.WebServiceError(false,d.Message||String.format(Sys.Res.webServiceFailedNoMsg,a),d.StackTrace||null,d.ExceptionType||null,d);h._statusCode=e;b(h,g,a)}}else if(j)j(d,g,a)}Sys[c]=t;e=e||Sys.Net.WebRequestManager.get_defaultTimeout();if(e>0)f=window.setTimeout(v,e);k.execute();return null}var d=new Sys.Net.WebRequest;d.set_url(u);d.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!m){o=Sys.Serialization.JavaScriptSerializer.serialize(l);if(o==="{}")o=""}d.set_body(o);d.add_completed(x);if(e&&e>0)d.set_timeout(e);d.invoke();function x(d){if(d.get_responseAvailable()){var f=d.get_statusCode(),c=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))c=d.get_object();else if(e.startsWith("text/xml"))c=d.get_xml();else c=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(c)c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)}else if(e.startsWith("application/json"))c=!c||typeof c.d==="undefined"?c:c.d;if(f<200||f>=300||h){if(b){if(!c||!h)c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a));c._statusCode=f;b(c,g,a)}}else if(j)j(c,g,a)}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}return d};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys._jsonp=0;Sys.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;Sys.Net.WebServiceError=function(d,e,c,a,b){this._timedOut=d;this._message=e;this._stackTrace=c;this._exceptionType=a;this._errorObject=b;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace||""},get_exceptionType:function(){return this._exceptionType||""},get_errorObject:function(){return this._errorObject||null}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError"); +Type.registerNamespace('Sys');Sys.Res={'argumentInteger':'Value must be an integer.','invokeCalledTwice':'Cannot call invoke more than once.','webServiceFailed':'The server method \'{0}\' failed with the following error: {1}','argumentType':'Object cannot be converted to the required type.','argumentNull':'Value cannot be null.','scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.','scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.','formatBadFormatSpecifier':'Format specifier was invalid.','requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.','webServiceFailedNoMsg':'The server method \'{0}\' failed.','argumentDomElement':'Value must be a DOM element.','invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.','cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.','actualValue':'Actual value was {0}.','enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.','scriptLoadFailed':'The script \'{0}\' could not be loaded.','parameterCount':'Parameter count mismatch.','cannotDeserializeEmptyString':'Cannot deserialize empty string.','formatInvalidString':'Input string was not in a correct format.','invalidTimeout':'Value must be greater than or equal to zero.','cannotAbortBeforeStart':'Cannot abort when executor has not started.','argument':'Value does not fall within the expected range.','cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.','invalidHttpVerb':'httpVerb cannot be set to an empty or null string.','nullWebRequest':'Cannot call executeRequest with a null webRequest.','eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.','cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.','argumentUndefined':'Value cannot be undefined.','webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}','servicePathNotSet':'The path to the web service has not been set.','argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.','cannotCallOnceStarted':'Cannot call {0} once started.','badBaseUrl1':'Base URL does not contain ://.','badBaseUrl2':'Base URL does not contain another /.','badBaseUrl3':'Cannot find last / in base URL.','setExecutorAfterActive':'Cannot set executor after it has become active.','paramName':'Parameter name: {0}','nullReferenceInPath':'Null reference while evaluating data path: \'{0}\'.','cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.','cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.','format':'One of the identified items was in an invalid format.','assertFailedCaller':'Assertion Failed: {0}\r\nat {1}','argumentOutOfRange':'Specified argument was out of the range of valid values.','webServiceTimedOut':'The server method \'{0}\' timed out.','notImplemented':'The method or operation is not implemented.','assertFailed':'Assertion Failed: {0}','invalidOperation':'Operation is not valid due to the current state of the object.','breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?'}; diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/metadata/endpoints.xml b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/metadata/endpoints.xml new file mode 100644 index 000000000..2e85c9780 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/metadata/endpoints.xml @@ -0,0 +1,773 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/metadata/features.xml b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/metadata/features.xml new file mode 100644 index 000000000..02b834c1b --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/Office/metadata/features.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/_officeintellisense.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/_officeintellisense.js new file mode 100644 index 000000000..a57a5f6e5 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/_officeintellisense.js @@ -0,0 +1,44 @@ +// This file is generated by Visual Studio to enable IntelliSense for the Office JavaScript Object Model. + +var Office = new function() { + this._appContext = 2; + this._showAll = true; + this._setContext = { + + }; +} + +// 1 Excel appContext = 001 +// 2 Word appContext = 010 +// 3 Word + Excel appContext = 011 +// 4 Project appContext = 100 +// 5 Project + Excel appContext = 101 +// 6 Project + Word appContext = 110 +// 7 Project + Word + Excel appContext = 111 +// 8 Outlook read-form appContext = 1000 +// 16 PowerPoint appContext = 10000 +// 17 PowerPoint + Excel appContext = 10001 +// 18 PowerPoint + Word appContext = 10010 +// 19 PowerPoint + Word + Excel appContext = 10011 +// 20 PowerPoint + Project appContext = 10100 +// 21 PowerPoint + Project + Excel appContext = 10101 +// 22 PowerPoint + Project + Word appContext = 10110 +// 23 PowerPoint + Project + Word + Excel appContext = 10111 +// 32 Outlook compose-form appContext = 100000 +// 40 Outlook read-form + Outlook compose form appContext = 101000 +// 64 Access appContext = 1000000 +// 65 Access + Excel appContext = 1000001 +// 66 Access + Word appContext = 1000010 +// 67 Access + Word + Excel appContext = 1000011 +// 68 Access + Project appContext = 1000100 +// 69 Access + Project + Excel appContext = 1000101 +// 70 Access + Project + Word appContext = 1000110 +// 71 Access + Project + Word + Excel appContext = 1000111 +// 80 Access + PowerPoint appContext = 1010000 +// 81 Access + PowerPoint + Excel appContext = 1010001 +// 82 Access + PowerPoint + Word appContext = 1010010 +// 83 Access + PowerPoint + Word + Excel appContext = 1010011 +// 84 Access + PowerPoint + Project appContext = 1010100 +// 85 Access + PowerPoint + Project + Excel appContext = 1010101 +// 86 Access + PowerPoint + Project + Word appContext = 1010110 +// 87 Access + PowerPoint + Project + Word + Excel appContext = 1010111 diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/_references.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/_references.js new file mode 100644 index 000000000..8a93d25a9 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/_references.js @@ -0,0 +1,9 @@ +/// +/* Required to correctly initalize Office.js for intellisense */ +/// +/* Use offline copy of Office.js for intellisense */ +// /// +// /// +/* Use online copy of Office.js for intellisense */ +/// +/// diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/jquery-1.9.1.intellisense.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/jquery-1.9.1.intellisense.js new file mode 100644 index 000000000..4eeb2e36b --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/jquery-1.9.1.intellisense.js @@ -0,0 +1,2676 @@ +/* NUGET: BEGIN LICENSE TEXT +jQuery v1.9.1 +Microsoft grants you the right to use these script files for the sole purpose of either: (i) interacting through your browser with the Microsoft website, subject to the website's terms of use; or (ii) using the files as included with a Microsoft product subject to that product's license terms. Microsoft reserves all other rights to the files not expressly granted by Microsoft, whether by implication, estoppel or otherwise. The notices and licenses below are for informational purposes only. +*************************************************** +* jQuery JavaScript Library v1.9.1 +* http://jquery.com/ +* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors +******************************** +* Includes Sizzle CSS Selector Engine +* http://sizzlejs.com/ +* Copyright 2012 jQuery Foundation and other contributors +******************************************************** +Provided for Informational Purposes Only +MIT License +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* NUGET: END LICENSE TEXT */ +intellisense.annotate(jQuery, { + 'ajax': function() { + /// + /// Perform an asynchronous HTTP (Ajax) request. + /// A string containing the URL to which the request is sent. + /// A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. + /// + /// + /// + /// Perform an asynchronous HTTP (Ajax) request. + /// A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + /// + /// + }, + 'ajaxPrefilter': function() { + /// + /// Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + /// An optional string containing one or more space-separated dataTypes + /// A handler to set default values for future Ajax requests. + /// + }, + 'ajaxSetup': function() { + /// + /// Set default values for future Ajax requests. + /// A set of key/value pairs that configure the default Ajax request. All options are optional. + /// + }, + 'ajaxTransport': function() { + /// + /// Creates an object that handles the actual transmission of Ajax data. + /// A string identifying the data type to use + /// A handler to return the new transport object to use with the data type provided in the first argument. + /// + }, + 'boxModel': function() { + /// Deprecated in jQuery 1.3 (see jQuery.support). States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. + /// + }, + 'browser': function() { + /// Contains flags for the useragent, read from navigator.userAgent. We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery. + /// + }, + 'browser.version': function() { + /// The version number of the rendering engine for the user's browser. + /// + }, + 'Callbacks': function() { + /// + /// A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + /// An optional list of space-separated flags that change how the callback list behaves. + /// + /// + }, + 'contains': function() { + /// + /// Check to see if a DOM element is a descendant of another DOM element. + /// The DOM element that may contain the other element. + /// The DOM element that may be contained by (a descendant of) the other element. + /// + /// + }, + 'cssHooks': function() { + /// Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + /// + }, + 'data': function() { + /// + /// Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + /// The DOM element to query for the data. + /// Name of the data stored. + /// + /// + /// + /// Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + /// The DOM element to query for the data. + /// + /// + }, + 'Deferred': function() { + /// + /// A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + /// A function that is called just before the constructor returns. + /// + /// + }, + 'dequeue': function() { + /// + /// Execute the next function on the queue for the matched element. + /// A DOM element from which to remove and execute a queued function. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + }, + 'each': function() { + /// + /// A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + /// The object or array to iterate over. + /// The function that will be executed on every object. + /// + /// + }, + 'error': function() { + /// + /// Takes a string and throws an exception containing it. + /// The message to send out. + /// + }, + 'extend': function() { + /// + /// Merge the contents of two or more objects together into the first object. + /// An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + /// An object containing additional properties to merge in. + /// Additional objects containing properties to merge in. + /// + /// + /// + /// Merge the contents of two or more objects together into the first object. + /// If true, the merge becomes recursive (aka. deep copy). + /// The object to extend. It will receive the new properties. + /// An object containing additional properties to merge in. + /// Additional objects containing properties to merge in. + /// + /// + }, + 'get': function() { + /// + /// Load data from the server using a HTTP GET request. + /// A string containing the URL to which the request is sent. + /// A plain object or string that is sent to the server with the request. + /// A callback function that is executed if the request succeeds. + /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + /// + /// + }, + 'getJSON': function() { + /// + /// Load JSON-encoded data from the server using a GET HTTP request. + /// A string containing the URL to which the request is sent. + /// A plain object or string that is sent to the server with the request. + /// A callback function that is executed if the request succeeds. + /// + /// + }, + 'getScript': function() { + /// + /// Load a JavaScript file from the server using a GET HTTP request, then execute it. + /// A string containing the URL to which the request is sent. + /// A callback function that is executed if the request succeeds. + /// + /// + }, + 'globalEval': function() { + /// + /// Execute some JavaScript code globally. + /// The JavaScript code to execute. + /// + }, + 'grep': function() { + /// + /// Finds the elements of an array which satisfy a filter function. The original array is not affected. + /// The array to search through. + /// The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. + /// If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. + /// + /// + }, + 'hasData': function() { + /// + /// Determine whether an element has any jQuery data associated with it. + /// A DOM element to be checked for data. + /// + /// + }, + 'holdReady': function() { + /// + /// Holds or releases the execution of jQuery's ready event. + /// Indicates whether the ready hold is being requested or released + /// + }, + 'inArray': function() { + /// + /// Search for a specified value within an array and return its index (or -1 if not found). + /// The value to search for. + /// An array through which to search. + /// The index of the array at which to begin the search. The default is 0, which will search the whole array. + /// + /// + }, + 'isArray': function() { + /// + /// Determine whether the argument is an array. + /// Object to test whether or not it is an array. + /// + /// + }, + 'isEmptyObject': function() { + /// + /// Check to see if an object is empty (contains no enumerable properties). + /// The object that will be checked to see if it's empty. + /// + /// + }, + 'isFunction': function() { + /// + /// Determine if the argument passed is a Javascript function object. + /// Object to test whether or not it is a function. + /// + /// + }, + 'isNumeric': function() { + /// + /// Determines whether its argument is a number. + /// The value to be tested. + /// + /// + }, + 'isPlainObject': function() { + /// + /// Check to see if an object is a plain object (created using "{}" or "new Object"). + /// The object that will be checked to see if it's a plain object. + /// + /// + }, + 'isWindow': function() { + /// + /// Determine whether the argument is a window. + /// Object to test whether or not it is a window. + /// + /// + }, + 'isXMLDoc': function() { + /// + /// Check to see if a DOM node is within an XML document (or is an XML document). + /// The DOM node that will be checked to see if it's in an XML document. + /// + /// + }, + 'makeArray': function() { + /// + /// Convert an array-like object into a true JavaScript array. + /// Any object to turn into a native Array. + /// + /// + }, + 'map': function() { + /// + /// Translate all items in an array or object to new array of items. + /// The Array to translate. + /// The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + /// + /// + /// + /// Translate all items in an array or object to new array of items. + /// The Array or Object to translate. + /// The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + /// + /// + }, + 'merge': function() { + /// + /// Merge the contents of two arrays together into the first array. + /// The first array to merge, the elements of second added. + /// The second array to merge into the first, unaltered. + /// + /// + }, + 'noConflict': function() { + /// + /// Relinquish jQuery's control of the $ variable. + /// A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + /// + /// + }, + 'noop': function() { + /// An empty function. + }, + 'now': function() { + /// Return a number representing the current time. + /// + }, + 'param': function() { + /// + /// Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + /// An array or object to serialize. + /// + /// + /// + /// Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + /// An array or object to serialize. + /// A Boolean indicating whether to perform a traditional "shallow" serialization. + /// + /// + }, + 'parseHTML': function() { + /// + /// Parses a string into an array of DOM nodes. + /// HTML string to be parsed + /// DOM element to serve as the context in which the HTML fragment will be created + /// A Boolean indicating whether to include scripts passed in the HTML string + /// + /// + }, + 'parseJSON': function() { + /// + /// Takes a well-formed JSON string and returns the resulting JavaScript object. + /// The JSON string to parse. + /// + /// + }, + 'parseXML': function() { + /// + /// Parses a string into an XML document. + /// a well-formed XML string to be parsed + /// + /// + }, + 'post': function() { + /// + /// Load data from the server using a HTTP POST request. + /// A string containing the URL to which the request is sent. + /// A plain object or string that is sent to the server with the request. + /// A callback function that is executed if the request succeeds. + /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + /// + /// + }, + 'proxy': function() { + /// + /// Takes a function and returns a new one that will always have a particular context. + /// The function whose context will be changed. + /// The object to which the context (this) of the function should be set. + /// + /// + /// + /// Takes a function and returns a new one that will always have a particular context. + /// The object to which the context of the function should be set. + /// The name of the function whose context will be changed (should be a property of the context object). + /// + /// + /// + /// Takes a function and returns a new one that will always have a particular context. + /// The function whose context will be changed. + /// The object to which the context (this) of the function should be set. + /// Any number of arguments to be passed to the function referenced in the function argument. + /// + /// + /// + /// Takes a function and returns a new one that will always have a particular context. + /// The object to which the context of the function should be set. + /// The name of the function whose context will be changed (should be a property of the context object). + /// Any number of arguments to be passed to the function named in the name argument. + /// + /// + }, + 'queue': function() { + /// + /// Manipulate the queue of functions to be executed on the matched element. + /// A DOM element where the array of queued functions is attached. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// An array of functions to replace the current queue contents. + /// + /// + /// + /// Manipulate the queue of functions to be executed on the matched element. + /// A DOM element on which to add a queued function. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// The new function to add to the queue. + /// + /// + }, + 'removeData': function() { + /// + /// Remove a previously-stored piece of data. + /// A DOM element from which to remove data. + /// A string naming the piece of data to remove. + /// + /// + }, + 'sub': function() { + /// Creates a new copy of jQuery whose properties and methods can be modified without affecting the original jQuery object. + /// + }, + 'support': function() { + /// A collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. + /// + }, + 'trim': function() { + /// + /// Remove the whitespace from the beginning and end of a string. + /// The string to trim. + /// + /// + }, + 'type': function() { + /// + /// Determine the internal JavaScript [[Class]] of an object. + /// Object to get the internal JavaScript [[Class]] of. + /// + /// + }, + 'unique': function() { + /// + /// Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + /// The Array of DOM elements. + /// + /// + }, + 'when': function() { + /// + /// Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + /// One or more Deferred objects, or plain JavaScript objects. + /// + /// + }, +}); + +var _1228819969 = jQuery.Callbacks; +jQuery.Callbacks = function(flags) { +var _object = _1228819969(flags); +intellisense.annotate(_object, { + 'add': function() { + /// + /// Add a callback or a collection of callbacks to a callback list. + /// A function, or array of functions, that are to be added to the callback list. + /// + /// + }, + 'disable': function() { + /// Disable a callback list from doing anything more. + /// + }, + 'disabled': function() { + /// Determine if the callbacks list has been disabled. + /// + }, + 'empty': function() { + /// Remove all of the callbacks from a list. + /// + }, + 'fire': function() { + /// + /// Call all of the callbacks with the given arguments + /// The argument or list of arguments to pass back to the callback list. + /// + /// + }, + 'fired': function() { + /// Determine if the callbacks have already been called at least once. + /// + }, + 'fireWith': function() { + /// + /// Call all callbacks in a list with the given context and arguments. + /// A reference to the context in which the callbacks in the list should be fired. + /// An argument, or array of arguments, to pass to the callbacks in the list. + /// + /// + }, + 'has': function() { + /// + /// Determine whether a supplied callback is in a list + /// The callback to search for. + /// + /// + }, + 'lock': function() { + /// Lock a callback list in its current state. + /// + }, + 'locked': function() { + /// Determine if the callbacks list has been locked. + /// + }, + 'remove': function() { + /// + /// Remove a callback or a collection of callbacks from a callback list. + /// A function, or array of functions, that are to be removed from the callback list. + /// + /// + }, +}); + +return _object; +}; +intellisense.redirectDefinition(jQuery.Callbacks, _1228819969); + +var _731531622 = jQuery.Deferred; +jQuery.Deferred = function(func) { +var _object = _731531622(func); +intellisense.annotate(_object, { + 'always': function() { + /// + /// Add handlers to be called when the Deferred object is either resolved or rejected. + /// A function, or array of functions, that is called when the Deferred is resolved or rejected. + /// Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + /// + /// + }, + 'done': function() { + /// + /// Add handlers to be called when the Deferred object is resolved. + /// A function, or array of functions, that are called when the Deferred is resolved. + /// Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + /// + /// + }, + 'fail': function() { + /// + /// Add handlers to be called when the Deferred object is rejected. + /// A function, or array of functions, that are called when the Deferred is rejected. + /// Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + /// + /// + }, + 'isRejected': function() { + /// Determine whether a Deferred object has been rejected. + /// + }, + 'isResolved': function() { + /// Determine whether a Deferred object has been resolved. + /// + }, + 'notify': function() { + /// + /// Call the progressCallbacks on a Deferred object with the given args. + /// Optional arguments that are passed to the progressCallbacks. + /// + /// + }, + 'notifyWith': function() { + /// + /// Call the progressCallbacks on a Deferred object with the given context and args. + /// Context passed to the progressCallbacks as the this object. + /// Optional arguments that are passed to the progressCallbacks. + /// + /// + }, + 'pipe': function() { + /// + /// Utility method to filter and/or chain Deferreds. + /// An optional function that is called when the Deferred is resolved. + /// An optional function that is called when the Deferred is rejected. + /// + /// + /// + /// Utility method to filter and/or chain Deferreds. + /// An optional function that is called when the Deferred is resolved. + /// An optional function that is called when the Deferred is rejected. + /// An optional function that is called when progress notifications are sent to the Deferred. + /// + /// + }, + 'progress': function() { + /// + /// Add handlers to be called when the Deferred object generates progress notifications. + /// A function, or array of functions, that is called when the Deferred generates progress notifications. + /// + /// + }, + 'promise': function() { + /// + /// Return a Deferred's Promise object. + /// Object onto which the promise methods have to be attached + /// + /// + }, + 'reject': function() { + /// + /// Reject a Deferred object and call any failCallbacks with the given args. + /// Optional arguments that are passed to the failCallbacks. + /// + /// + }, + 'rejectWith': function() { + /// + /// Reject a Deferred object and call any failCallbacks with the given context and args. + /// Context passed to the failCallbacks as the this object. + /// An optional array of arguments that are passed to the failCallbacks. + /// + /// + }, + 'resolve': function() { + /// + /// Resolve a Deferred object and call any doneCallbacks with the given args. + /// Optional arguments that are passed to the doneCallbacks. + /// + /// + }, + 'resolveWith': function() { + /// + /// Resolve a Deferred object and call any doneCallbacks with the given context and args. + /// Context passed to the doneCallbacks as the this object. + /// An optional array of arguments that are passed to the doneCallbacks. + /// + /// + }, + 'state': function() { + /// Determine the current state of a Deferred object. + /// + }, + 'then': function() { + /// + /// Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + /// A function that is called when the Deferred is resolved. + /// An optional function that is called when the Deferred is rejected. + /// An optional function that is called when progress notifications are sent to the Deferred. + /// + /// + /// + /// Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + /// A function, or array of functions, called when the Deferred is resolved. + /// A function, or array of functions, called when the Deferred is rejected. + /// + /// + /// + /// Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + /// A function, or array of functions, called when the Deferred is resolved. + /// A function, or array of functions, called when the Deferred is rejected. + /// A function, or array of functions, called when the Deferred notifies progress. + /// + /// + }, +}); + +return _object; +}; +intellisense.redirectDefinition(jQuery.Callbacks, _731531622); + +intellisense.annotate(jQuery.Event.prototype, { + 'currentTarget': function() { + /// The current DOM element within the event bubbling phase. + /// + }, + 'data': function() { + /// An optional object of data passed to an event method when the current executing handler is bound. + /// + }, + 'delegateTarget': function() { + /// The element where the currently-called jQuery event handler was attached. + /// + }, + 'isDefaultPrevented': function() { + /// Returns whether event.preventDefault() was ever called on this event object. + /// + }, + 'isImmediatePropagationStopped': function() { + /// Returns whether event.stopImmediatePropagation() was ever called on this event object. + /// + }, + 'isPropagationStopped': function() { + /// Returns whether event.stopPropagation() was ever called on this event object. + /// + }, + 'metaKey': function() { + /// Indicates whether the META key was pressed when the event fired. + /// + }, + 'namespace': function() { + /// The namespace specified when the event was triggered. + /// + }, + 'pageX': function() { + /// The mouse position relative to the left edge of the document. + /// + }, + 'pageY': function() { + /// The mouse position relative to the top edge of the document. + /// + }, + 'preventDefault': function() { + /// If this method is called, the default action of the event will not be triggered. + }, + 'relatedTarget': function() { + /// The other DOM element involved in the event, if any. + /// + }, + 'result': function() { + /// The last value returned by an event handler that was triggered by this event, unless the value was undefined. + /// + }, + 'stopImmediatePropagation': function() { + /// Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. + }, + 'stopPropagation': function() { + /// Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. + }, + 'target': function() { + /// The DOM element that initiated the event. + /// + }, + 'timeStamp': function() { + /// The difference in milliseconds between the time the browser created the event and January 1, 1970. + /// + }, + 'type': function() { + /// Describes the nature of the event. + /// + }, + 'which': function() { + /// For key or mouse events, this property indicates the specific key or button that was pressed. + /// + }, +}); + +intellisense.annotate(jQuery.fn, { + 'add': function() { + /// + /// Add elements to the set of matched elements. + /// A string representing a selector expression to find additional elements to add to the set of matched elements. + /// + /// + /// + /// Add elements to the set of matched elements. + /// One or more elements to add to the set of matched elements. + /// + /// + /// + /// Add elements to the set of matched elements. + /// An HTML fragment to add to the set of matched elements. + /// + /// + /// + /// Add elements to the set of matched elements. + /// An existing jQuery object to add to the set of matched elements. + /// + /// + /// + /// Add elements to the set of matched elements. + /// A string representing a selector expression to find additional elements to add to the set of matched elements. + /// The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. + /// + /// + }, + 'addBack': function() { + /// + /// Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + /// A string containing a selector expression to match the current set of elements against. + /// + /// + }, + 'addClass': function() { + /// + /// Adds the specified class(es) to each of the set of matched elements. + /// One or more space-separated classes to be added to the class attribute of each matched element. + /// + /// + /// + /// Adds the specified class(es) to each of the set of matched elements. + /// A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + /// + /// + }, + 'after': function() { + /// + /// Insert content, specified by the parameter, after each element in the set of matched elements. + /// HTML string, DOM element, or jQuery object to insert after each element in the set of matched elements. + /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + /// + /// + /// + /// Insert content, specified by the parameter, after each element in the set of matched elements. + /// A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + /// + /// + }, + 'ajaxComplete': function() { + /// + /// Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + /// The function to be invoked. + /// + /// + }, + 'ajaxError': function() { + /// + /// Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + /// The function to be invoked. + /// + /// + }, + 'ajaxSend': function() { + /// + /// Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + /// The function to be invoked. + /// + /// + }, + 'ajaxStart': function() { + /// + /// Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + /// The function to be invoked. + /// + /// + }, + 'ajaxStop': function() { + /// + /// Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + /// The function to be invoked. + /// + /// + }, + 'ajaxSuccess': function() { + /// + /// Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + /// The function to be invoked. + /// + /// + }, + 'all': function() { + /// Selects all elements. + }, + 'andSelf': function() { + /// Add the previous set of elements on the stack to the current set. + /// + }, + 'animate': function() { + /// + /// Perform a custom animation of a set of CSS properties. + /// An object of CSS properties and values that the animation will move toward. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + /// + /// Perform a custom animation of a set of CSS properties. + /// An object of CSS properties and values that the animation will move toward. + /// A map of additional options to pass to the method. + /// + /// + }, + 'animated': function() { + /// Select all elements that are in the progress of an animation at the time the selector is run. + }, + 'append': function() { + /// + /// Insert content, specified by the parameter, to the end of each element in the set of matched elements. + /// DOM element, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + /// + /// + /// + /// Insert content, specified by the parameter, to the end of each element in the set of matched elements. + /// A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + /// + /// + }, + 'appendTo': function() { + /// + /// Insert every element in the set of matched elements to the end of the target. + /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + /// + /// + }, + 'attr': function() { + /// + /// Set one or more attributes for the set of matched elements. + /// The name of the attribute to set. + /// A value to set for the attribute. + /// + /// + /// + /// Set one or more attributes for the set of matched elements. + /// An object of attribute-value pairs to set. + /// + /// + /// + /// Set one or more attributes for the set of matched elements. + /// The name of the attribute to set. + /// A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + /// + /// + }, + 'attributeContains': function() { + /// + /// Selects elements that have the specified attribute with a value containing the a given substring. + /// An attribute name. + /// An attribute value. Can be either an unquoted single word or a quoted string. + /// + }, + 'attributeContainsPrefix': function() { + /// + /// Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-). + /// An attribute name. + /// An attribute value. Can be either an unquoted single word or a quoted string. + /// + }, + 'attributeContainsWord': function() { + /// + /// Selects elements that have the specified attribute with a value containing a given word, delimited by spaces. + /// An attribute name. + /// An attribute value. Can be either an unquoted single word or a quoted string. + /// + }, + 'attributeEndsWith': function() { + /// + /// Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive. + /// An attribute name. + /// An attribute value. Can be either an unquoted single word or a quoted string. + /// + }, + 'attributeEquals': function() { + /// + /// Selects elements that have the specified attribute with a value exactly equal to a certain value. + /// An attribute name. + /// An attribute value. Can be either an unquoted single word or a quoted string. + /// + }, + 'attributeHas': function() { + /// + /// Selects elements that have the specified attribute, with any value. + /// An attribute name. + /// + }, + 'attributeMultiple': function() { + /// + /// Matches elements that match all of the specified attribute filters. + /// An attribute filter. + /// Another attribute filter, reducing the selection even more + /// As many more attribute filters as necessary + /// + }, + 'attributeNotEqual': function() { + /// + /// Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value. + /// An attribute name. + /// An attribute value. Can be either an unquoted single word or a quoted string. + /// + }, + 'attributeStartsWith': function() { + /// + /// Selects elements that have the specified attribute with a value beginning exactly with a given string. + /// An attribute name. + /// An attribute value. Can be either an unquoted single word or a quoted string. + /// + }, + 'before': function() { + /// + /// Insert content, specified by the parameter, before each element in the set of matched elements. + /// HTML string, DOM element, or jQuery object to insert before each element in the set of matched elements. + /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + /// + /// + /// + /// Insert content, specified by the parameter, before each element in the set of matched elements. + /// A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + /// + /// + }, + 'bind': function() { + /// + /// Attach a handler to an event for the elements. + /// A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Attach a handler to an event for the elements. + /// A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + /// An object containing data that will be passed to the event handler. + /// Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + /// + /// + /// + /// Attach a handler to an event for the elements. + /// An object containing one or more DOM event types and functions to execute for them. + /// + /// + }, + 'blur': function() { + /// + /// Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'button': function() { + /// Selects all button elements and elements of type button. + }, + 'change': function() { + /// + /// Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'checkbox': function() { + /// Selects all elements of type checkbox. + }, + 'checked': function() { + /// Matches all elements that are checked. + }, + 'child': function() { + /// + /// Selects all direct child elements specified by "child" of elements specified by "parent". + /// Any valid selector. + /// A selector to filter the child elements. + /// + }, + 'children': function() { + /// + /// Get the children of each element in the set of matched elements, optionally filtered by a selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'class': function() { + /// + /// Selects all elements with the given class. + /// A class to search for. An element can have multiple classes; only one of them must match. + /// + }, + 'clearQueue': function() { + /// + /// Remove from the queue all items that have not yet been run. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + }, + 'click': function() { + /// + /// Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'clone': function() { + /// + /// Create a deep copy of the set of matched elements. + /// A Boolean indicating whether event handlers should be copied along with the elements. As of jQuery 1.4, element data will be copied as well. + /// + /// + /// + /// Create a deep copy of the set of matched elements. + /// A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back to false in 1.5.1 and up. + /// A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). + /// + /// + }, + 'closest': function() { + /// + /// For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + /// A string containing a selector expression to match elements against. + /// A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + /// + /// + /// + /// For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + /// A jQuery object to match elements against. + /// + /// + /// + /// For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + /// An element to match elements against. + /// + /// + }, + 'contains': function() { + /// + /// Select all elements that contain the specified text. + /// A string of text to look for. It's case sensitive. + /// + }, + 'contents': function() { + /// Get the children of each element in the set of matched elements, including text and comment nodes. + /// + }, + 'context': function() { + /// The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. + /// + }, + 'css': function() { + /// + /// Set one or more CSS properties for the set of matched elements. + /// A CSS property name. + /// A value to set for the property. + /// + /// + /// + /// Set one or more CSS properties for the set of matched elements. + /// A CSS property name. + /// A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + /// + /// + /// + /// Set one or more CSS properties for the set of matched elements. + /// An object of property-value pairs to set. + /// + /// + }, + 'data': function() { + /// + /// Store arbitrary data associated with the matched elements. + /// A string naming the piece of data to set. + /// The new data value; it can be any Javascript type including Array or Object. + /// + /// + /// + /// Store arbitrary data associated with the matched elements. + /// An object of key-value pairs of data to update. + /// + /// + }, + 'dblclick': function() { + /// + /// Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'delay': function() { + /// + /// Set a timer to delay execution of subsequent items in the queue. + /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + }, + 'delegate': function() { + /// + /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + /// A selector to filter the elements that trigger the event. + /// A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names. + /// A function to execute at the time the event is triggered. + /// + /// + /// + /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + /// A selector to filter the elements that trigger the event. + /// A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names. + /// An object containing data that will be passed to the event handler. + /// A function to execute at the time the event is triggered. + /// + /// + /// + /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + /// A selector to filter the elements that trigger the event. + /// A plain object of one or more event types and functions to execute for them. + /// + /// + }, + 'dequeue': function() { + /// + /// Execute the next function on the queue for the matched elements. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + }, + 'descendant': function() { + /// + /// Selects all elements that are descendants of a given ancestor. + /// Any valid selector. + /// A selector to filter the descendant elements. + /// + }, + 'detach': function() { + /// + /// Remove the set of matched elements from the DOM. + /// A selector expression that filters the set of matched elements to be removed. + /// + /// + }, + 'die': function() { + /// + /// Remove event handlers previously attached using .live() from the elements. + /// A string containing a JavaScript event type, such as click or keydown. + /// The function that is no longer to be executed. + /// + /// + /// + /// Remove event handlers previously attached using .live() from the elements. + /// A plain object of one or more event types, such as click or keydown and their corresponding functions that are no longer to be executed. + /// + /// + }, + 'disabled': function() { + /// Selects all elements that are disabled. + }, + 'each': function() { + /// + /// Iterate over a jQuery object, executing a function for each matched element. + /// A function to execute for each matched element. + /// + /// + }, + 'element': function() { + /// + /// Selects all elements with the given tag name. + /// An element to search for. Refers to the tagName of DOM nodes. + /// + }, + 'empty': function() { + /// Select all elements that have no children (including text nodes). + }, + 'enabled': function() { + /// Selects all elements that are enabled. + }, + 'end': function() { + /// End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + /// + }, + 'eq': function() { + /// + /// Select the element at index n within the matched set. + /// Zero-based index of the element to match. + /// + /// + /// Select the element at index n within the matched set. + /// Zero-based index of the element to match, counting backwards from the last element. + /// + }, + 'error': function() { + /// + /// Bind an event handler to the "error" JavaScript event. + /// A function to execute when the event is triggered. + /// + /// + /// + /// Bind an event handler to the "error" JavaScript event. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'even': function() { + /// Selects even elements, zero-indexed. See also odd. + }, + 'fadeIn': function() { + /// + /// Display the matched elements by fading them to opaque. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Display the matched elements by fading them to opaque. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Display the matched elements by fading them to opaque. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'fadeOut': function() { + /// + /// Hide the matched elements by fading them to transparent. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Hide the matched elements by fading them to transparent. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Hide the matched elements by fading them to transparent. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'fadeTo': function() { + /// + /// Adjust the opacity of the matched elements. + /// A string or number determining how long the animation will run. + /// A number between 0 and 1 denoting the target opacity. + /// A function to call once the animation is complete. + /// + /// + /// + /// Adjust the opacity of the matched elements. + /// A string or number determining how long the animation will run. + /// A number between 0 and 1 denoting the target opacity. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'fadeToggle': function() { + /// + /// Display or hide the matched elements by animating their opacity. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + /// + /// Display or hide the matched elements by animating their opacity. + /// A map of additional options to pass to the method. + /// + /// + }, + 'file': function() { + /// Selects all elements of type file. + }, + 'filter': function() { + /// + /// Reduce the set of matched elements to those that match the selector or pass the function's test. + /// A string containing a selector expression to match the current set of elements against. + /// + /// + /// + /// Reduce the set of matched elements to those that match the selector or pass the function's test. + /// A function used as a test for each element in the set. this is the current DOM element. + /// + /// + /// + /// Reduce the set of matched elements to those that match the selector or pass the function's test. + /// An element to match the current set of elements against. + /// + /// + /// + /// Reduce the set of matched elements to those that match the selector or pass the function's test. + /// An existing jQuery object to match the current set of elements against. + /// + /// + }, + 'find': function() { + /// + /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + /// A jQuery object to match elements against. + /// + /// + /// + /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + /// An element to match elements against. + /// + /// + }, + 'finish': function() { + /// + /// Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + /// The name of the queue in which to stop animations. + /// + /// + }, + 'first': function() { + /// Selects the first matched element. + }, + 'first-child': function() { + /// Selects all elements that are the first child of their parent. + }, + 'first-of-type': function() { + /// Selects all elements that are the first among siblings of the same element name. + }, + 'focus': function() { + /// + /// Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'focusin': function() { + /// + /// Bind an event handler to the "focusin" event. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "focusin" event. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'focusout': function() { + /// + /// Bind an event handler to the "focusout" JavaScript event. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "focusout" JavaScript event. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'get': function() { + /// + /// Retrieve the DOM elements matched by the jQuery object. + /// A zero-based integer indicating which element to retrieve. + /// + /// + }, + 'gt': function() { + /// + /// Select all elements at an index greater than index within the matched set. + /// Zero-based index. + /// + }, + 'has': function() { + /// + /// Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + /// A DOM element to match elements against. + /// + /// + }, + 'hasClass': function() { + /// + /// Determine whether any of the matched elements are assigned the given class. + /// The class name to search for. + /// + /// + }, + 'header': function() { + /// Selects all elements that are headers, like h1, h2, h3 and so on. + }, + 'height': function() { + /// + /// Set the CSS height of every matched element. + /// An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + /// + /// + /// + /// Set the CSS height of every matched element. + /// A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. + /// + /// + }, + 'hidden': function() { + /// Selects all elements that are hidden. + }, + 'hide': function() { + /// + /// Hide the matched elements. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Hide the matched elements. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Hide the matched elements. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'hover': function() { + /// + /// Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + /// A function to execute when the mouse pointer enters the element. + /// A function to execute when the mouse pointer leaves the element. + /// + /// + }, + 'html': function() { + /// + /// Set the HTML contents of each element in the set of matched elements. + /// A string of HTML to set as the content of each matched element. + /// + /// + /// + /// Set the HTML contents of each element in the set of matched elements. + /// A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + /// + /// + }, + 'id': function() { + /// + /// Selects a single element with the given id attribute. + /// An ID to search for, specified via the id attribute of an element. + /// + }, + 'image': function() { + /// Selects all elements of type image. + }, + 'index': function() { + /// + /// Search for a given element from among the matched elements. + /// A selector representing a jQuery collection in which to look for an element. + /// + /// + /// + /// Search for a given element from among the matched elements. + /// The DOM element or first element within the jQuery object to look for. + /// + /// + }, + 'init': function() { + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// A string containing a selector expression + /// A DOM Element, Document, or jQuery to use as context + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// A DOM element to wrap in a jQuery object. + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// An array containing a set of DOM elements to wrap in a jQuery object. + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// A plain object to wrap in a jQuery object. + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// An existing jQuery object to clone. + /// + /// + }, + 'innerHeight': function() { + /// Get the current computed height for the first element in the set of matched elements, including padding but not border. + /// + }, + 'innerWidth': function() { + /// Get the current computed width for the first element in the set of matched elements, including padding but not border. + /// + }, + 'input': function() { + /// Selects all input, textarea, select and button elements. + }, + 'insertAfter': function() { + /// + /// Insert every element in the set of matched elements after the target. + /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + /// + /// + }, + 'insertBefore': function() { + /// + /// Insert every element in the set of matched elements before the target. + /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + /// + /// + }, + 'is': function() { + /// + /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + /// A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + /// + /// + /// + /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + /// An existing jQuery object to match the current set of elements against. + /// + /// + /// + /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + /// An element to match the current set of elements against. + /// + /// + }, + 'jquery': function() { + /// A string containing the jQuery version number. + /// + }, + 'keydown': function() { + /// + /// Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'keypress': function() { + /// + /// Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'keyup': function() { + /// + /// Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'lang': function() { + /// + /// Selects all elements of the specified language. + /// A language code. + /// + }, + 'last': function() { + /// Selects the last matched element. + }, + 'last-child': function() { + /// Selects all elements that are the last child of their parent. + }, + 'last-of-type': function() { + /// Selects all elements that are the last among siblings of the same element name. + }, + 'length': function() { + /// The number of elements in the jQuery object. + /// + }, + 'live': function() { + /// + /// Attach an event handler for all elements which match the current selector, now and in the future. + /// A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names. + /// A function to execute at the time the event is triggered. + /// + /// + /// + /// Attach an event handler for all elements which match the current selector, now and in the future. + /// A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names. + /// An object containing data that will be passed to the event handler. + /// A function to execute at the time the event is triggered. + /// + /// + /// + /// Attach an event handler for all elements which match the current selector, now and in the future. + /// A plain object of one or more JavaScript event types and functions to execute for them. + /// + /// + }, + 'load': function() { + /// + /// Bind an event handler to the "load" JavaScript event. + /// A function to execute when the event is triggered. + /// + /// + /// + /// Bind an event handler to the "load" JavaScript event. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'lt': function() { + /// + /// Select all elements at an index less than index within the matched set. + /// Zero-based index. + /// + }, + 'map': function() { + /// + /// Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + /// A function object that will be invoked for each element in the current set. + /// + /// + }, + 'mousedown': function() { + /// + /// Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'mouseenter': function() { + /// + /// Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'mouseleave': function() { + /// + /// Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'mousemove': function() { + /// + /// Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'mouseout': function() { + /// + /// Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'mouseover': function() { + /// + /// Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'mouseup': function() { + /// + /// Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'multiple': function() { + /// + /// Selects the combined results of all the specified selectors. + /// Any valid selector. + /// Another valid selector. + /// As many more valid selectors as you like. + /// + }, + 'next': function() { + /// + /// Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'next adjacent': function() { + /// + /// Selects all next elements matching "next" that are immediately preceded by a sibling "prev". + /// Any valid selector. + /// A selector to match the element that is next to the first selector. + /// + }, + 'next siblings': function() { + /// + /// Selects all sibling elements that follow after the "prev" element, have the same parent, and match the filtering "siblings" selector. + /// Any valid selector. + /// A selector to filter elements that are the following siblings of the first selector. + /// + }, + 'nextAll': function() { + /// + /// Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'nextUntil': function() { + /// + /// Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + /// A string containing a selector expression to indicate where to stop matching following sibling elements. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + /// A DOM node or jQuery object indicating where to stop matching following sibling elements. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'not': function() { + /// + /// Remove elements from the set of matched elements. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// Remove elements from the set of matched elements. + /// One or more DOM elements to remove from the matched set. + /// + /// + /// + /// Remove elements from the set of matched elements. + /// A function used as a test for each element in the set. this is the current DOM element. + /// + /// + /// + /// Remove elements from the set of matched elements. + /// An existing jQuery object to match the current set of elements against. + /// + /// + }, + 'nth-child': function() { + /// + /// Selects all elements that are the nth-child of their parent. + /// The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-child(even), :nth-child(4n) ) + /// + }, + 'nth-last-child': function() { + /// + /// Selects all elements that are the nth-child of their parent, counting from the last element to the first. + /// The index of each child to match, starting with the last one (1), the string even or odd, or an equation ( eg. :nth-last-child(even), :nth-last-child(4n) ) + /// + }, + 'nth-last-of-type': function() { + /// + /// Selects all elements that are the nth-child of their parent, counting from the last element to the first. + /// The index of each child to match, starting with the last one (1), the string even or odd, or an equation ( eg. :nth-last-of-type(even), :nth-last-of-type(4n) ) + /// + }, + 'nth-of-type': function() { + /// + /// Selects all elements that are the nth child of their parent in relation to siblings with the same element name. + /// The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-of-type(even), :nth-of-type(4n) ) + /// + }, + 'odd': function() { + /// Selects odd elements, zero-indexed. See also even. + }, + 'off': function() { + /// + /// Remove an event handler. + /// One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + /// A selector which should match the one originally passed to .on() when attaching event handlers. + /// A handler function previously attached for the event(s), or the special value false. + /// + /// + /// + /// Remove an event handler. + /// An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). + /// A selector which should match the one originally passed to .on() when attaching event handlers. + /// + /// + }, + 'offset': function() { + /// + /// Set the current coordinates of every element in the set of matched elements, relative to the document. + /// An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + /// + /// + /// + /// Set the current coordinates of every element in the set of matched elements, relative to the document. + /// A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. + /// + /// + }, + 'offsetParent': function() { + /// Get the closest ancestor element that is positioned. + /// + }, + 'on': function() { + /// + /// Attach an event handler function for one or more events to the selected elements. + /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + /// Data to be passed to the handler in event.data when an event is triggered. + /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + /// + /// + /// + /// Attach an event handler function for one or more events to the selected elements. + /// An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + /// A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + /// Data to be passed to the handler in event.data when an event occurs. + /// + /// + }, + 'one': function() { + /// + /// Attach a handler to an event for the elements. The handler is executed at most once per element. + /// A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + /// An object containing data that will be passed to the event handler. + /// A function to execute at the time the event is triggered. + /// + /// + /// + /// Attach a handler to an event for the elements. The handler is executed at most once per element. + /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + /// Data to be passed to the handler in event.data when an event is triggered. + /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + /// + /// + /// + /// Attach a handler to an event for the elements. The handler is executed at most once per element. + /// An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + /// A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + /// Data to be passed to the handler in event.data when an event occurs. + /// + /// + }, + 'only-child': function() { + /// Selects all elements that are the only child of their parent. + }, + 'only-of-type': function() { + /// Selects all elements that have no siblings with the same element name. + }, + 'outerHeight': function() { + /// + /// Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + /// A Boolean indicating whether to include the element's margin in the calculation. + /// + /// + }, + 'outerWidth': function() { + /// + /// Get the current computed width for the first element in the set of matched elements, including padding and border. + /// A Boolean indicating whether to include the element's margin in the calculation. + /// + /// + }, + 'parent': function() { + /// + /// Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'parents': function() { + /// + /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'parentsUntil': function() { + /// + /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + /// A string containing a selector expression to indicate where to stop matching ancestor elements. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + /// A DOM node or jQuery object indicating where to stop matching ancestor elements. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'password': function() { + /// Selects all elements of type password. + }, + 'position': function() { + /// Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + /// + }, + 'prepend': function() { + /// + /// Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + /// DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + /// + /// + /// + /// Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + /// A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + /// + /// + }, + 'prependTo': function() { + /// + /// Insert every element in the set of matched elements to the beginning of the target. + /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. + /// + /// + }, + 'prev': function() { + /// + /// Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'prevAll': function() { + /// + /// Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'prevUntil': function() { + /// + /// Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + /// A string containing a selector expression to indicate where to stop matching preceding sibling elements. + /// A string containing a selector expression to match elements against. + /// + /// + /// + /// Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + /// A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'promise': function() { + /// + /// Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + /// The type of queue that needs to be observed. + /// Object onto which the promise methods have to be attached + /// + /// + }, + 'prop': function() { + /// + /// Set one or more properties for the set of matched elements. + /// The name of the property to set. + /// A value to set for the property. + /// + /// + /// + /// Set one or more properties for the set of matched elements. + /// An object of property-value pairs to set. + /// + /// + /// + /// Set one or more properties for the set of matched elements. + /// The name of the property to set. + /// A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. + /// + /// + }, + 'pushStack': function() { + /// + /// Add a collection of DOM elements onto the jQuery stack. + /// An array of elements to push onto the stack and make into a new jQuery object. + /// + /// + /// + /// Add a collection of DOM elements onto the jQuery stack. + /// An array of elements to push onto the stack and make into a new jQuery object. + /// The name of a jQuery method that generated the array of elements. + /// The arguments that were passed in to the jQuery method (for serialization). + /// + /// + }, + 'queue': function() { + /// + /// Manipulate the queue of functions to be executed, once for each matched element. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// An array of functions to replace the current queue contents. + /// + /// + /// + /// Manipulate the queue of functions to be executed, once for each matched element. + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// The new function to add to the queue, with a function to call that will dequeue the next item. + /// + /// + }, + 'radio': function() { + /// Selects all elements of type radio. + }, + 'ready': function() { + /// + /// Specify a function to execute when the DOM is fully loaded. + /// A function to execute after the DOM is ready. + /// + /// + }, + 'remove': function() { + /// + /// Remove the set of matched elements from the DOM. + /// A selector expression that filters the set of matched elements to be removed. + /// + /// + }, + 'removeAttr': function() { + /// + /// Remove an attribute from each element in the set of matched elements. + /// An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + /// + /// + }, + 'removeClass': function() { + /// + /// Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + /// One or more space-separated classes to be removed from the class attribute of each matched element. + /// + /// + /// + /// Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + /// A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + /// + /// + }, + 'removeData': function() { + /// + /// Remove a previously-stored piece of data. + /// A string naming the piece of data to delete. + /// + /// + /// + /// Remove a previously-stored piece of data. + /// An array or space-separated string naming the pieces of data to delete. + /// + /// + }, + 'removeProp': function() { + /// + /// Remove a property for the set of matched elements. + /// The name of the property to remove. + /// + /// + }, + 'replaceAll': function() { + /// + /// Replace each target element with the set of matched elements. + /// A selector expression indicating which element(s) to replace. + /// + /// + }, + 'replaceWith': function() { + /// + /// Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + /// The content to insert. May be an HTML string, DOM element, or jQuery object. + /// + /// + /// + /// Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + /// A function that returns content with which to replace the set of matched elements. + /// + /// + }, + 'reset': function() { + /// Selects all elements of type reset. + }, + 'resize': function() { + /// + /// Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'root': function() { + /// + /// Selects the element that is the root of the document. + /// The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-last-child(even), :nth-last-child(4n) ) + /// + }, + 'scroll': function() { + /// + /// Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'scrollLeft': function() { + /// + /// Set the current horizontal position of the scroll bar for each of the set of matched elements. + /// An integer indicating the new position to set the scroll bar to. + /// + /// + }, + 'scrollTop': function() { + /// + /// Set the current vertical position of the scroll bar for each of the set of matched elements. + /// An integer indicating the new position to set the scroll bar to. + /// + /// + }, + 'select': function() { + /// + /// Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'selected': function() { + /// Selects all elements that are selected. + }, + 'selector': function() { + /// A selector representing selector originally passed to jQuery(). + /// + }, + 'serialize': function() { + /// Encode a set of form elements as a string for submission. + /// + }, + 'serializeArray': function() { + /// Encode a set of form elements as an array of names and values. + /// + }, + 'show': function() { + /// + /// Display the matched elements. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Display the matched elements. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Display the matched elements. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'siblings': function() { + /// + /// Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + /// A string containing a selector expression to match elements against. + /// + /// + }, + 'size': function() { + /// Return the number of elements in the jQuery object. + /// + }, + 'slice': function() { + /// + /// Reduce the set of matched elements to a subset specified by a range of indices. + /// An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. + /// An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + /// + /// + }, + 'slideDown': function() { + /// + /// Display the matched elements with a sliding motion. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Display the matched elements with a sliding motion. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Display the matched elements with a sliding motion. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'slideToggle': function() { + /// + /// Display or hide the matched elements with a sliding motion. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Display or hide the matched elements with a sliding motion. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Display or hide the matched elements with a sliding motion. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'slideUp': function() { + /// + /// Hide the matched elements with a sliding motion. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Hide the matched elements with a sliding motion. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Hide the matched elements with a sliding motion. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + }, + 'stop': function() { + /// + /// Stop the currently-running animation on the matched elements. + /// A Boolean indicating whether to remove queued animation as well. Defaults to false. + /// A Boolean indicating whether to complete the current animation immediately. Defaults to false. + /// + /// + /// + /// Stop the currently-running animation on the matched elements. + /// The name of the queue in which to stop animations. + /// A Boolean indicating whether to remove queued animation as well. Defaults to false. + /// A Boolean indicating whether to complete the current animation immediately. Defaults to false. + /// + /// + }, + 'submit': function() { + /// + /// Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + /// A function to execute each time the event is triggered. + /// + /// + /// + /// Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + /// An object containing data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'target': function() { + /// Selects the target element indicated by the fragment identifier of the document's URI. + }, + 'text': function() { + /// + /// Set the content of each element in the set of matched elements to the specified text. + /// A string of text to set as the content of each matched element. + /// + /// + /// + /// Set the content of each element in the set of matched elements to the specified text. + /// A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. + /// + /// + }, + 'toArray': function() { + /// Retrieve all the DOM elements contained in the jQuery set, as an array. + /// + }, + 'toggle': function() { + /// + /// Display or hide the matched elements. + /// A string or number determining how long the animation will run. + /// A function to call once the animation is complete. + /// + /// + /// + /// Display or hide the matched elements. + /// A map of additional options to pass to the method. + /// + /// + /// + /// Display or hide the matched elements. + /// A string or number determining how long the animation will run. + /// A string indicating which easing function to use for the transition. + /// A function to call once the animation is complete. + /// + /// + /// + /// Display or hide the matched elements. + /// A Boolean indicating whether to show or hide the elements. + /// + /// + }, + 'toggleClass': function() { + /// + /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + /// One or more class names (separated by spaces) to be toggled for each element in the matched set. + /// + /// + /// + /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + /// One or more class names (separated by spaces) to be toggled for each element in the matched set. + /// A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + /// + /// + /// + /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + /// A boolean value to determine whether the class should be added or removed. + /// + /// + /// + /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + /// A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. + /// A boolean value to determine whether the class should be added or removed. + /// + /// + }, + 'trigger': function() { + /// + /// Execute all handlers and behaviors attached to the matched elements for the given event type. + /// A string containing a JavaScript event type, such as click or submit. + /// Additional parameters to pass along to the event handler. + /// + /// + /// + /// Execute all handlers and behaviors attached to the matched elements for the given event type. + /// A jQuery.Event object. + /// + /// + }, + 'triggerHandler': function() { + /// + /// Execute all handlers attached to an element for an event. + /// A string containing a JavaScript event type, such as click or submit. + /// An array of additional parameters to pass along to the event handler. + /// + /// + }, + 'unbind': function() { + /// + /// Remove a previously-attached event handler from the elements. + /// A string containing a JavaScript event type, such as click or submit. + /// The function that is to be no longer executed. + /// + /// + /// + /// Remove a previously-attached event handler from the elements. + /// A string containing a JavaScript event type, such as click or submit. + /// Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + /// + /// + /// + /// Remove a previously-attached event handler from the elements. + /// A JavaScript event object as passed to an event handler. + /// + /// + }, + 'undelegate': function() { + /// + /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + /// A selector which will be used to filter the event results. + /// A string containing a JavaScript event type, such as "click" or "keydown" + /// + /// + /// + /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + /// A selector which will be used to filter the event results. + /// A string containing a JavaScript event type, such as "click" or "keydown" + /// A function to execute at the time the event is triggered. + /// + /// + /// + /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + /// A selector which will be used to filter the event results. + /// An object of one or more event types and previously bound functions to unbind from them. + /// + /// + /// + /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + /// A string containing a namespace to unbind all events from. + /// + /// + }, + 'unload': function() { + /// + /// Bind an event handler to the "unload" JavaScript event. + /// A function to execute when the event is triggered. + /// + /// + /// + /// Bind an event handler to the "unload" JavaScript event. + /// A plain object of data that will be passed to the event handler. + /// A function to execute each time the event is triggered. + /// + /// + }, + 'unwrap': function() { + /// Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + /// + }, + 'val': function() { + /// + /// Set the value of each element in the set of matched elements. + /// A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. + /// + /// + /// + /// Set the value of each element in the set of matched elements. + /// A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + /// + /// + }, + 'visible': function() { + /// Selects all elements that are visible. + }, + 'width': function() { + /// + /// Set the CSS width of each element in the set of matched elements. + /// An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + /// + /// + /// + /// Set the CSS width of each element in the set of matched elements. + /// A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. + /// + /// + }, + 'wrap': function() { + /// + /// Wrap an HTML structure around each element in the set of matched elements. + /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements. + /// + /// + /// + /// Wrap an HTML structure around each element in the set of matched elements. + /// A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + /// + /// + }, + 'wrapAll': function() { + /// + /// Wrap an HTML structure around all elements in the set of matched elements. + /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements. + /// + /// + }, + 'wrapInner': function() { + /// + /// Wrap an HTML structure around the content of each element in the set of matched elements. + /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + /// + /// + /// + /// Wrap an HTML structure around the content of each element in the set of matched elements. + /// A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + /// + /// + }, +}); + +intellisense.annotate(window, { + '$': function() { + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// A string containing a selector expression + /// A DOM Element, Document, or jQuery to use as context + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// A DOM element to wrap in a jQuery object. + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// An array containing a set of DOM elements to wrap in a jQuery object. + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// A plain object to wrap in a jQuery object. + /// + /// + /// + /// Accepts a string containing a CSS selector which is then used to match a set of elements. + /// An existing jQuery object to clone. + /// + /// + }, +}); + diff --git a/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/jquery-1.9.1.js b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/jquery-1.9.1.js new file mode 100644 index 000000000..601045b06 --- /dev/null +++ b/O3651/O3651-2 Getting started with Apps for Office/Completed Projects/ContentGenerator - Exercise 3/ContentGeneratorWeb/Scripts/jquery-1.9.1.js @@ -0,0 +1,9616 @@ +/* NUGET: BEGIN LICENSE TEXT +jQuery v1.9.1 +Microsoft grants you the right to use these script files for the sole purpose of either: (i) interacting through your browser with the Microsoft website, subject to the website's terms of use; or (ii) using the files as included with a Microsoft product subject to that product's license terms. Microsoft reserves all other rights to the files not expressly granted by Microsoft, whether by implication, estoppel or otherwise. The notices and licenses below are for informational purposes only. +*************************************************** +* jQuery JavaScript Library v1.9.1 +* http://jquery.com/ +* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors +******************************** +* Includes Sizzle CSS Selector Engine +* http://sizzlejs.com/ +* Copyright 2012 jQuery Foundation and other contributors +******************************************************** +Provided for Informational Purposes Only +MIT License +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* NUGET: END LICENSE TEXT */ +/*! + * jQuery JavaScript Library v1.9.1 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2013-2-4 + */ +(function( window, undefined ) { + +// Can't do this because several apps including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +// Support: Firefox 18+ +//"use strict"; +var + // The deferred used on DOM ready + readyList, + + // A central reference to the root jQuery(document) + rootjQuery, + + // Support: IE<9 + // For `typeof node.method` instead of `node.method !== undefined` + core_strundefined = typeof undefined, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + location = window.location, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // [[Class]] -> type pairs + class2type = {}, + + // List of deleted data cache ids, so we can reuse them + core_deletedIds = [], + + core_version = "1.9.1", + + // Save a reference to some core methods + core_concat = core_deletedIds.concat, + core_push = core_deletedIds.push, + core_slice = core_deletedIds.slice, + core_indexOf = core_deletedIds.indexOf, + core_toString = class2type.toString, + core_hasOwn = class2type.hasOwnProperty, + core_trim = core_version.trim, + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Used for matching numbers + core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, + + // Used for splitting on whitespace + core_rnotwhite = /\S+/g, + + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }, + + // The ready event handler + completed = function( event ) { + + // readyState === "complete" is good enough for us to call the dom ready in oldIE + if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { + detach(); + jQuery.ready(); + } + }, + // Clean-up method for dom ready events + detach = function() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", completed, false ); + window.removeEventListener( "load", completed, false ); + + } else { + document.detachEvent( "onreadystatechange", completed ); + window.detachEvent( "onload", completed ); + } + }; + +jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used + jquery: core_version, + + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + + // scripts is true for back-compat + jQuery.merge( this, jQuery.parseHTML( + match[1], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return core_slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; + }, + + slice: function() { + return this.pushStack( core_slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: core_push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var src, copyIsArray, copy, name, options, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + if ( obj == null ) { + return String( obj ); + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ core_toString.call(obj) ] || "object" : + typeof obj; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !core_hasOwn.call(obj, "constructor") && + !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || core_hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + // data: string of html + // context (optional): If specified, the fragment will be created in this context, defaults to document + // keepScripts (optional): If true, will include scripts passed in the html string + parseHTML: function( data, context, keepScripts ) { + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + keepScripts = context; + context = false; + } + context = context || document; + + var parsed = rsingleTag.exec( data ), + scripts = !keepScripts && []; + + // Single tag + if ( parsed ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ); + if ( scripts ) { + jQuery( scripts ).remove(); + } + return jQuery.merge( [], parsed.childNodes ); + }, + + parseJSON: function( data ) { + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + if ( data === null ) { + return data; + } + + if ( typeof data === "string" ) { + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + if ( data ) { + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + } + } + } + + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { + return null; + } + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && jQuery.trim( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var value, + i = 0, + length = obj.length, + isArray = isArraylike( obj ); + + if ( args ) { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } + } + + return obj; + }, + + // Use native String.trim function wherever possible + trim: core_trim && !core_trim.call("\uFEFF\xA0") ? + function( text ) { + return text == null ? + "" : + core_trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArraylike( Object(arr) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + core_push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( core_indexOf ) { + return core_indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var l = second.length, + i = first.length, + j = 0; + + if ( typeof l === "number" ) { + for ( ; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var retVal, + ret = [], + i = 0, + length = elems.length; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, + i = 0, + length = elems.length, + isArray = isArraylike( elems ), + ret = []; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return core_concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var args, proxy, tmp; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = core_slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + // Multifunctional method to get and set values of a collection + // The value/s can optionally be executed if it's a function + access: function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; + }, + + now: function() { + return ( new Date() ).getTime(); + } +}); + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", completed ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", completed ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + // and execute any waiting functions + jQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +function isArraylike( obj ) { + var length = obj.length, + type = jQuery.type( obj ); + + if ( jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.nodeType === 1 && length ) { + return true; + } + + return type === "array" || type !== "function" && + ( length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj ); +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // First callback to fire (used internally by add and fireWith) + firingStart, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( list && ( !fired || stack ) ) { + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var action = tuple[ 0 ], + fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + } + }); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[0] ] = function() { + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = core_slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; + if( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); +jQuery.support = (function() { + + var support, all, a, + input, select, fragment, + opt, eventName, isSupported, i, + div = document.createElement("div"); + + // Setup + div.setAttribute( "className", "t" ); + div.innerHTML = "
a"; + + // Support tests won't run in some limited or non-browser environments + all = div.getElementsByTagName("*"); + a = div.getElementsByTagName("a")[ 0 ]; + if ( !all || !a || !all.length ) { + return {}; + } + + // First batch of tests + select = document.createElement("select"); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName("input")[ 0 ]; + + a.style.cssText = "top:1px;float:left;opacity:.5"; + support = { + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.5/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) + checkOn: !!input.value, + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Tests for enctype support on a form (#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", + + // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode + boxModel: document.compatMode === "CSS1Compat", + + // Will be defined later + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true, + boxSizingReliable: true, + pixelPosition: false + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Support: IE<9 + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + // Check if we can trust getAttribute("value") + input = document.createElement("input"); + input.setAttribute( "value", "" ); + support.input = input.getAttribute( "value" ) === ""; + + // Check if an input maintains its value after becoming a radio + input.value = "t"; + input.setAttribute( "type", "radio" ); + support.radioValue = input.value === "t"; + + // #11217 - WebKit loses check when the name is after the checked attribute + input.setAttribute( "checked", "t" ); + input.setAttribute( "name", "t" ); + + fragment = document.createDocumentFragment(); + fragment.appendChild( input ); + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Opera does not clone events (and typeof div.attachEvent === undefined). + // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() + if ( div.attachEvent ) { + div.attachEvent( "onclick", function() { + support.noCloneEvent = false; + }); + + div.cloneNode( true ).click(); + } + + // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php + for ( i in { submit: true, change: true, focusin: true }) { + div.setAttribute( eventName = "on" + i, "t" ); + + support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; + } + + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + // Run tests that need a body at doc ready + jQuery(function() { + var container, marginDiv, tds, + divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + container = document.createElement("div"); + container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; + + body.appendChild( container ).appendChild( div ); + + // Support: IE8 + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + div.innerHTML = "
t
"; + tds = div.getElementsByTagName("td"); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Support: IE8 + // Check if empty table cells still have offsetWidth/Height + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Check box-sizing and margin behavior + div.innerHTML = ""; + div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; + support.boxSizing = ( div.offsetWidth === 4 ); + support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); + + // Use window.getComputedStyle because jsdom on node.js will break without it. + if ( window.getComputedStyle ) { + support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. (#3333) + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = div.appendChild( document.createElement("div") ); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; + + support.reliableMarginRight = + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); + } + + if ( typeof div.style.zoom !== core_strundefined ) { + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.innerHTML = ""; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + div.style.display = "block"; + div.innerHTML = "
"; + div.firstChild.style.width = "5px"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); + + if ( support.inlineBlockNeedsLayout ) { + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + // Support: IE<8 + body.style.zoom = 1; + } + } + + body.removeChild( container ); + + // Null elements to avoid leaks in IE + container = div = tds = marginDiv = null; + }); + + // Null elements to avoid leaks in IE + all = select = fragment = opt = a = input = null; + + return support; +})(); + +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, + rmultiDash = /([A-Z])/g; + +function internalData( elem, name, data, pvt /* Internal Use Only */ ){ + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var i, l, thisCache, + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split(" "); + } + } + } else { + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( jQuery.map( name, jQuery.camelCase ) ); + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + } else if ( jQuery.support.deleteExpando || cache != cache.window ) { + delete cache[ id ]; + + // When all else fails, null + } else { + cache[ id ] = null; + } +} + +jQuery.extend({ + cache: {}, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + // Do not set data on non-element because it will not be cleared (#8335). + if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { + return false; + } + + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; + + // nodes accept data unless otherwise specified; rejection can be conditional + return !noData || noData !== true && elem.getAttribute("classid") === noData; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var attrs, name, + elem = this[0], + i = 0, + data = null; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + attrs = elem.attributes; + for ( ; i < attrs.length; i++ ) { + name = attrs[i].name; + + if ( !name.indexOf( "data-" ) ) { + name = jQuery.camelCase( name.slice(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + return jQuery.access( this, function( value ) { + + if ( value === undefined ) { + // Try to fetch any internally stored data first + return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; + } + + this.each(function() { + jQuery.data( this, key, value ); + }); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + hooks.cur = fn; + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery._removeData( elem, type + "queue" ); + jQuery._removeData( elem, key ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var nodeHook, boolHook, + rclass = /[\t\r\n]/g, + rreturn = /\r/g, + rfocusable = /^(?:input|select|textarea|button|object)$/i, + rclickable = /^(?:a|area)$/i, + rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, + ruseDefault = /^(?:checked|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute, + getSetInput = jQuery.support.input; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classes, elem, cur, clazz, j, + i = 0, + len = this.length, + proceed = typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call( this, j, this.className ) ); + }); + } + + if ( proceed ) { + // The disjunction here is for better compressibility (see removeClass) + classes = ( value || "" ).match( core_rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + " " + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + elem.className = jQuery.trim( cur ); + + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, clazz, j, + i = 0, + len = this.length, + proceed = arguments.length === 0 || typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call( this, j, this.className ) ); + }); + } + if ( proceed ) { + classes = ( value || "" ).match( core_rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + "" + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + elem.className = value ? jQuery.trim( cur ) : ""; + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.match( core_rnotwhite ) || []; + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space separated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + // Toggle whole class name + } else if ( type === core_strundefined || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // If the element has a class name or if we're passed "false", + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var ret, hooks, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var val, + self = jQuery(this); + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, option, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one" || index < 0, + values = one ? null : [], + max = one ? index + 1 : options.length, + i = index < 0 ? + max : + one ? index : 0; + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // oldIE doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + // Don't return options that are disabled or in a disabled optgroup + ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && + ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attr: function( elem, name, value ) { + var hooks, notxml, ret, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === core_strundefined ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + + } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, value + "" ); + return value; + } + + } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + // In IE9+, Flash objects don't have .getAttribute (#12945) + // Support: IE9+ + if ( typeof elem.getAttribute !== core_strundefined ) { + ret = elem.getAttribute( name ); + } + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var name, propName, + i = 0, + attrNames = value && value.match( core_rnotwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( (name = attrNames[i++]) ) { + propName = jQuery.propFix[ name ] || name; + + // Boolean attributes get special treatment (#10870) + if ( rboolean.test( name ) ) { + // Set corresponding property to false for boolean attributes + // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 + if ( !getSetAttribute && ruseDefault.test( name ) ) { + elem[ jQuery.camelCase( "default-" + name ) ] = + elem[ propName ] = false; + } else { + elem[ propName ] = false; + } + + // See #9699 for explanation of this approach (setting first, then removal) + } else { + jQuery.attr( elem, name, "" ); + } + + elem.removeAttribute( getSetAttribute ? name : propName ); + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to default in case type is set after value during creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + var + // Use .prop to determine if this attribute is understood as boolean + prop = jQuery.prop( elem, name ), + + // Fetch it accordingly + attr = typeof prop === "boolean" && elem.getAttribute( name ), + detail = typeof prop === "boolean" ? + + getSetInput && getSetAttribute ? + attr != null : + // oldIE fabricates an empty string for missing boolean attributes + // and conflates checked/selected into attroperties + ruseDefault.test( name ) ? + elem[ jQuery.camelCase( "default-" + name ) ] : + !!attr : + + // fetch an attribute node for properties not recognized as boolean + elem.getAttributeNode( name ); + + return detail && detail.value !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { + // IE<8 needs the *property* name + elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); + + // Use defaultChecked and defaultSelected for oldIE + } else { + elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; + } + + return name; + } +}; + +// fix oldIE value attroperty +if ( !getSetInput || !getSetAttribute ) { + jQuery.attrHooks.value = { + get: function( elem, name ) { + var ret = elem.getAttributeNode( name ); + return jQuery.nodeName( elem, "input" ) ? + + // Ignore the value *property* by using defaultValue + elem.defaultValue : + + ret && ret.specified ? ret.value : undefined; + }, + set: function( elem, value, name ) { + if ( jQuery.nodeName( elem, "input" ) ) { + // Does not return so that setAttribute is also used + elem.defaultValue = value; + } else { + // Use nodeHook if defined (#1954); otherwise setAttribute is fine + return nodeHook && nodeHook.set( elem, value, name ); + } + } + }; +} + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret = elem.getAttributeNode( name ); + return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? + ret.value : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + elem.setAttributeNode( + (ret = elem.ownerDocument.createAttribute( name )) + ); + } + + ret.value = value += ""; + + // Break association with cloned elements by also using setAttribute (#9646) + return name === "value" || value === elem.getAttribute( name ) ? + value : + undefined; + } + }; + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + nodeHook.set( elem, value === "" ? false : value, name ); + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); +} + + +// Some attributes require a special call on IE +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret == null ? undefined : ret; + } + }); + }); + + // href/src property should get the full normalized URL (#10299/#12915) + jQuery.each([ "href", "src" ], function( i, name ) { + jQuery.propHooks[ name ] = { + get: function( elem ) { + return elem.getAttribute( name, 4 ); + } + }; + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Note: IE uppercases css property names, but if we were to .toLowerCase() + // .cssText, that would destroy case senstitivity in URL's, like in "background" + return elem.style.cssText || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = value + "" ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + var tmp, events, t, handleObjIn, + special, eventHandle, handleObj, + handlers, type, namespaces, origType, + elemData = jQuery._data( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !(events = elemData.events) ) { + events = elemData.events = {}; + } + if ( !(eventHandle = elemData.handle) ) { + eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = ( types || "" ).match( core_rnotwhite ) || [""]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !(handlers = events[ type ]) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + var j, handleObj, tmp, + origCount, t, events, + special, handlers, type, + namespaces, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( core_rnotwhite ) || [""]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + var handle, ontype, cur, + bubbleType, special, tmp, i, + eventPath = [ elem || document ], + type = core_hasOwn.call( event, "type" ) ? event.type : event, + namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf(":") < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + event.isTrigger = true; + event.namespace = namespaces.join("."); + event.namespace_re = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === (elem.ownerDocument || document) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, ret, handleObj, matched, j, + handlerQueue = [], + args = core_slice.call( arguments ), + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( (event.result = ret) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var sel, handleObj, matches, i, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + + for ( ; cur != this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, handlers: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Chrome 23+, Safari? + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var body, eventDoc, doc, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + } + }, + focus: { + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== document.activeElement && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === document.activeElement && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + + beforeunload: { + postDispatch: function( event ) { + + // Even when returnValue equals to undefined Firefox will still show alert + if ( event.result !== undefined ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === core_strundefined ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + if ( !e ) { + return; + } + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !jQuery._data( form, "submitBubbles" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + jQuery._data( form, "submitBubbles", true ); + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + jQuery._data( elem, "changeBubbles", true ); + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var type, origFn; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + var elem = this[0]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://sizzlejs.com/ + */ +(function( window, undefined ) { + +var i, + cachedruns, + Expr, + getText, + isXML, + compile, + hasDuplicate, + outermostContext, + + // Local document vars + setDocument, + document, + docElem, + documentIsXML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + sortOrder, + + // Instance-specific data + expando = "sizzle" + -(new Date()), + preferredDoc = window.document, + support = {}, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + + // General-purpose constants + strundefined = typeof undefined, + MAX_NEGATIVE = 1 << 31, + + // Array methods + arr = [], + pop = arr.pop, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf if we can't use a native one + indexOf = arr.indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + operators = "([*^$|!~]?=)", + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments quoted, + // then not containing pseudos/brackets, + // then attribute selectors/non-parenthetical expressions, + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rsibling = /[\x20\t\r\n\f]*[+~]/, + + rnative = /^[^{]+\{\s*\[native code/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rescape = /'|\\/g, + rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, + funescape = function( _, escaped ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + return high !== high ? + escaped : + // BMP codepoint + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }; + +// Use a stripped-down slice if we can't use a native one +try { + slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; +} catch ( e ) { + slice = function( i ) { + var elem, + results = []; + while ( (elem = this[i++]) ) { + results.push( elem ); + } + return results; + }; +} + +/** + * For feature detection + * @param {Function} fn The function to test for native support + */ +function isNative( fn ) { + return rnative.test( fn + "" ); +} + +/** + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var cache, + keys = []; + + return (cache = function( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key += " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key ] = value); + }); +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return fn( div ); + } catch (e) { + return false; + } finally { + // release memory in IE + div = null; + } +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { + return []; + } + + if ( !documentIsXML && !seed ) { + + // Shortcuts + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { + push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); + return results; + } + } + + // QSA path + if ( support.qsa && !rbuggyQSA.test(selector) ) { + old = true; + nid = expando; + newContext = context; + newSelector = nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && context.parentNode || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, slice.call( newContext.querySelectorAll( + newSelector + ), 0 ) ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Detect xml + * @param {Element|Object} elem An element or a document + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var doc = node ? node.ownerDocument || node : preferredDoc; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + + // Support tests + documentIsXML = isXML( doc ); + + // Check if getElementsByTagName("*") returns only elements + support.tagNameNoComments = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Check if attributes should be retrieved by attribute nodes + support.attributes = assert(function( div ) { + div.innerHTML = ""; + var type = typeof div.lastChild.getAttribute("multiple"); + // IE8 returns a string for some attributes even when not present + return type !== "boolean" && type !== "string"; + }); + + // Check if getElementsByClassName can be trusted + support.getByClassName = assert(function( div ) { + // Opera can't find a second classname (in 9.6) + div.innerHTML = ""; + if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { + return false; + } + + // Safari 3.2 caches class attributes and doesn't catch changes + div.lastChild.className = "e"; + return div.getElementsByClassName("e").length === 2; + }); + + // Check if getElementById returns elements by name + // Check if getElementsByName privileges form controls or returns elements by ID + support.getByName = assert(function( div ) { + // Inject content + div.id = expando + 0; + div.innerHTML = "
"; + docElem.insertBefore( div, docElem.firstChild ); + + // Test + var pass = doc.getElementsByName && + // buggy browsers will return fewer than the correct 2 + doc.getElementsByName( expando ).length === 2 + + // buggy browsers will return more than the correct 0 + doc.getElementsByName( expando + 0 ).length; + support.getIdNotName = !doc.getElementById( expando ); + + // Cleanup + docElem.removeChild( div ); + + return pass; + }); + + // IE6/7 return modified attributes + Expr.attrHandle = assert(function( div ) { + div.innerHTML = ""; + return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && + div.firstChild.getAttribute("href") === "#"; + }) ? + {} : + { + "href": function( elem ) { + return elem.getAttribute( "href", 2 ); + }, + "type": function( elem ) { + return elem.getAttribute("type"); + } + }; + + // ID find and filter + if ( support.getIdNotName ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && !documentIsXML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && !documentIsXML ) { + var m = context.getElementById( id ); + + return m ? + m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? + [m] : + undefined : + []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.tagNameNoComments ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Name + Expr.find["NAME"] = support.getByName && function( tag, context ) { + if ( typeof context.getElementsByName !== strundefined ) { + return context.getElementsByName( name ); + } + }; + + // Class + Expr.find["CLASS"] = support.getByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { + return context.getElementsByClassName( className ); + } + }; + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21), + // no need to also add to buggyMatches since matches checks buggyQSA + // A support test would require too much code (would include document ready) + rbuggyQSA = [ ":focus" ]; + + if ( (support.qsa = isNative(doc.querySelectorAll)) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explictly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = ""; + + // IE8 - Some boolean attributes are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Opera 10-12/IE8 - ^= $= *= and empty values + // Should not select anything + div.innerHTML = ""; + if ( div.querySelectorAll("[i^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || + docElem.mozMatchesSelector || + docElem.webkitMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + // Document order sorting + sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + var compare; + + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { + if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { + if ( a === doc || contains( preferredDoc, a ) ) { + return -1; + } + if ( b === doc || contains( preferredDoc, b ) ) { + return 1; + } + return 0; + } + return compare & 4 ? -1 : 1; + } + + return a.compareDocumentPosition ? -1 : 1; + } : + function( a, b ) { + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Parentless nodes are either documents or disconnected + } else if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + // Always assume the presence of duplicates if sort doesn't + // pass them to our comparison function (as in Google Chrome). + hasDuplicate = false; + [0, 0].sort( sortOrder ); + support.detectDuplicates = hasDuplicate; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + // rbuggyQSA always contains :focus, so no need for an existence check + if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, document, null, [elem] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + var val; + + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + if ( !documentIsXML ) { + name = name.toLowerCase(); + } + if ( (val = Expr.attrHandle[ name ]) ) { + return val( elem ); + } + if ( documentIsXML || support.attributes ) { + return elem.getAttribute( name ); + } + return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? + name : + val && val.specified ? val.value : null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +// Document sorting and removing duplicates +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + i = 1, + j = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( ; (elem = results[i]); i++ ) { + if ( elem === results[ i - 1 ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + return results; +}; + +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +// Returns a function to use in pseudos for input types +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +// Returns a function to use in pseudos for buttons +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +// Returns a function to use in pseudos for positionals +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[5] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[4] ) { + match[2] = match[4]; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeName ) { + if ( nodeName === "*" ) { + return function() { return true; }; + } + + nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifider + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsXML ? + elem.getAttribute("xml:lang") || elem.getAttribute("lang") : + elem.lang) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push( { + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var data, cache, outerCache, + dirkey = dirruns + " " + doneName; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { + if ( (data = cache[1]) === true || data === cachedruns ) { + return data === true; + } + } else { + cache = outerCache[ dir ] = [ dirkey ]; + cache[1] = matcher( elem, context, xml ) || cachedruns; + if ( cache[1] === true ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + // A counter to specify which element is currently being matched + var matcherCachedRuns = 0, + bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = matcherCachedRuns; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++matcherCachedRuns; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function select( selector, context, results, seed ) { + var i, tokens, token, type, find, + match = tokenize( selector ); + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && !documentIsXML && + Expr.relative[ tokens[1].type ] ) { + + context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; + if ( !context ) { + return results; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && context.parentNode || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, slice.call( seed, 0 ) ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + documentIsXML, + results, + rsibling.test( selector ) + ); + return results; +} + +// Deprecated +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Easy API for creating new setFilters +function setFilters() {} +Expr.filters = setFilters.prototype = Expr.pseudos; +Expr.setFilters = new setFilters(); + +// Initialize with the default document +setDocument(); + +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})( window ); +var runtil = /Until$/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, + isSimple = /^.[^:#\[\.,]*$/, + rneedsContext = jQuery.expr.match.needsContext, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var i, ret, self, + len = this.length; + + if ( typeof selector !== "string" ) { + self = this; + return this.pushStack( jQuery( selector ).filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }) ); + } + + ret = []; + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, this[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; + return ret; + }, + + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false) ); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true) ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + rneedsContext.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + ret = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + cur = this[i]; + + while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + } + cur = cur.parentNode; + } + } + + return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( jQuery.unique(all) ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +jQuery.fn.andSelf = jQuery.fn.addBack; + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( this.length > 1 && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rtbody = /\s*$/g, + + // We have to close these tags to support XHTML (#13200) + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + area: [ 1, "", "" ], + param: [ 1, "", "" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + col: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] + }, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +jQuery.fn.extend({ + text: function( value ) { + return jQuery.access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + }, null, value, arguments.length ); + }, + + wrapAll: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapAll( html.call(this, i) ); + }); + } + + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + + if ( this[0].parentNode ) { + wrap.insertBefore( this[0] ); + } + + wrap.map(function() { + var elem = this; + + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { + elem = elem.firstChild; + } + + return elem; + }).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapInner( html.call(this, i) ); + }); + } + + return this.each(function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + }); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each(function(i) { + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); + }); + }, + + unwrap: function() { + return this.parent().each(function() { + if ( !jQuery.nodeName( this, "body" ) ) { + jQuery( this ).replaceWith( this.childNodes ); + } + }).end(); + }, + + append: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.insertBefore( elem, this.firstChild ); + } + }); + }, + + before: function() { + return this.domManip( arguments, false, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + }); + }, + + after: function() { + return this.domManip( arguments, false, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + }); + }, + + // keepData is for internal use only--do not document + remove: function( selector, keepData ) { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem ) ); + } + + if ( elem.parentNode ) { + if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { + setGlobalEval( getAll( elem, "script" ) ); + } + elem.parentNode.removeChild( elem ); + } + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function () { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return jQuery.access( this, function( value ) { + var elem = this[0] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1>" ); + + try { + for (; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + elem = this[i] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch(e) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function( value ) { + var isFunc = jQuery.isFunction( value ); + + // Make sure that the elements are removed from the DOM before they are inserted + // this can help fix replacing a parent with child elements + if ( !isFunc && typeof value !== "string" ) { + value = jQuery( value ).not( this ).detach(); + } + + return this.domManip( [ value ], true, function( elem ) { + var next = this.nextSibling, + parent = this.parentNode; + + if ( parent ) { + jQuery( this ).remove(); + parent.insertBefore( elem, next ); + } + }); + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, table, callback ) { + + // Flatten any nested arrays + args = core_concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = this.length, + set = this, + iNoClone = l - 1, + value = args[0], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { + return this.each(function( index ) { + var self = set.eq( index ); + if ( isFunction ) { + args[0] = value.call( this, index, table ? self.html() : undefined ); + } + self.domManip( args, table, callback ); + }); + } + + if ( l ) { + fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + table = table && jQuery.nodeName( first, "tr" ); + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( + table && jQuery.nodeName( this[i], "table" ) ? + findOrAppend( this[i], "tbody" ) : + this[i], + node, + i + ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { + + if ( node.src ) { + // Hope ajax is available... + jQuery.ajax({ + url: node.src, + type: "GET", + dataType: "script", + async: false, + global: false, + "throws": true + }); + } else { + jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return this; + } +}); + +function findOrAppend( elem, tag ) { + return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + var attr = elem.getAttributeNode("type"); + elem.type = ( attr && attr.specified ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[1]; + } else { + elem.removeAttribute("type"); + } + return elem; +} + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; (elem = elems[i]) != null; i++ ) { + jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); + } +} + +function cloneCopyEvent( src, dest ) { + + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, e, data; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { + data = jQuery._data( dest ); + + for ( e in data.events ) { + jQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( jQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone(true); + jQuery( insert[i] )[ original ]( elems ); + + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() + core_push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +}); + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + +// Used in buildFragment, fixes the defaultChecked property +function fixDefaultChecked( elem ) { + if ( manipulation_rcheckableType.test( elem.type ) ) { + elem.defaultChecked = elem.checked; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, node, clone, i, srcElements, + inPage = jQuery.contains( elem.ownerDocument, elem ); + + if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; (node = srcElements[i]) != null; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + fixCloneNodeIssues( node, destElements[i] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; (node = srcElements[i]) != null; i++ ) { + cloneCopyEvent( node, destElements[i] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + buildFragment: function( elems, context, scripts, selection ) { + var j, elem, contains, + tmp, tag, tbody, wrap, + l = elems.length, + + // Ensure a safe fragment + safe = createSafeFragment( context ), + + nodes = [], + i = 0; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || safe.appendChild( context.createElement("div") ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + + tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; + + // Descend through wrappers to the right content + j = wrap[0]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Manually add leading whitespace removed by IE + if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); + } + + // Remove IE's autoinserted from table fragments + if ( !jQuery.support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[1] === "
" && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !jQuery.support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( (elem = nodes[ i++ ]) ) { + + // #4087 - If origin and destination elements are the same, and this is + // that element, do not do anything + if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( (elem = tmp[ j++ ]) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; + }, + + cleanData: function( elems, /* internal */ acceptData ) { + var elem, type, id, data, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + deleteExpando = jQuery.support.deleteExpando, + special = jQuery.event.special; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( acceptData || jQuery.acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; + + } else if ( typeof elem.removeAttribute !== core_strundefined ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + core_deletedIds.push( id ); + } + } + } + } + } +}); +var iframe, getStyles, curCSS, + ralpha = /alpha\([^)]*\)/i, + ropacity = /opacity\s*=\s*([^)]*)/, + rposition = /^(top|right|bottom|left)$/, + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rmargin = /^margin/, + rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), + rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), + rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), + elemdisplay = { BODY: "block" }, + + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: 0, + fontWeight: 400 + }, + + cssExpand = [ "Top", "Right", "Bottom", "Left" ], + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; + +// return a css property mapped to a potentially vendor prefixed property +function vendorPropName( style, name ) { + + // shortcut for names that are not vendor prefixed + if ( name in style ) { + return name; + } + + // check for vendor prefixed names + var capName = name.charAt(0).toUpperCase() + name.slice(1), + origName = name, + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in style ) { + return name; + } + } + + return origName; +} + +function isHidden( elem, el ) { + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); +} + +function showHide( elements, show ) { + var display, elem, hidden, + values = [], + index = 0, + length = elements.length; + + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + values[ index ] = jQuery._data( elem, "olddisplay" ); + display = elem.style.display; + if ( show ) { + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !values[ index ] && display === "none" ) { + elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( elem.style.display === "" && isHidden( elem ) ) { + values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); + } + } else { + + if ( !values[ index ] ) { + hidden = isHidden( elem ); + + if ( display && display !== "none" || !hidden ) { + jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); + } + } + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + if ( !show || elem.style.display === "none" || elem.style.display === "" ) { + elem.style.display = show ? values[ index ] || "" : "none"; + } + } + + return elements; +} + +jQuery.fn.extend({ + css: function( name, value ) { + return jQuery.access( this, function( elem, name, value ) { + var len, styles, + map = {}, + i = 0; + + if ( jQuery.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + }, + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + var bool = typeof state === "boolean"; + + return this.each(function() { + if ( bool ? state : isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + }); + } +}); + +jQuery.extend({ + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Exclude the following css properties to add px + cssNumber: { + "columnCount": true, + "fillOpacity": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + // normalize float css property + "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + style = elem.style; + + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // convert relative number strings (+= or -=) to relative numbers. #7345 + if ( type === "string" && (ret = rrelNum.exec( value )) ) { + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); + // Fixes bug #9237 + type = "number"; + } + + // Make sure that NaN and null values aren't set. See: #7116 + if ( value == null || type === "number" && isNaN( value ) ) { + return; + } + + // If a number was passed in, add 'px' to the (except for certain CSS properties) + if ( type === "number" && !jQuery.cssNumber[ origName ] ) { + value += "px"; + } + + // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, + // but it would mean to define eight (for every problematic property) identical functions + if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { + + // Wrapped to prevent IE from throwing errors when 'invalid' values are provided + // Fixes bug #5509 + try { + style[ name ] = value; + } catch(e) {} + } + + } else { + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var num, val, hooks, + origName = jQuery.camelCase( name ); + + // Make sure that we're working with the right name + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + //convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Return, converting to number if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; + } + return val; + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; + } +}); + +// NOTE: we've included the "window" in window.getComputedStyle +// because jsdom on node.js will break without it. +if ( window.getComputedStyle ) { + getStyles = function( elem ) { + return window.getComputedStyle( elem, null ); + }; + + curCSS = function( elem, name, _computed ) { + var width, minWidth, maxWidth, + computed = _computed || getStyles( elem ), + + // getPropertyValue is only needed for .css('filter') in IE9, see #12537 + ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, + style = elem.style; + + if ( computed ) { + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret; + }; +} else if ( document.documentElement.currentStyle ) { + getStyles = function( elem ) { + return elem.currentStyle; + }; + + curCSS = function( elem, name, _computed ) { + var left, rs, rsLeft, + computed = _computed || getStyles( elem ), + ret = computed ? computed[ name ] : undefined, + style = elem.style; + + // Avoid setting ret to empty string here + // so we don't default to auto + if ( ret == null && style && style[ name ] ) { + ret = style[ name ]; + } + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + // but not position css attributes, as those are proportional to the parent element instead + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { + + // Remember the original values + left = style.left; + rs = elem.runtimeStyle; + rsLeft = rs && rs.left; + + // Put in the new values to get a computed value out + if ( rsLeft ) { + rs.left = elem.currentStyle.left; + } + style.left = name === "fontSize" ? "1em" : ret; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + if ( rsLeft ) { + rs.left = rsLeft; + } + } + + return ret === "" ? "auto" : ret; + }; +} + +function setPositiveNumber( elem, value, subtract ) { + var matches = rnumsplit.exec( value ); + return matches ? + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { + var i = extra === ( isBorderBox ? "border" : "content" ) ? + // If we already have the right measurement, avoid augmentation + 4 : + // Otherwise initialize for horizontal or vertical properties + name === "width" ? 1 : 0, + + val = 0; + + for ( ; i < 4; i += 2 ) { + // both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); + } + + if ( isBorderBox ) { + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // at this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } else { + // at this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // at this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with offset property, which is equivalent to the border-box value + var valueIsBorderBox = true, + val = name === "width" ? elem.offsetWidth : elem.offsetHeight, + styles = getStyles( elem ), + isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // some non-html elements return undefined for offsetWidth, so check for null/undefined + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 + if ( val <= 0 || val == null ) { + // Fall back to computed then uncomputed css if necessary + val = curCSS( elem, name, styles ); + if ( val < 0 || val == null ) { + val = elem.style[ name ]; + } + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test(val) ) { + return val; + } + + // we need the check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + } + + // use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles + ) + ) + "px"; +} + +// Try to determine the default display value of an element +function css_defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + // Use the already-created iframe if possible + iframe = ( iframe || + jQuery("